Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 12-25-2007, 09:31 PM   #1
Registered: May 2006
Location: Gz,China
Distribution: RH,FB
Posts: 198
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
Old 12-25-2007, 10:02 PM   #2
Simon Bridge
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
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.


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

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
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 10:21 PM.
Old 12-26-2007, 02:31 AM   #4
Registered: May 2006
Location: Gz,China
Distribution: RH,FB
Posts: 198
Blog Entries: 1

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


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

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

All times are GMT -5. The time now is 12:30 AM.

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