Howto Recover data from lost + found

We have a redhat 8 machine that seems to have crashed and put about 6 gigs of data that was pretty important into the lost + found directory. Is anyone aware of means to recover this files, meaning rename them correctly and places them into their proper locations in the file system. We are still about to mount the raid array (so far read only) and access the data. Note some of these are PostgreSQL database files.
LVL 3
adamshieldsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jlevieCommented:
A system crash that results in recovered data being placed in lost+found leaves you with no option but to determine the original file name from the content of the files. Frequently this isn't too difficult with text file, but in the case of binary files it may be nearly impossible.

The easiest solution is usually to just recover the data from the last backup.
0
wesly_chenCommented:
Hi,

   I agree with jlevie. Don't bother to recover 2GB data in lost+found directory.
Those filenames in lost+found are the inode numbers. Unless you know the inode numbers of the files before
crash, otherwise you need to go through every content of files to determine the filename by yourself.

   Restore from the last backup and recover lastest change from the archives of database.

Good luck,

Wesly
0
adamshieldsAuthor Commented:
Well the issue is that the server was being backed up to a NAS with no tape librabry (yes, lame I know). And it seemed to have failed during during the last transfer backing up only some of the data but as mentioned most is in the form of a lost + found folder, so I didn't know if something could be done, and yes some of the object are going to be binary making this that much more fun.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

wesly_chenCommented:
Hi,

  However, you can do
# cd lost+found
# file #* | grep -v executable | awk -F: '{print $1}' > /tmp/filelist
to screen out the binary files first.

Wesly
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
adamshieldsAuthor Commented:
I don't have to file toggles correct?

[rsreese@fre-data1 lost+found]$ file #* | grep -v executable | awk -F: '{print$1}' > ~rsreese/filelist
Usage: file [-bciknsvzL] [-f namefile] [-m magicfiles] file...
Usage: file -C [-m magic]
0
wesly_chenCommented:
file '#*' | grep -v executable | awk -F: '{print$1}' > ~rsreese/filelist
0
adamshieldsAuthor Commented:
cool thanks it ran, but nothing filled up the filelist
0
wesly_chenCommented:
find /lost+found -type f | xargs file '#*' | grep -v executable | awk -F: '{print$1}' > ~rsreese/filelist

This will go into sudirectories.
If nothing shows up in filelist, then it means no executable files or the headers of executable have corrupted.

Wesly


0
adamshieldsAuthor Commented:
The files are postgresql files, when viewing a file it gives use hogwash =), so I would assume that they're binary files.
0
jlevieCommented:
Postgres database files are binary. And give the way things are laid out in the Postgres data dir I don't see how you'd figure out what file from lost+found corresponds to what in the data dir.  It might be possible to gain some inside from the postmaster code, or perhaps by asking on the Postgres mailing list or on IRC (see http://www.postgresql.org/).
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.