Re: ext2 errors

Theodore Y. Ts'o (tytso@MIT.EDU)
Mon, 7 Jul 1997 23:48:32 -0400

Date: Mon, 7 Jul 1997 15:30:30 -0500
From: Tall cool one <>

I suppose I could check myself, but is it possible to print the block # in
which the bad sector was discovered and in turn which inode that block
belongs to and in theory the filename of the file that just got munged?
That'd have to be in the ext2 fs I suppose.

To get the block number, simply take the sector and divide by 2 if you
are using a 1k blocksize, 4 if you are using a 2k blocksize, etc. As
far as getting the filename that got munged, run debugfs and type the
command "icheck <blockno>" in order to figure out which file <blockno>
belongs to. It turns out it's pretty hard to have the kernel print the
filename, so you're better off doing this using an user-mode program
like debugfs.

- Ted