How to search bad blocks on a device?

If I have a disk with bad blocks, how to search bad blocks on it under Linux?

asked Jan 19, 2013 by forum (2,150 points)

1 Answer

 
Best answer

 

You can use 'badblocks': http://www.pkill.info/linux/man/8-badblocks/

badblocks [ -svwnf ] [ -b block-size ] [ -c blocks_at_once ] [ -e max_bad_blocks ] [ -d read_delay_factor ] [ -i input_file ] [ -o output_file ] [ -p num_passes ] [ -t test_pattern ] device [ last-block ] [ first-block ]

badblocks is used to search for bad blocks on a device (usually a disk partition). device is the special file corresponding to the device (e.g /dev/hdc1). last-block is the last block to be checked; if it is not specified, the last block on the device is used as a default. first-block is an optional parameter specifying the starting block number for the test, which allows the testing to start in the middle of the disk. If it is not specified the first block on the disk is used as a default.

answered Jan 20, 2013 by SA (14,760 points)
selected Jan 20, 2013 by SA

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...