Rescue Data from Failing Partition January 21, 2006
Posted by Carthik in administration, applications, commands, guides, ubuntu.trackback
If you have a hard disk drive, or a drive partition that is failing, or if you want to copy data from one partition to another (don’t we all, at some time or the other?), then ddrescue comes to the rescue!
In case parts of the partition you are trying to rescue data from are corrupt, then ddrescue (unlike dd) skips over it and gets out all the data that is uncorrupted!
Install ddrescue using
$sudo apt-get install ddrescue
Make sure you have a partition with more disk space that the entire partition you are trying to retrieve data from. Yes, that includes occupied AND free space on the partition you are trying to retrieve data from.
Rescue data using:
$dd_rescue /dev/hda1 /some/dir/drive-backup.img
Where you might have to replace /dev/hda1 with the partition you are trying to rescue data from, and /some/dir/ should have more free space than the entire /dev/hda1 partition.
This creates a drive image. You can mount it as a loop device. Do the following to do just that:
sudo touch /dev/loop1
sudo losetup /dev/loop1 /some/dir/drive-backup.img
–If you get an ioctl error, run “$sudo modprobe loop”, and run the prior command again
sudo mount -t ext3 /dev/loop1 /media/drive-backup
(replace ext3 with the filesystem type of your old partition)
Now you can browse /dev/loop1 and copy out all your data. If you use an external USB drive to backup the image to, you can take the image with you
Thanks are due to Dan Martin who posted this at the ubuntu-users mailing list a few weeks ago.







great one, though I didn’t try it. thanks
Yeah, dd_rescue is handy.
I used it to copy the data off of a dying TiVo drive – dd wouldn’t do it but dd_rescue worked great.
[...] Rescue Data from Failing Partition January 21, 2006 [...]
Take note: ddrescue and dd_rescue are two different packages. Make sure you’re using the right one.
hello,
i have done it but now i cant mount my img file says filesystem not valid … any idas will be really helpful. I xcrewed up my drive with partition magic.
cheers
Hi, Recently I lost my GRUB loader, Do you have any ideas on how to reinstall it. hmm.. may be you can post a new topic for it.. thank you.
[...] So anyways, I decided to go research a bit, and went looking for more information. I found such articles as this and this. Finally, I stumbled across this blog. At this point, I started feeling like I had a chance of actually rescuing my precious pictures. So I started running dd_rescue. I am now running Mepis 6 Linux. Which is based on Ubuntu. So the directions that I found seemed fairly useful and complete. [...]
Great artical, really helped me along. Here is an account of my recent experience: http://www.blamires.co.uk/blog/index.php/2006/10/13/fat32_vfat_partition_recovery
I hope this can help someone else.
[...] To find more information from the source here [...]
[...] into smaller segments. If you don’t want your information to go through a cheese-grater, then ddrescue might do the trick $sudo apt-get install [...]