Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I recently ran badblocks on a large server hard drive to check for possible issues (SMART reported that everything was fine, but I needed to be sure).

The command I used was: badblocks -c 1024 -b 4096 -w -s -o /path/to/myfile.txt /dev/mydrive I used destructive-write mode because the downtime of the drive was important, and we determined that it would be faster to nuke the drive during the bad-blocks check and then re-add it to the RAID it had been a part of later than wait on the non-destructive test.

When it completed, myfile.txt had been created but was empty.

This seems like a very silly question, but: the file being empty indicates that no bad blocks were found, correct? The manpage for badblocks seems to indicate this, but I want to be as sure as I can be.

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

Yes, if the file is empty, badblocks didn't find any broken blocks. Did you also run the extended SMART selftest?

share|improve this answer
    
Yes, I did. I used badblocks because I wanted to be double-sure, as offlining the system or breaking the RAID to check the drive makes the users grumpy. Thanks! –  Zac B Nov 30 '13 at 21:31
add comment

Methods don't matter. Everything you have to do is to scan the entire surface of the disk. You can do it via smart (Extended offline test) or even by using dd. You have to read every single sector on the disk because there is no other way to check if all of the sectors work. So, if you did the full scan and there's no sector reported, then everything is just fine.

I'm not sure but I think that the "destructive-write mode" is for reallocation of a bad block because this can be done only if you write a damaged sector.

share|improve this answer
add comment

Your Answer

 
discard

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.