LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-31-2009, 01:02 PM   #1
kayasaman
Member
 
Registered: Sep 2008
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443

Rep: Reputation: 32
Recovering data from lost+found directory on ext3 fs


Hi,

I have a very strange external USB drive which I know is the enclosure as the internal drive is a Seagate 160GB IDE HD.

I recently pulled this drive out of a dead server as I was using it as an nfs export but now I have to use it as external USB HD since I don't have any other machines to put it in.

The weird thing was that one folder after powering on and auto-mount-usb kicked in, became locked as permissions got all screwed for some reason or other. Even after unmounting before disconnecting it.

Anyway some inodes became unattached and the boot record got all mangled.

I ran fsck /dev/sdb1 on it and attempted a manual repair so I pressed yes to everything that it wanted me to which in turn deleted inodes and other bits and peices.

I then ran fsck -a /dev/sdb1 on it and it claimed that there was a large percentage of non-continuous information.

I guess I should have run e2fsck -p /dev/sdb1 instead but what is done is done and now I have a deleted folder and 4GB of data in lost+found dir on the filesystem root (not to be confused with the / directory!!).

I have discovered this page http://www.xs4all.nl/~carlo17/howto/undelete_ext3.html

in the mean time but I am after a quick fix if there is any like running a command with a particular option flag......

It's not a big issue since I do have all my data backed up but it's a hassle to go through 100s of DVD's where the information is stored on.

This is really why I don't like using external USB drives with Linux as they just aren't stable!! I mean in the server it would have been fine and on a reboot would have automatically fixed any errors leaving me with a usable drive with all folders and files intact.

Too bad I don't have enough money to go for a nice mutli-Terrabyte NAS or SAN system as that would sort all my issues out :-( (12TB should do it!! -uh)

Anyhow if anyone has any ideas or suggestions then please do get back to me!!! I would really appreciate it.

[edit]all I'm after really is just to recover those 'lost' files into the folder they were originally in with the proper names for each file as at the moment they are just numbers and letters with no sense in human terms.

Thanks

Last edited by kayasaman; 07-31-2009 at 01:05 PM.
 
Old 07-31-2009, 01:12 PM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
http://www.linuxquestions.org/questi...ght=lost+found

I posted the above thread a few years back. It dealt with Ext2, and while the thread is not long, there is a link there to a PDF document about how/what to do with stuff in Lost+Found. The link is still good, I just checked.

I had good success recovering deleted Ext2 stuff using a tool called 'Recover', which can be tricky to track down, AND I don't know if it works with Ext3 or not, as it was designed for Ext2. However, in my case, I rm -Rf'd my / by accident whereas in your case, fsck has put 4GB of stuff into Lost+Found, so at least you know where it is.

IMHO though, unless those 4GB are comprised of marvelously few large files, and not hundreds of small files, I think that since you do have backups, it would be a monstrous waste of time going through Lost+Found and restoring all those GB!

All the best,
Sasha

PS - any of those files that are NOT binaries, are not totally useless to humans: try opening a few of them. You'll see that they are text files, bash scripts, perl/python scripts, etc.. If you recognize any of them, you can simply rename them and put them back where you want them or where they belong.

The #4545454 names of the files refer to the INODE number which corresponded to the file when it was deleted.

Last edited by GrapefruiTgirl; 07-31-2009 at 01:15 PM.
 
Old 07-31-2009, 01:23 PM   #3
kayasaman
Member
 
Registered: Sep 2008
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443

Original Poster
Rep: Reputation: 32
Thanks Sasha for the quick response!! :-) and also nice to see a girl on the forum(s) for once!

Yeh these files are mp3's and there are loads of them in that folder for 4GB :-(

Looks like I'm gona have to go through my hundreds of DVD's to find them all again ---uh yawn.... (not a good thing to have a few hundred gigs upto 1TB on DVD's - so tedious!)

[edit]ZFS filesystem on linux anyone??? I use it on my Solaris servers and desktops and it rocks but ext3 just seems a bit miserable sometimes....

--Kaya

Last edited by kayasaman; 07-31-2009 at 01:25 PM.
 
Old 07-31-2009, 01:41 PM   #4
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
If ALL of the files are MP3's, why not try a recursive `mv` command, to recursively move & rename the files to another location, then just try playing one of them? (or actually, try just ONE first, to see if this works.)

Though (LOL) I just realized, this is going to give you a tonne of MP3's which you have no idea what song they are but that makes things interesting! You never know what will be played next!

Seriously, unless someone who knows more than I about this situation has a better idea (and that's a certainty-- many someones know loads more than I about this) I feel you are better off just finding the files afresh and redoing it all. Too bad, I hope for your benefit and that of others, that someone has a better solution..

Sasha
 
Old 07-31-2009, 01:55 PM   #5
kayasaman
Member
 
Registered: Sep 2008
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443

Original Poster
Rep: Reputation: 32
Thanks again Sasha!!

I tend to group all my files by folders of Artist then Album and I am a bit selective of what I listen to too as I neurally index all my files anyway.

I hope so too at least for the benefit of others that someone has a good suggestion of what to do and I am guessing if the filenames are currently their inode numbers it's gona be a matter of linking the journal on the HD before the screwup to the inode numbers post screwup if that makes any sense??

For real data consistency and safety a RAID array would be my choice of advice to myself and any other person with lots of stuff. A nice Sun Microsystems server with a Sun RAID running RAID0+1 stuck in a LUN with ZFS filesystem to boot using SXCE or OpenSolaris, sharing it via NFS v3 or 4. Then connecting to that via a Linux desktop.... much better for data integrity but unfortunately one needs to spend money :-(

Any jobs going for a good student in the UNIX/Cisco engineering side of things?? --uh yawn this is an old tale of which I've come to accept being unemployed LOL
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
recovering lost data???? tnelson42345 Linux - Software 3 08-25-2006 11:27 AM
The postgresql data directory content in the pgsql directory is lost (empty data dir) kisembo Linux - Software 1 02-13-2006 01:11 PM
Recovering Lost Data lawrencegoodman Linux - General 1 04-04-2004 12:57 PM
Recovering data from an ext3 fs with no superblocks UncleTaz Linux - General 2 03-07-2004 01:22 PM
recovering data from ext3 chupacabra Linux - General 2 10-21-2002 10:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:13 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration