Thursday, October 27, 2011

Rescuing files

I made an oopsy on my dual boot Inspiron1501 while trying to reclaim the linux partition.  I deleted the partition, and while trying to grow the main partition, somewhere along the way lost the Master Boot Record.  I couldn't boot into XP or reach my files.   Doh.  I tried the XP recovery disk, but none of the utilities could help me.

I ended up reinstalling fedora 8 on the free space I had made deleting in the first place.  Then I mounted a usb drive containing the freeware program testdisk, linux version.  Here is some documentation so I can remember the steps in case I have to go get more files. 

The usb stick shows up as /dev/sdb1 a couple seconds after inserting.

To mount it,
mkdir /mnt/usb0

mount /dev/sdb1 /mnt/usb0 -t msdos

copy and gtar -xvf the testdisk tarball

run ./testdisk_static in the testdisk directory
There you can choose files to restore.  The interface is a bit weird, you click c to choose the file or dir you want to copy, then go to the usb drive /mnt/usb0 and do Shift-C to copy the files there.

umount /mnt/usb0 before taking out the usb stick.