Hard disk check


linux hard disk hugo

To check hard disk for errors.

  1. Check UDMA_CRC_Error_Count is zero is right-hand column, also check that Temperature_Celsius WORST value, it should be less than 60.
    smartctl -a /dev/sda
  1. IMPORTANT: Using the -w option on a device containing an existing file system erases the data on that device.
    smartctl -t long /dev/sda
  1. To check the drive “sdb” in non-destructive read-write mode and display progress by writing out the block numbers as they are checked.
        badblocks -nvs /dev/sdb 
  1. To check the sixth partition of the drive “sdb”, in destructive read-write mode and display progress by writing out the block numbers as they are checked. All data will be overwritten at the block level. If used on an entire disk as in the previous example, it destroys MBRs, partitions and data alike.
        badblocks -wvs /dev/sdb6 
  1. Writes 4 different patterns on the whole drive /dev/sdb and verifies by reading back. Modern disk drives will probably not show any defective sectors because they silently remap bad sectors to spare tracks[citation needed], but running the program with a new drive for several days will test the whole surface, and when reading it afterwards S.M.A.R.T. data will eventually show reallocated sectors.
        badblocks -wvsb 4096 /dev/sdb 
  1. Test speed of hard disk write operation - create a 1gb file
        dd if=/dev/zero of=test bs=64k count=16k conv=fdatasync