Recovering bad discs in Linux – pt 2
So, maybe in part 1 the data recovery didn’t work for you?
Well, that’s OK because Linux is robust against bad discs in one form or another. The trick is to work out what that might be.
A good method is to use dd or dd_rescue. These tools create a forensic copy of your hard disk drive or partition so that you can mess around with it without affecting the original drive. This is also a benefit as generally a virtual disk will mount and work faster than a faulty disk drive.
To begin with, we need to create that copy of the partition that you need data from.
mkdir ~/myDisks
dd_rescue /dev/hda1 ~/myDisks/hda1.image
The reason that I’m using dd_rescue rather than dd is that seeing as you’re reading this guide, the drive probably has faulty areas of the disk. dd_rescue will work around those quite nicely.
I’m working on the premise that it’s a single partition that you need to recover. If not, you may want to look over at http://edseek.com/~jasonb/articles/linux_loopback.html#id2494145 to read up on ways to read parts of disk images and generally show off.
Right, so we have our image.
Let’s set up the mount point
mkdir /mnt/restore
And now mount the new partition image
mount -o loop ~/MyDisks/hda1.image /mnt/restore
The partition should now mount on the folder. To check if anything is there:
ls /mnt/restore/
You should see a familiar list of files (or if someone else’s drive, one that is not so familiar). You can now copy the files away and do whatever you need to do to the image.
Once finished, unmount the disk image
umount /mnt/restore
Related posts:
- Mount a Webdav folder in Ubuntu Linux Webdav is a very handy protocol for writing files back...
- Mounting a remote system with SSH One of the cool things I’ve been doing lately is...
- TrueCrypt Autorun Script for USB You can easily create an Autorun file on a USB...
- No More Lost Deleted Files in Ubuntu I had a shocking error of judgement this morning when...
- Move a print job from one queue to another in Linux Today, I was looking at my printer queue and realised...
Related posts brought to you by Yet Another Related Posts Plugin.
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.