Disk error testing
1. Check disk for bad blocks using a read-only test
Make sure that your disk is umounted and run the following command:
badblocks -sv /dev/sda1
The meaning of
33.82% done, 23:14 elapsed. (208/0/0 errors)
is
<number of read errors>/<number of write errors>/<number of corruption errors>
For an SSD it takes aroung 9 seconds to test 1GB of disk space.
2. Check disk for bad blocks using a read-write test
badblocks -wsv -o extra_hdd_badblocks.txt /dev/sdc
It will output the bad blocks to the given file. -w
will run a write-mode test, removing the data from the disk. You can also use -n
for a non-destructive read-write test.
3. Fix bad blocks using fsck:
fsck.ext4 -c /dev/sda
I used this on a ext4 filesystem created with mkfs.ext4 /dev/sda
4. Check S.M.A.R.T. status:
smartctl -H /dev/sda
smartctl 6.4 2014-10-07 r4002 [x86_64-linux-3.16.0-4-amd64] (local build)
Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
5. HDD Info:
smartctl -i /dev/sda
smartctl 6.4 2014-10-07 r4002 [x86_64-linux-3.16.0-4-amd64] (local build)
Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Seagate Barracuda 7200.12
Device Model: ST3500418AS
Serial Number: 6VM8M2GB
LU WWN Device Id: 5 000c50 01ba9e451
Firmware Version: CC38
User Capacity: 500,106,780,160 bytes [500 GB]
Sector Size: 512 bytes logical/physical
Rotation Rate: 7200 rpm
Device is: In smartctl database [for details use: -P show]
ATA Version is: ATA8-ACS T13/1699-D revision 4
SATA Version is: SATA 2.6, 3.0 Gb/s
Local Time is: Tue Jun 30 10:57:35 2015 EEST
==> WARNING: A firmware update for this drive may be available,
see the following Seagate web pages:
http://knowledge.seagate.com/articles/en_US/FAQ/207931en
http://knowledge.seagate.com/articles/en_US/FAQ/213891en
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
6. More HDD Info:
smartctl -a /dev/sda
7. Other HDD Info:
hdparm -I /dev/sda