Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I had a problem with a disk and ran badblocks.

So now when I run:

sudo dumpe2fs -b /dev/sdc1

I get a list of bad badblocks such as:

dumpe2fs 1.41.11 (14-Mar-2010)
192
1592
2416
3112
3552
...

But in fact, I realised that the problem came from the rack and not from the disk. I was using the rack in eSata and got plenty of read errors. Now i switched to USB, it's not as fast, but no errors at all.

So my question is:

How do I reset the badblock list stored in the inode #1 (badblock inode)? (of course, without reformating!... That's the last thing I'll try if I get no solution)

Because apparently blocks are not at all "bad", they were just reported so because the rack is faulty.

Many thanks in advance and merry Christmas.


Edit: I tried to run another badblocks once the disk was connected to USB but no success: previously found bad-blocks remained. I ran:

sudo badblocks -i /tmp/emptyList -s /dev/sdc1

the file /tmp/emptyList being empty so that badblocks is fed an empty list of known bad blocks. But apparently, it's not THE list of bad blocks, it is the ADDITIONAL list of bad blocks, which would be added to the existing ones declared in the inode #1. The documentation (man) is not very accurate about that.

share|improve this question
add comment

1 Answer

Ok, I found it myself after munch Googling and a lot of "man" reading.

ATTENTION: this is a risky operation, don't do it if you don't fully master what are the risks!..

I just did:

sudo debugfs -w /dev/sdc1
clri <1>
quit

This clears the inode number 1 (the one containing bad blocks list) on your filesystem.

Then you have to run an e2fsck again to reset various things, and your are done!

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.