[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Howto Recover data from lost + found

Posted on 2004-11-07
10
Medium Priority
?
464 Views
Last Modified: 2013-12-15
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.
0
Comment
Question by:adamshields
  • 4
  • 4
  • 2
10 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 12520449
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
 
LVL 38

Expert Comment

by:wesly_chen
ID: 12520833
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
 
LVL 3

Author Comment

by:adamshields
ID: 12520943
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
Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

 
LVL 38

Accepted Solution

by:
wesly_chen earned 750 total points
ID: 12521045
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
 
LVL 3

Author Comment

by:adamshields
ID: 12878336
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
 
LVL 38

Expert Comment

by:wesly_chen
ID: 12878629
file '#*' | grep -v executable | awk -F: '{print$1}' > ~rsreese/filelist
0
 
LVL 3

Author Comment

by:adamshields
ID: 12878737
cool thanks it ran, but nothing filled up the filelist
0
 
LVL 38

Expert Comment

by:wesly_chen
ID: 12878808
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
 
LVL 3

Author Comment

by:adamshields
ID: 12879223
The files are postgresql files, when viewing a file it gives use hogwash =), so I would assume that they're binary files.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 12879334
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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month18 days, 6 hours left to enroll

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question