Brand New Hard drive Breezy install....

Dan Martin volume at dmartin.org
Thu Oct 20 21:52:51 UTC 2005


> Supposing that I get breezy running on my new drive, 
> how would I get data off the old drive?  (I Cant, 
> repeat Cant, make a backup to transfer... its a long 
> long story) Is there a way to mount it and then transfer 
> files(mainly music etc.) from my old drive with Windows 
> and Hoary to my new Breezy install?  

I can't answer any of your other questions, but this one I dealt with a
couple of weeks ago.  Despite sectors going bad in my system area, I got all
the data off my drive, except of course the stuff on bad sectors.

Here's how I did it.

1) Get dd_rescue.  Most tools will die when IO errors occur.  dd_rescue is a
tool that ignores errors and copies the data that is still viable.  I'm
pretty sure it was in Synaptic as dd_rescue, or if not you can get it here:
http://www.garloff.de/kurt/linux/ddrescue/

2) Use dd_rescue to make a drive image.  Note, for this step to work, your
new drive MUST have more free space than the ENTIRE size of the old drive
(not just the size of the data, the size of the physical drive, both empty
and full space).  Run:

dd_rescue /dev/hdb1 /some/dir/old_drive.img

This command will take a very long time (overnight is probably a good time
for this step).  

3) Now that you have your drive image, you need to mount it as a loop
device.  As root (or use sudo), run:

touch /dev/loop1
losetup /dev/loop1 /some/dir/old_drive.img
(if you get an ioctl error, run "modprobe loop", and run the prior command
again)
mount -t reiserfs /dev/loop1 /media/old_drive
(replace reiserfs with the filesystem type of your old drive)
 
Now, you should be able to browse to /media/old_drive and have access to
everything.  Of course, some data might be corrupt, but whatever isn't will
be available.

-Dan





More information about the ubuntu-users mailing list