Re: find a file containing a specific sector

From: Andreas Dilger (adilger@turbolabs.com)
Date: Wed Jan 23 2002 - 13:36:44 EST


On Jan 23, 2002 12:00 -0600, Chuck Campbell wrote:
> If I know the sector and lbasector, can I determine the inode and/or
> the actual file affected?
>
> The error message is:
>
> Jan 23 04:24:34 helium kernel: hdc: dma_intr: status=0x51 { DriveReady SeekComplete Error }
> Jan 23 04:24:34 helium kernel: hdc: dma_intr: error=0x40 { UncorrectableError }, LBAsect=4200315, sector=4200248
> Jan 23 04:24:34 helium kernel: end_request: I/O error, dev 16:01 (hdc), sector 4200248
>
> as I said before, the sector number has never changed in months.

If you run 'badblocks /dev/hdc1' it will do a full (read-only by default)
surface scan of the disk and report the bad blocks. This still doesn't
tell you the filename though.

You can use "debugfs /dev/hdc1" and then "icheck 525031" (assuming
you have a 4kB block ext2/ext3 filesystem on this drive) and then
"ncheck <inum>" for the inode number returned by icheck to find the
filename.

As someone else reported, running "e2fsck -c" will add this block to
the bad blocks list, and re-assign another block for the file in question.
It runs 'badblocks' in the background with the correct parameters (read
only check, correct blocksize for the filesystem).

Cheers, Andreas

--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Jan 23 2002 - 21:01:05 EST