Hopefully you will never have to use this as I just did! I had a partition on a drive /dev/hda5 (my home directory with ALL my personal and work information) that started giving me Buffer I/O Errors. It wouldn't mount, nor would knoppix (or anything else) mount it. In my case it was formatted with Reiserfs, but this can work with ext2 or ext3.
Here are the steps I took to recover. I was able to get about 80% of my data back. (If I would have done this rigth away instead of trying to fix it "live" I'd had saved more). Someone posted that dd_recover was on the knoppix live cd, but I dont know if dd_rhelp is, or what version so I just got the latest.
-Unmount the drive immediatly if it is mounted
-download dd_recover (Rightly called in one review "...when no one else can help you...")
www.garloff.de/kurt/linux/ddrescue/
-Also get dd_rhelp
www.kalysto.org/utilities/dd_rhelp/index.en.html Make sure you read ALL of his FAQ before you continue. (It's only 1 page)
-untar dd_recover, change to that dir and make && make install
-untar dd_rhelp, change to that dir, configure, make and make install it too.
-Make sure you download and read ALL of this so you get an idea of what will be happening. (Its only 3 pages)
www.linux-magazine.com/issue/47/Restori ... rescue.pdf
-You will need to have a partition atleast the same size of the bad partition. It is recommended to have double. Be sure this partition is ext3 or Reiserfs. (Can handle large file sizes). For some reason I couldn't use any of knoppmyth's (ext3) partitions because the image would get about 21GB and give me "File Size Exceeded". Dunno why that is.. I bought a new drive and put ext3 on it and it was fine..
-Run this command (In my example hda5 is the bad partition and I want to have the imaged saved to /some/directory/hda5back.img (on my new drive)
dd_rhelp /dev/hda5 /some/directory/hda5back.img
My partition was 30GB and it ran for about 4 hours. Once it starts to repeat itself without retrieving anymore data (you can see the progress bar) you can Ctrl-C out of it. But make sure it goes through the whole partition atleast once, I let mine repeat a couple of times just to be sure. (If you'd read the dd_rhelp docs, you'd understand). You'll see errors, Buffer I/O errors, etc, but just let it go until you are sure it is repeating and not recovering much (if any) more data.
- The next step was to copy the new image to a backup, I didn't do this. I probably should have, I didn't want wait for it to copy 30GB of data...
- Follow the instructions from the PDF file to check that image with either the reieserfsck or fsckext3, etc. In my case I did the --fix-fixable tag, It took about 15 minutes and came back to say I had to run the same with --rebuild-tree tag. That took about 2 hours.
-Mount the image using loopback. On my system (ubuntu) it was:
mount -o loop /some/directory/hda5back.img /mnt/mark2. (What a feeling to see this sucker mount!).
-Change to that directory, a good majority of your folder/files should be there, along with alot in lost+found that will need to be renamed and cleaned up.
-Copy those files wherever you want, fix yourself a stiff drink and toast to the wonderful world of linux!
Whether this will work on a windows drive, I dont know. I think the dd_rhelp/dd_recover might, but I dont know what one would do beyond that.
Once again I am so thankful and greatful to everyone (Cecil) that turned me on to Linux a few years ago! I am sure if this was windows, my entire customer information, source code, tax information and kids pictures would be gone forever. (Unless I wanted to pay hundreds or thousands to a recovery company).