Bad block -> file mapping
M. Warner Losh
imp at bsdimp.com
Sat Feb 18 11:10:41 PST 2006
In message: <200602181902.k1IJ243D041278 at gate.bitblocks.com>
Bakul Shah <bakul at bitblocks.com> writes:
: > However, I'd kinda like to know
: > which file that is. If it is a boring file (foo.o, say), I'd dd the
: > bad block with 0's and then remove it. If it is a non-boring file,
: > I'd try to recover it a couple of times, etc.
:
: So you want a function that does this?
:
: LBA -> slice/partition/offset -> fs/inode -> list of file names
:
: Logic for the second step should be in fsck.
Yea. I was kinda hoping to find a tool that would do that given the
LBA of the disk... I can do the math by hand, but if I don't have
to...
: I haven't kept uptodate on disk stds so likely I am talking
: through my hat but in ST506 there used to be a diagnostic
: read function that returned the bad block and its CRC. That
: allows at least a chance of a manual correction.
:
: > Once I have the file in BAD, I'd planned on overwriting it with 0's
: > and then removing it if I could read the block again.
:
: Why do you care?
I want to know what file I'm trashing, explicitly. I could just do
the dd trick to the raw block, but then I'd have a divot left in the
file that I have no clue is there...
Warner
More information about the freebsd-hackers
mailing list