Skip to contentSkip to conversation

find a file containing a specific sector

DISCUSSION Chuck Campbell 4 participants 4 messages Jan 23, 2002

lore
Share & tools
lore
#0 lore raw

For the last 7 months, I've been getting the following error in /var/log/messages every night during the cron.daily execution. I've finally tracked it down to happening during my tripwire run, and I suspect (based on linear time into the run, and sizes of files) the problem file lies somwhere in /usr/lib.

The error message has been identical for months, so I assume I have a bad spot that is not spreading. I'd like to find the affected file, rename it and ignore the problem for a while longer.

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.

thanks,
-chuck

Signature · 7 lines
ACCEL Services, Inc.| Specialists in Gravity, Magnetics |  1(713)993-0671 ph.
1980 Post Oak Blvd. |   and Integrated Interpretation   |  1(713)960-1157 fax
    Suite 2050      |                                   |
 Houston, TX, 77056 |          Chuck Campbell           | [email protected]
                    |  President & Senior Geoscientist  |

     "Integration means more than having all the maps at the same scale!"
#1 lore raw
Quoted 2 lines

If I know the sector and lbasector, can I determine the inode and/or the actual file affected?

probably makes more sense to just "e2fsck -c".

#2 lore raw
In reply to Chuck Campbell
Quoted 6 lines · Chuck Campbell

For the last 7 months, I've been getting the following error in /var/log/messages every night during the cron.daily execution. I've finally tracked it down to happening during my tripwire run, and I suspect (based on linear time into the run, and sizes of files) the problem file lies somwhere in /usr/lib.

Quoted 6 lines

The error message has been identical for months, so I assume I have a bad spot that is not spreading. I'd like to find the affected file, rename it and ignore the problem for a while longer.

If I know the sector and lbasector, can I determine the inode and/or the actual file affected?

find /usr/lib -type f|sed -e 's!.*!cat & >/dev/null || echo &!'|sh

#3 lore raw
In reply to Chuck Campbell
Quoted 10 lines · Chuck Campbell

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/