LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   ext3 filesystem recovery (https://www.linuxquestions.org/questions/linux-general-1/ext3-filesystem-recovery-527476/)

prozac 02-11-2007 12:25 AM

ext3 filesystem recovery
 
Suppose you have a 160G SATA HDD with a 150G /dev/sda1 partiton using ext3 filesystem. There is data in the partition of say 100G. Again suppose, you ran a 'mkfs.ext2 /dev/sda1' w/o thinking twice. Is there a possibility you can recover the ext3 filesystem and then the data? Right now the /dev/sda1 shows empty with just one directory 'lost+found'. I have made a image of this disk in another bigger disk using dd - 'dd if=/dev/sda1 of=/dev/sdb1', This essentially makes a image of the sda1 in sdb1 so that I can fiddle with sdb1 and don't have to worry about harming the original data. Any suggestions as to how I can revive the old ext3 filesystem? Please donot say I needed to have a backup and now I am doomed. Because I have a backup. Still, I need to recover that filesystem. I have gone through almost all of the similar threads in LQ and searched google. Found gpart, testdisk, Linux_Recovery etc. But I haven't used any of them before. What do LQ people suggest I do? Please lets talk ways to get the data back specifically and not what I could have done and why.
Lets talk about what can I do now.

St.Jimmy 02-11-2007 01:31 AM

Testdisk and photorec work nicely,and as long as you didnt do a full format or dev/zero wipe it should be recoverable.another way is to buy the cd edition of acronis DD and boot from it. use it's recovery mode to recover deleted and/or quick-formated fs's. good luck

prozac 02-12-2007 01:36 AM

Thanx St.Jimmy for the response.
I have been busy lately trying to recover the lost data. so far I have used Linux_recovery and PhoenixLinux, both of which run on windows to attempt recovery and both of them failed to provide any substantial data. The Linux_recovery one did gave me back all my lost directories but with no files and the 'search for lost files' hangs with for bars in the progress menu. no luck. The PhoenixLinux didn't do any good either. It couldn't even list anything.
I am again making a image of the original hdd but this time using dd_rescue so that I get most out of the formatted disk. I plan to use Testdisk to see what it can yield. Photorec from what I have read seems like it will work but its output is rather tiresome. Says, it gives back the files in a number format like the first doc file found is 1.doc and so on. I have literally 100G of data on the disk and this means lots of files. Thinking about scouring through all the files one by one to see what file it really is seems a tiring job.
I have a similar experience in windows where I formatted a NTFS drive accidently and wiped out all my data. I used a tool called GetDataBackNTFS which worked so cooly it returned back all my data from the NTFS partition as it was. The application showed me all the deleted folders and files exactly as it was before the format and all I had to do was select the files I wanted to restore and then restore it. I wish we had a similar tool for Linux partitions too.

syg00 02-12-2007 03:19 AM

Try ddrescue (no "_" character).

prozac 02-12-2007 03:49 AM

Quote:

Originally Posted by syg00
Try ddrescue (no "_" character).

I am sorry but I don't see any difference. What's your point?

St.Jimmy 02-13-2007 04:21 PM

ddrescue is an imager, not a recovery tool like one prozac needs.
ohh, GDB is a nice tool, just needs to work with ext2/3.

prozac 02-15-2007 02:21 AM

I used photorec and it did recovered all my files. It was advised that I run photorec from the directory that will hold the recovered data and not from some other place. I used another 200G HDD and made a partition on it large enough to hold any recovered data. I have 99 directories in the recovered partition namely recurep.1 to recurep.99 likewise which contains all the files recovered. The naming of the files is very cumbersome and it is hard to get to the one file that you need but its reassuring to know that it is now there and is a now a matter of intensive searching only. hopefully, i can grep now to find out. I read SpinRite from grcdotcom can do wonders, don't know how much truth there is to it. In any case it is a commercial product.

St.Jimmy 02-16-2007 09:54 PM

Congratulations and good luck. Disk recovery is hard work, ain't it?
notez:Spinright only worhs on hardware damage

prozac 02-17-2007 10:41 PM

Quote:

Originally Posted by St.Jimmy
Congratulations and good luck. Disk recovery is hard work, ain't it?
notez:Spinright only worhs on hardware damage

Thanks St.Jimmy. Yes its lot of hard work but its worth it.
How can a software fix a hardware damage?

St.Jimmy 02-18-2007 12:56 AM

It was designed to read raw data and filter badblocks, I think.
notez:welcome... glad to help someone the first time scence MSDN.. hhuuh *shudder*


All times are GMT -5. The time now is 10:55 AM.