Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Today I found the following message in the daily log mail I get from a FreeBSD server:

ad2c: hard error reading fsbn 1081249272 of 540624636-540624639 (ad2 bn 1081249272; cn 1072667 tn 14 sn 54) status=59 error=40

What is the best way to find the file corresponding to above block number?

share|improve this question
1  
Side note: Hard errors on modern HDs usually mean imminent death. Got backups? –  Chris S Feb 28 '11 at 20:08
1  
Might be a bit late to save this disk considering the age of the question, but @ChrisS definitely has a good point. You don't see Hard Errors often these days with SMART drives, but when you do it's generally time to plan a viking funeral. –  voretaq7 Mar 1 '11 at 15:47

1 Answer 1

up vote 2 down vote accepted

You can (and probably have to) resort to fsdb(8) for this -- the findblk command should be able to track down the inode, from which you can get the file name.

OBLIGATORY WARNING
fsdb is a pretty dangerous tool. You can do a lot of damage in a very short amount of time.
It is a good idea to read the man page thoroughly, and perhaps peruse a few other sources
of information before poking around in the dark sticky guts of your filesystem.

More details can be found in this mailing list post to freebsd-questions

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.