LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 12-25-2007, 08:31 PM   #1
edenCC
Member
 
Registered: May 2006
Location: Gz,China
Distribution: RH,FB
Posts: 196
Blog Entries: 1

Rep: Reputation: 32
how to recover lost files after fsck?


Hi, List;
Without a inode map file, how to recover lost files when fsck performed?
If I make a inode map file by `ls -iR` before making fsck, things may become much better. In fact, we have tens of millions of files, which may take a long time. Is there any easy ways please?

[cax@gz lost+found]$ ls | head -20
#10010708
#10010709
#10010711
#10010712
#10010882
#10010883
#10010904
#10010918
#10010922
#10010937
#10010980
#10010990
#10011021
#10011043
#10011111
#10011112
#10011119
 
Old 12-25-2007, 09:02 PM   #2
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
Yeah - you create a backup.

Otherwise there is no easy way to recover files. Especially when the inode map is gone. You end up grepping through the system for likely candidates... which could take all year with millions of files.

backup
backup
backup
backup

Last edited by Simon Bridge; 12-25-2007 at 09:03 PM.
 
Old 12-25-2007, 09:19 PM   #3
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
If you do have some files in lost and found, you can at least try to determine the filetype using the "file" command.
One way to get a listing of filenames and inodes is to use the "find" command with the argument '-printf '%i %p\n'. You could change it to your liking, of course, such as using a tab separator to make it easier handling filenames with spaces.

It is still a better idea doing a backup, but doing both, the list could tell you which files to restore.

Another thing you could do is produce a list of filenames with their md5sums. This would take a very long time however given your large number of files.

Last edited by jschiwal; 12-25-2007 at 09:21 PM.
 
Old 12-26-2007, 01:31 AM   #4
edenCC
Member
 
Registered: May 2006
Location: Gz,China
Distribution: RH,FB
Posts: 196
Blog Entries: 1

Original Poster
Rep: Reputation: 32
Thanks for the nice directions!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
recover lost files thtr2k Linux - General 1 01-26-2007 10:04 PM
Lost My Files--Help needed to recover them svasanth Linux - Newbie 2 09-06-2006 03:51 AM
**Reinstalled, need to recover lost files aspinnler Ubuntu 6 02-08-2006 05:48 PM
rm -R, lost my files, any way to recover? mm.. :) brynjarh Linux - General 1 05-10-2005 06:39 AM
Recover lost files? chup Linux - General 2 08-23-2003 10:28 AM


All times are GMT -5. The time now is 06:16 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration