bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Finding file with bad block


From: Cameron, Steve
Subject: RE: Finding file with bad block
Date: Fri, 13 Sep 2002 11:11:04 -0500

Larry Jones wrote:
> 
> 
> My nightly backup last night produced the following error on the
> console:
> 
> sd0: sn 8769977: media error: unrecovered read error, 
> recommend rewrite (320 retries)
> 
> So, my root drive is either on its last legs or a gremlin got 
> just that
> sector.  I was planning to replace it pretty soon, I'll just have to
> expedite that process.  In the meantime, however, how do I 
> find out what
> file contains sector 8769977 so I know what I need to restore?

What filesystem?

Judging by the "To:" list, probably not ext2.  If it were,
there's debugfs which has a "icheck block" command which
will show you what inodes use a particular block or blocks.
Then you can use the "-inum" option of "find" to figure
out what file.

Maybe your filesystem has a similar debugger.

I've never used debugfs, only just read the man page.

Another (possibly very bad) idea...  
Since the block is toast anyway...
You could use dd on the raw device to blast a magic
pattern over the bad block, if it is still writable,
then use find to search for that pattern to figure which
file contains the block.  That seems a bit dangerous
though, in case the block is not file data, but filesystem
data. 

Hope that helps (so that for once I can answer a question
of Larry's, since he's always the one answering questions.)

-- steve




reply via email to

[Prev in Thread] Current Thread [Next in Thread]