System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Find file residing in block.

John Welsh_2
Regular Advisor

Find file residing in block.

Hi all,
Is it possible to find what file is in a given block ?
I have a boot disk which has an irrecoverable bad block ( hardware error in uerf ) and I need to know what file I have lost. It is V5.1B using AdvFS.
Thanks,
John W.
========
4 REPLIES
Hein van den Heuvel
Honored Contributor

Re: Find file residing in block.


I thought I remembered any hardware error being reported with the inode number. Maybe I'm dreaming. Check errorlog and/or /var/adm/message?

For the system to find the data to be bad, it must have been trying to use it. What was it doing at that time?

Anyway... two suggestions.... untested...

1) some brute force

find / -xdev | perl_script
perl_script:
$name = shift;
foreach (`/usr/sbin/showfile -x $name`) {
:

2) all force, no thinking
find / -xdev -exec xargs grep -c {} \;
... untill it hurts.


hope this helps some,
Hein.



Venkatesh BL
Honored Contributor

Re: Find file residing in block.

Did you try the 'salvage' command?
John Welsh_2
Regular Advisor

Re: Find file residing in block.

Hi Guys,
Sorry for the delayed reply. My customer decided to just go ahead and replace the disk and restore from backups so I didn't get a chance to try your suggestions. Thanks anyway.
Best regards,
John.
======
John Welsh_2
Regular Advisor

Re: Find file residing in block.

Disk replaced and restored.