#40 fsck: count bad blocks before going interactive?

open
nobody
None
5
2012-11-28
2010-01-06
Anonymous
No

Related to "Artifact 2927068" where I express chagrin at always forgetting `debugfs` -

fsck's conventional interactive approach is to immediately halt upon discovery of an error. However, this is often asking the user to make a call before recognizing how badly the disk is failing - in the case of a short read due to an uncorrectable sector, it could be a rare one-off fluke or it could be a sign that there are a thousand to follow and the disk is ready to implode. (More often the latter, probably, but still...)

While it could extend the time and result in more potentially-damaging disk activity, wouldn't it be worth the information to automatically loop, "ignoring" (and not rewriting) all encountered errors and presenting a count of them before dumping the user to iterate through them? At least then they'd know what they're in for - and how cautious/panicked to be. :)

Perhaps this should be an option at the first interactive prompt, roughly like:

Error reading block 123456 (Attempt to read block from filesystem resulted
in short read) while getting next inode from scan.
Ignore error? yes
*** To examine this error, use debugfs before rewriting
Force rewrite? no
Count errors on filesystem before continuing? yes
Error reading block 123457 (Attempt to read block from filesystem resulted
in short read) while getting next inode from scan.
Error reading block 123458 (Attempt to read block from filesystem resulted
in short read) while getting next inode from scan.
Error reading block 4325456 (Attempt to read block from filesystem resulted
in short read) while getting next inode from scan.
Error reading block 4323458 (Attempt to read block from filesystem resulted
in short read) while getting next inode from scan.
Error reading block 4323459 (Attempt to read block from filesystem resulted
in short read) while getting next inode from scan.
*** 5 additional errors found
Save bad blocks to file? yes
Enter filename: /clean_writable_disk/blocks_to_check_with_debugfs
*** Restarting
Error reading block 123456 (Attempt to read block from filesystem resulted
in short read) while getting next inode from scan.
Ignore error?

...
Seeing that hundreds of bad blocks exist would indicate that things are futile and the user should salvage what he can ASAP, rather than attempting to make the filesystem consistent on the failing device!

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks