SUMMARY: Recovering files from lost+found directory
2007-12-25 4:11:00
We have a E480 Server attached to a 3310 Array with Solaris 8 installed.
Recently when moving data there was an I/O error and the system hung. Upon
reboot we got the message that the RAID dir was in bad state and to run
fsck. Well, to make a long story short after doing this a few times and
still not coming up clean I ran a format > analyze > read which seemed to
fix the errors and now comes up clean. Now when I cd into the RAID it looks
like we have managed to disconnect all my files and folders from their
inodes. . The result is now one lost+found directory with a bunch of files
and folders preceded by hash marks...
Is there any way to recover the data structures [files and folders] back to
how they should be? Or at least move them back?
Thanks to the following who replied.
Terry Moore
The Hatter
Dan Lowe
Russell Page
Solution:
In this case, the easiest thing to do was to newfs the RAID and reload the
application. Normally, you can just move the files out of lost+found and
relink and or place them where they were. But due to the large amount of
files this would have been too time consuming. Although as always your best
bet is to have a good backup.
Russell's post describes it well:
Your files haven't been disconnected from their inodes - files are inodes.
They have been disconnected from their directory entries. To recover your
files you need to identify their contents and work out what their names
were. You then use mv(1) to rename them to their original names.
ls -l will give you a lot of useful information about the files (when last
modified, owner, group etc).
If you are lucky directories may still have all of their contents intact, so
work down through the tree under lost+found, doing the directories first.
Use the file(1) to try to determine what sort of data is stored in each
file. Anything that comes up as "ascii", "text," "script" etc can be viewed
with view(1) or more(1) to see its contents.
strings(1) will find and print ascii text embedded in binary files.
Comments
Got something to say?
You must be logged in to post a comment.

