Check disk: Difference between revisions
No edit summary  | 
				No edit summary  | 
				||
| Line 9: | Line 9: | ||
This is a tested way to check a PARTITION for bad blocks, and repair:  | This is a tested way to check a PARTITION for bad blocks, and repair:  | ||
  su -  |   su -  | ||
  e2fsck -c /dev/  |   e2fsck -c /dev/sda5  | ||
To scan an entire drive for badblocks (which MAY cause firmware to improve things...?):  | To scan an entire drive for badblocks (which MAY cause firmware to improve things...?):  | ||
  badblocks -svv /dev/sda  |   badblocks -svv /dev/sda  | ||
To repair a drive, you MAY try this, but not tested.  e2fsck should be preferred according to [man badblocks]  | To repair a drive, you MAY try this, but not tested.  e2fsck should be preferred according to [man badblocks]  | ||
  badblocks -svvn -c 262144 /dev/sda  |   badblocks -svvn -c 262144 /dev/sda  | ||
Revision as of 16:09, 14 April 2016
Most drive health maintenance is done internally by S.M.A.R.T.
# install smartctl tools smartctl -c /dev/sdf # to peek at available tests and how long they typically take to run smartctl -t short /dev/sdf watch -n 3 smartctl -l selftest /dev/sdf # until success, takes about 1 minute # if you're feeling ambitious, rerun with [-t long]
You can do more. Boot to a live mode to test root partitions.
This is a tested way to check a PARTITION for bad blocks, and repair:
su - e2fsck -c /dev/sda5
To scan an entire drive for badblocks (which MAY cause firmware to improve things...?):
badblocks -svv /dev/sda
To repair a drive, you MAY try this, but not tested. e2fsck should be preferred according to [man badblocks]
badblocks -svvn -c 262144 /dev/sda