You are not logged in.

#1 2007-10-13 04:03:16

circleback
Member
Registered: 2007-04-14
Posts: 49

File recovery

Is there any way to recover files from an accidentally formatted partition? The previous format was reiserfs and the new format is also reiserfs for one partition and an other partition that was accidentally formated was FAT. Are there any tools in linux to recover files lost?

Offline

#2 2007-10-13 04:32:19

Notturno
Member
Registered: 2007-08-26
Posts: 18

Re: File recovery

yes, use foremost.

http://foremost.sourceforge.net/

its very easy to use (you just need to select the type of file you want to recover in the configuration file) and worked like a charm for me.
actually that's how I began to use linux in the first place, after accidentally partitioning the wrong disk LOL.

Offline

#3 2007-10-13 07:02:38

MrWeatherbee
Member
Registered: 2007-08-01
Posts: 287

Re: File recovery

Notturno wrote:

yes, use foremost.

http://foremost.sourceforge.net/

its very easy to use (you just need to select the type of file you want to recover in the configuration file) and worked like a charm for me.
actually that's how I began to use linux in the first place, after accidentally partitioning the wrong disk LOL.

Yes. Recovering some files from ReiserFS seems almost too easy. Its certainly helpful, though, when you accidentally delete files.

I recommend creating a volume image to work on rather than the original data. It preserves the "lost" data as much as possible, allows you to repeat operations without risk of further loss, and prevents possible corruption of other "non-lost" data. The only drawback here is that you have to have enough free space to to save the image.

See this article for a nice ReiserFS recovery method:

http://antrix.net/journal/techtalk/reis … o.comments

Reading the whole page including comments is helpful (though lengthy), but in particular, the comment by '@nT$'  on Sun, 10 Oct 2004 06:53 (just use that info to search on the page in your browser) outlines the 'dd' volume image building process.

Once the image is built, you can run the ReiserFS tool (reiserfsck --rebuild-tree) or foremost on the image with relative safety against losing any more data than you already have.

Offline

#4 2007-10-13 19:34:12

Notturno
Member
Registered: 2007-08-26
Posts: 18

Re: File recovery

touching the original disk as less as possible seems very important.
you might also usr a live CD like Slax, boot with the cheatcode that prevent Slax from mouting the HD automatically and add foremost to the live system, which is remarcably easy.
Alternatively you can install Slax to a USB memory stick and do the same.
This way you will work from outside and can also burn the resulting image do a CD.

Offline

#5 2007-10-14 12:01:22

circleback
Member
Registered: 2007-04-14
Posts: 49

Re: File recovery

The partition is about 30 gigs however. Is it still possible to make an image?

Offline

#6 2007-10-14 21:36:06

MrWeatherbee
Member
Registered: 2007-08-01
Posts: 287

Re: File recovery

circleback wrote:

The partition is about 30 gigs however. Is it still possible to make an image?

Yes. You can use dd or dcfldd to make an image of the 30 GB partition (see http://dcfldd.sourceforge.net/ for info on dcfldd which is an enhanced version of dd).

I thought Notturno was being a little too optimistic when he said this:

and can also burn the resulting image do a CD

I guess they exist, but a partition that fits on a CD is awfully small. smile

One of the biggest obstacles of safely recovering lost data for a lot of people is the amount of space required. You'll need a hard disk that can store the image file + the files the recovery software finds during the recovery process. Assuming the partition in question was at 100% capacity, and you are lucky enough to recover 100% of the files (long odds), you will need ~ 60 GB of free space to perform all the operations.

If your data is worth it, I'd buy an extra drive if you don't already have one. Even if things don't go well with the recovery, you'll have a shiny new hard drive to use for whatever you like, including being well prepared for the next data disaster (hint: use it to backup data before the disaster occurs).

By the way, I'm hoping that a data recovery guru comes by that has some more real life experience. I have used the tools described here and a few others, but it was in the context of recovering deleted files, AND those files were purposely deleted by me for testing purposes, i.e., I have never actually had a "data disaster".

Offline

#7 2007-10-15 00:33:23

Notturno
Member
Registered: 2007-08-26
Posts: 18

Re: File recovery

yeah I didn't consider the size of the image of the partition.
I have never used the image method also, albeit everyone says is the proper way.
I also I don't know how the mounting process from an external medium such as a live CD would alter your data.
At the time I had to go through this, I found many sites on this topics where very theorical and of little practical use.
However, from my limited experience, foremost was very efficient as i recovered with minimal hassle some text files and pics that where on a MSDos HD I formatted to FAT32.
Foremost search the HD for headers or types of files, and copies them to a dir no any medium (for instance the /root of the live CD that you can burn to a CD if you use it in RAM or to an USB stick.
I found it remarkably easy and safe to use, you can make several tries until the output is the desired one.

Offline

Board footer

Powered by FluxBB