Home » Questions » Computers [ Ask a new question ]

Cloning a Linux (Ubuntu) Boot Drive That Has A Few Errors

Cloning a Linux (Ubuntu) Boot Drive That Has A Few Errors

I've got an 8.04 Mythbuntu installation I need to clone to another disk. Unfortunately the disk it's on has a few errors, so dd aborts when I try the usual

Asked by: Guest | Views: 209
Total answers/comments: 2
Guest [Entry]

"The final solution turned out to be relatively simple (none of the dd solutions worked).

Booted off of a 9.04 live CD with both my original problem drive (/dev/sdf) and the new drive I wanted to clone the original drive to (/dev/sde) attached.
To make sure the disk was bootable, grub was installed, etc., I installed Ubuntu 9.04 on the new disk (sde). (There's probably a faster way to accomplish this but I knew this would do the trick.)
Mounted sdf as disk-1, sde as disk-2
Deleted all the files off the new install on disk-2
Mounted sdf as disk-1, sde as disk-2
sudo cp -a /media/disk-1/* /media/disk-2 (copies all the files recursively and keeps attributes and permissions)
sudo blkid (Gets list of the UUIDs of all the disks. Manually copy the UUID for the new (sde) partition to the clipboard)
sudo gedit /boot/grub/menu.lst (Now change the UUIDs in the grub entries from the ones for sdf (old) to the ones for sde (new) by pasting in the previously copied UUID)
Rebooted, and it worked! Hallelujah!"
Guest [Entry]

When plain dd fails you can try with dd_rescue instead, because dd_rescue does not abort on errors on the input file.