How to interpret badblocks output

The man pages for badblocks do not seem to mention what the three numbers in the output mean in particular:

Pass completed, 7 bad blocks found (7/0/0 errors)
Pass completed, 120 bad blocks found (0/0/120 errors)

I’m guessing it’s “Errors while reading/writing/comparing”. Can someone enlighten me?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Your guess is correct.

The source code looks like this:

if (v_flag)
    fprintf(stderr,
            _("Pass completed, %u bad blocks found. (%d/%d/%d errors)n"),
            bb_count, num_read_errors, num_write_errors, num_corruption_errors);

So its read/write/corruption errors. And corruption means comparison with previously written data:
if (t_flag) {
    /* test the comparison between all the
       blocks successfully read  */
    int i;
    for (i = 0; i < got; ++i)
        if (memcmp (blkbuf+i*block_size,
            blkbuf+blocks_at_once*block_size,
            block_size))
            bb_count += bb_output(currently_testing + i, CORRUPTION_ERROR);
}

Method 2

Wrong. If badblocks says anything that isn’t “no errors found”, it means:

  • Turn off the machine immediately
  • Get a replacement disk
  • Pray to $GOD_OF_BACKUPS important data is safe
  • Do whatever is needed to set up the new disk, and copy the data from the old one

You may optionally keep the disk around for entertainment, or as a paperweight.

(Modern disks have a set of extra cylinders for remapping bad blocks, as there is no way to manufacture disks without them, and users screamed bloody hell when they saw the bad block list. If bad blocks do show up, it means that that space is used up. As the common failure modes of rotating disks give exponentially increasing number of bad blocks, seeing some means that the disk typically has a few hours left.)


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments