LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   how to recover lost files after fsck? (https://www.linuxquestions.org/questions/linux-server-73/how-to-recover-lost-files-after-fsck-609106/)

edenCC 12-25-2007 08:31 PM

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

Simon Bridge 12-25-2007 09:02 PM

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

jschiwal 12-25-2007 09:19 PM

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.

edenCC 12-26-2007 01:31 AM

Thanks for the nice directions! :)


All times are GMT -5. The time now is 06:49 PM.