Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to do a destructive (rw) test on a new drive, and a read-only on a drive that fell out of my RAID array. I want to see if it finds problems and how far along it is.

share|improve this question
up vote 20 down vote accepted

Let /dev/sda be the new drive on which to test destructive-rw and /dev/sdb the old drive where you want non-destructive-r

# badblocks -wsv /dev/sda
# badblocks -sv /dev/sdb

-s gives the process indicator

-v gives verbose output

-w enables destructive read-write

-n would be non-destructive read-write

Read-only testing is the default and doesn't need special parameters.

share|improve this answer
You might want to add the use the "-o output_file" option for badblocks as well because it writes the bad sectors into a file which you can pass to mke2fs or e2fsck to make those tools aware of which blocks are broken. – tante Oct 21 '10 at 12:30
@tante is right without "-o output_file" the results are just output to the screen, unusable by e2fsck. The badblocks man page however recommends that you run "e2fsck -c" instead of utilizing badblocks -o, to avoid possible block size mismatch, fwiw... – rogerdpack Nov 27 '13 at 13:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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