1. Install badblocks
Yum install-y e2fsprogs
2. Check
Read test:
Badblocks-s-v/dev/sdb
Read/write test: (slow)
Badblocks-s-w-v/dev/sdb
Badblocks usage
Syntax:
Badblocks [-svw] [-B <block size>] [-o <output file>] [disk device] [number of disk blocks] [start block]
Parameters:
-B <block size> specifies the disk block size, in bytes.
-O <output file> writes the check result to the specified output file.
-C <check block count> The number of blocks for each detection. The default value is 16. Adding this quantity can increase the efficiency of the detection block and increase the memory consumption.
-S shows the progress during the check.
-V displays detailed information during execution.
-W performs a write test during the check.
[Disk device] specifies the disk device to be checked.
[Number of disk blocks] Total number of blocks of the specified disk device.
[Start block] specifies the block from which the check starts.