-1

we want to identify bad block or disk problem by the following

umount /grid/sdd
badblocks -n -vv /dev/sdd
Checking for bad blocks in non-destructive read-write mode
From block 0 to 20971519
Checking for bad blocks (non-destructive read-write test)
Testing with random pattern:  14.38% done, 2:46 elapsed. (0/0/0 errors)

the problem is that verification take a long time and if we have disk with 5T , then need more then 30hours

any other option or tool that do it more fast ?

to check disk with 20G , its tool 30Min

badblocks -n -vv /dev/sdd
Checking for bad blocks in non-destructive read-write mode
From block 0 to 20971519
Checking for bad blocks (non-destructive read-write test)
Testing with random pattern: done
Pass completed, 0 bad blocks found. (0/0/0 errors)
  • Have you considered SMART tools? – roaima Jan 15 at 20:23
  • If 30 hours is too long, just buy a replacement disk – roaima Jan 15 at 20:24
0

First of all, you can halve the running time badblocks by using destructive (-w) mode (instead of non-destructive -n).

You may also want to tune block size and number of blocks:

-b block_size
       Specify the size of blocks in bytes.  The default is 1024.

-c number of blocks
       is the number of blocks which are tested at a time.  The default
       is 64.

The number of blocks is only limited of the available memory. The block size should match the block size of the disk, which is now normally 4096. You can check this with:

lsblk -o NAME,PHY-SeC

As to detect disk problems, the usual method of doing that now is SMART. Modern disk will remap sectors which are failing and they won't even show up on badblocks. You can either let SMART run it's course and check it from time to time (smartctl -H /dev/sda), or you can force a test, e.g. smartctl -t long. This test will not (or to a lesser degree) interfere with the normal operation of the disk. In other words, badblocks is superseded by SMART.

  • Yes... but destructive mode is, er, destructive. – roaima Jan 15 at 20:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.