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 […]
[…] proprietory bullshit and programmers wanting to make a quick buck. Shame on all of you. Thus said, ddrescue might do the trick $sudo apt-get install […]
Hi,
How do i access /dev/loop while is just a file and not a folder aka directory? please help me as i have finished copied the image (backup.img) from faulty hdd and I don’t know what to do with it next, Tried to your suggestions and no success.
Cheers.
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
antalya ev ilaçlama
Works a treat, (Ubuntu 11.04) I’d suggest you create a folder under /media and then you’ll be able to mount the image.
ie.
sudo mkdir /media/drive-backup
sudo mount -t ext3 /dev/loop1 /media/drive-backup
If you desire to take much from this paragraph then you have to apply
these methods to your won webpage.
Thanks for your personnal marvelous posting!
I genuinely enjoyed reading it, you will be a
great author. I will ensure that I bookmark your blog
and ill eventually come back iin the foreseeable future. I want to enckurage you conttinue
your great job, have a nice weekend!
fantastic put up, very informative. I wonder why the other experts of this sector don’t realize this.
You must proceed your writing. I am sure, you have a great readers’ base already!