wiki:Disks

Version 2 (modified by ypap, 11 months ago) ( diff )

--

How to check a disk's health

SATA Disks

To check a SATA Disk (either HDD or SSD) we can use the smartctl utility:

  • Install with: apt install smartmontools
  • smartctl -a /dev/sdX to see all the information about the disk
  • smartctl -t <short|long> /dev/sdX to run a short or long test
  • smartctl -X /dev/sdX to abort a test

More info on the smartctl utility here

NVMe disks

smartctl can work for NVMe disks but cannot run any tests like above.

We can use the nvme utility to see information about nvme disks.

  • Install with: apt install nvme-cli
  • nvme list shows the nvme disks on the machine
  • nvme smart-log /dev/nvmeXnX shows the SMART information about the disk.

More info on the nvme utility here

Check disk r/w speed

Read speed: hdparm -tT /dev/sdX (or nvmeXnX) Write speed: dd if=/dev/zero of=test bs=1G count=1 oflag=direct (test must be on the disk)

badblocks

We can check for bad blocks through (works with NVMe and SATA): badblocks -v -o output_file /dev/sdX

Note: See TracWiki for help on using the wiki.