Go easy on me. This is my first how to. I have been up for 36 hours trying various methods to recover my lost data! Given that i'm not the most confident Linux user and I managed to succeed. I though it was necessary to share my experience.
I was making the transition from windows xp to Ubuntu Edgy. Somewhere along the line I hurt my NTFS data partition. I have all my music, videos, thunderbird profile, everything on this one drive! I was unable to mount it or use ntfsfix or even chkdsk from the recovery console off the windows xp install CD. I was not paying the best of attention when I broke it but I believe I accidentally installed grub to /dev/hda instead of /dev/sda! Maybe?
After trying ddrescue and failing. I came across TestDisk.
I decided to give it a go:
sudo apt-get testdisk
Don't ask me which repo it is on. It wasn't working very well. It kept exiting.
The version on the repositories is not the current version. However there was a rpm on the main website. I thought I would try alien out for the first time.
Steps:
Code:
sudo apt-get install alien
Code:
wget http://www.cgsecurity.org/testdisk-6.6-1.i386.rpm
Code:
sudo alien testdisk-6.6-1.i386.rpm
Code:
sudo dpkg -i testdisk_6.6-2_i386.deb
Ok we have TestDisk and PhotoRec installed.
Change to the folder of where you want to recover your files to.
Code:
cd /media/data/recover
The following steps may not replicate your needs. There are some examples of how to use TestDisk here
Choose create log file
Select which device to use for me it was /dev/hda
Select INTEL/PC Partition
Choose 'Analyze' then 'Proceed' then select 'Search'. TestDisk should now scan your device for partitions (If it hasn't already discovered them). This may take a little while. About 5 minutes on my 80 GB hard drive.
TestDisk should now list a series of partitions. I think it is listing past partitions on my drive. I'm not to sure. There are are a couple of NTFS and EXT partitions displayed. I'm guessing from past installations. Select your partition and choose 'List'. From here you can get a folder listing. Pressing 'C' to copy that folder and it's child objects in to your recovery folder.
Browse to your recovery folder!
Tips:
DMA enabled on your drive? Does your drive support it?
Code:
sudo hdparm -d /dev/hda
Turn it on
Code:
sudo hdparm -d1 /dev/hda
I can finally go to sleep now knowing I have my important data back. This has been a 36 hour ordeal and taught me a lot about Linux. I believe Christophe Grenie is the author of this great utility. I am in debt to him. Thank you.
I also believe this program can fix corrupt filesystems and be used to recover data from recently formatted drives. There are probably better how to's and easier way to recover your data, but this is all I know for now. Don't ask me what PhotoRec does! The project website has great documentation.
I guess I should also start backing up my data...
Higgo
Bookmarks