Mapping abs sector numbers to files
Ed Gould
ed at mtxinu.COM
Sat Jun 8 13:40:00 AEST 1991
> I haven't found this in TFM yet -- perhaps the net can help. Given
> an error message that says something like "SCSI absolute sector
> 1234 on drive 1 is bad" how can I map this sector number to a
> file/directory/(inode!).
The tool to do this is icheck, if it exists in your version of
Unix. However, it's a three-step process. First, you need to
determine the relative sector number in the filesystem affected.
If the driver is well written, it will report both absolute and
relative sector numbers. If not, you'll have to subtract the
starting sector number of the filesystem partition from the absolute
sector number. (Be careful - partition offsets are often specified
in cylinders, not sectors.) Second, the sector number must be
converted into a filesystem block number; some drivers will report
it as well. This is a simple matter of division, dividing the
sector number by the blocking factor, being careful to round up
properly. The "blocking factor" is the number of sectors per
filesystem block: If you have a 1024-byte-block filesystem and
512-byte sectors, the factor is 2. This filesystem block number
can be fed to icheck, which will report the inode number of the
file containing the block.
If you want the name(s) of that file, then feed the inumber to ncheck.
--
Ed Gould No longer formally affiliated with,
ed at mtxinu.COM and certainly not speaking for, mt Xinu.
"I'll fight them as a woman, not a lady. I'll fight them as an engineer."
More information about the Comp.unix.sysv386
mailing list