O'Reilly logo

Linux® Desk Reference, Second Edition by Scott Hawkins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Commands

badblocks

[ -b block-size ] [ -o output_file ] [ -s ] [ -v] [ -w ] device blocks-count [ start-block ]

This command is used to search for bad blocks on a hardware device. You should specify the device (e.g., /dev/hda1) and the count of the number of blocks on the device.

Example: To check /dev/hda1 for bad blocks, use

badblocks /dev/hda1 3096
-b block-size Specify the size of blocks in bytes.
-o output_file Specify a file to which the list of bad blocks is output. Default is to display to standard out.
-s Progress indicator. Display the block numbers as they are checked.
-v Verbose output.
-w Write-mode test option: badblocks will write ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required