Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Data Recovery (reiserfs)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Evilguru
Guru
Guru


Joined: 16 Aug 2005
Posts: 390
Location: England

PostPosted: Sun Mar 25, 2007 4:45 pm    Post subject: Data Recovery (reiserfs) Reply with quote

Today I was trying to format a USB disk as ext3, nice and simple, I thought. So I typed in the command and went off. Only when I came back had I realised that I had formatted the wrong disk (/dev/sdc1 instead of /dev/sdd1).

So, I am interested in what I need to do to get as much of the data back as possible, there was nothing vitally important, just some stuff I would rather have than not have. I know that some of it will be totally gone, but most of it should still be there, right?

So what do I need to do to recover it?

Regards, Freddie.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54397
Location: 56N 3W

PostPosted: Sun Mar 25, 2007 4:55 pm    Post subject: Reply with quote

Evilguru,

First make a copy of the space, you cannot recover anything in situ.
Looking around with sleuthkit may help but only ever mount the remains read only.

If you know some fragments that you can grep the space for, you can locate files using hexedit.
Its a long slow process. Search the forums for other posts by me on the topic, there have been a few recovery threads like this over the years.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Evilguru
Guru
Guru


Joined: 16 Aug 2005
Posts: 390
Location: England

PostPosted: Sun Mar 25, 2007 5:01 pm    Post subject: Reply with quote

So there is no application that will have a stab at recovering as much as possible from the drive or try to re-build the directory structure?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54397
Location: 56N 3W

PostPosted: Sun Mar 25, 2007 5:11 pm    Post subject: Reply with quote

Evilguru,

I don't know of one, the problem is the list of inodes belonging to a file is not preserved, so it can't be recreated
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Sun Mar 25, 2007 5:22 pm    Post subject: Reply with quote

Don't do experiments on the drive, make them on a copy (or on the copy of the copy if you must).
Make backups in the future.

I'd try fsck.reiserfs. May sound silly, but there may be a backup superblock somewhere you can use to restore the full structure of the reiserfs. I don't know where reiserfs keeps those (if any) as I don't use this particular fs, but it's a possibility you should look into.

If that doesn't work, you've got no choice but to do a bit of forensics voodoo. Forget locating files with hexedit - you won't find anything unless you know exactly what (and better yet where) to look for it. Unless you're looking for a very specific text file and you know some of its contents you can search for, using a hexeditor is simply not viable.

There are tools that go through raw data and extract what they think are useful bits and pieces of information. I've had some luck with anyfs, it can extract some common file types like jpeg images and word documents. There are several tools like that, I suggest you try them all and see what you can find.
Back to top
View user's profile Send private message
Evilguru
Guru
Guru


Joined: 16 Aug 2005
Posts: 390
Location: England

PostPosted: Sun Mar 25, 2007 5:24 pm    Post subject: Reply with quote

Should I format it as reiserfs first, or just fsck it?

Regards, Freddie.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54397
Location: 56N 3W

PostPosted: Sun Mar 25, 2007 5:36 pm    Post subject: Reply with quote

Evilguru,

Don't touch the drive at all. Anything you do in situ can only make it worse.
I agree that you need something to search for with hexedit. However, many binary files have a plain text header, which gives you something to go on. You get a lot a false positives with a short search fragment.

I don't know anyfs at all but it must make some assumptions about where to find subsequent blocks in a filesystem if it can recover who;e files. reiserfs will be difficult because of the way it uses the otherwise wasted space in the last block of a file. Most other filesystems begin files on a block boundary.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Sun Mar 25, 2007 8:08 pm    Post subject: Reply with quote

NeddySeagoon wrote:
I don't know anyfs at all but it must make some assumptions about where to find subsequent blocks in a filesystem if it can recover who;e files


It doesn't know about file systems at all, it just expects data to still be in one piece in the raw. It's pretty much your hexeditor approach automated, it searches for known file headers and extracts stuff it thinks may be useful files. There are several projects that work in this fashion, I don't know of any that know of special reiserfs quirks. Yes, there are tons of things that can go wrong here (file fragmentation etc) but still I had some success using it. It extracted about a ton of files, many of which were still useful, and you can't manually go through gigabytes of data with a hexeditor like that.

If you want to be able to rescue your files in a more reliable fashion, you've got no choice but to start making backups early and regularly. My whole system (or rather, only the changes I make to it) gets backed up every day in a cron job. Next to no work involved at all and it's worth millions.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54397
Location: 56N 3W

PostPosted: Sun Mar 25, 2007 9:26 pm    Post subject: Reply with quote

frostschutz,

That sounds really useful - I'll have a play with it before I really need it.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum