2

I have /dev/sda mounted on /, as the root partition. Can I safely run badblocks in read-only mode on this device? Will it show false positives/negatives because it's mounted?

3

Read-only is just that - reading from the disk. It will pick up sector read errors but (obviously) not sector write errors.

Categorically, it is safe to run on a device that is being used a mounted filesystem.

With respect to possible false positives, block IO is not "managed", i.e. there are no reader/writer locks. So there is no interaction between badblocks and the filesystem layer.

| improve this answer | |
  • Will it get any false positives possibly because the OS might be using the device while badblocks is scanning? – markasoftware Jul 26 '16 at 21:31
  • 1
    @Markasoftware no, you shouldn't. At least not on normal disks (maybe it's possible—no idea—on something complicated, like a SAN) – derobert Jul 26 '16 at 21:38

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.