Badblocks: Difference between revisions
Appearance
| Line 4: | Line 4: | ||
'''This is a destructive test.''' | '''This is a destructive test.''' | ||
ETA is approximately 1 day per 4 terabytes. | |||
<pre> | <pre> | ||
badblocks -wsv -b 4096 /dev/sdg | badblocks -wsv -b 4096 /dev/sdg | ||
Revision as of 01:21, 4 July 2020
Badblocks is a tool for detecting bad blocks in your hard disk.
Usage
The following will write to every block and read back to identify the number of bad blocks.
This is a destructive test. ETA is approximately 1 day per 4 terabytes.
badblocks -wsv -b 4096 /dev/sdg
-wdo a destructive write test-sshow progress-vverbose-b numblock size. Use 4096 typically.-p numdo num iterations. Typically 1 is sufficient.-t test_patternTest pattern. Select from [random,
To save the list of bad blocks, you need to run e2fsck or mkfs.ext4:
sudo e2fsck -fcck /dev/device
-fforce check-ccnon-destructive write test-kadd bad blocks to bad blocks list
mkfs.ext4 -cc /dev/device