Is it possible to "reset" the badblocks?
I had a problem with a disk and ran badblocks
.
So now when I run dumpe2fs
(also from e2fsprogs):
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 badblocks 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.
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.
Solution 1:
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!