jump to navigation

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.

Comments»

1. towsonu2003 - January 21, 2006

great one, though I didn’t try it. thanks

2. Marc - January 22, 2006

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.

3. El Blog de Heriberto Faúndez » Hola - January 23, 2006

[…] Rescue Data from Failing Partition January 21, 2006 […]

4. Jon - April 14, 2006

Take note: ddrescue and dd_rescue are two different packages. Make sure you’re using the right one.

5. ashok - May 30, 2006

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

6. arddy - August 4, 2006

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.

7. What am I learning now? - September 5, 2006

[…] 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. […]

8. Mike Blamires - October 13, 2006

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. 🙂

9. Border Crossing Stats » Rescue Data from Failing Partition Ubuntu Blog - March 11, 2008

[…] To find more information from the source here […]

10. How to recover lost files in Ubuntu Hardy 8.04 « Indlovu - July 4, 2009

[…] 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 […]

11. How to recover lost files in Ubuntu Hardy 8.04 | Indlovu - July 29, 2009

[…] 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 […]

12. Victor - February 6, 2010

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.

13. porno sikiş - September 27, 2010

Take note: ddrescue and dd_rescue are two different packages. Make sure you’re using the right one.

14. sex sikiş - September 28, 2010

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

15. antalya böcek ilaçlama - August 8, 2011

antalya ev ilaçlama

16. Phred - September 28, 2011

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

17. Barbra - July 26, 2013

If you desire to take much from this paragraph then you have to apply
these methods to your won webpage.

18. Nannie - April 11, 2014

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!

19. http://www.neonnitwit.com/index.php?topic=2231.new#new - October 6, 2014

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!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: