How do I migrate my Ubuntu to a new Hard disk

Asked by eric tennant

I have Ubuntu 10.4 installed on a hard disk which has SMART enabled on it & it now tells me when I boot up that the hard disk is faulty & to backup & replace hard disk, I know there is something wrong with the hard disk, because when it eventually boots up into Ubuntu it does a disk check & then takes about 20 mins. to open.
I have installed a new hard drive as i have had a spare drive bay & would like to copy my old hard disk over to the new one with out losing any settings etc.
How do I go about this.
Thanks
Eric Tennant

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
alma libre (dj-bautista) said :
#1

use http://es.kioskea.net/telecharger/telecharger-110-driveimage-xml or norton gosh but it`s under windows, use a machinen whit windows and use it wiht the hard disk, the old and the new.

Revision history for this message
eric tennant (erictennant) said :
#2

I do not have Windows, but I have made a backup of Ubuntu to a external drive, I think it is called a simple backup. ??

Revision history for this message
midnightflash (midnightflash) said :
#3

Normally I use True Image Home for this now. It's only 20€ to buy it and does a very clean, fast and good job.

Ok... it's a bit more difficult if not wanting to spend a buck at all.
There are of course some more ways to do this.
Btw: All should be done from a live-cd-system...

One way... use PartImage. It's in the Repos. But this way you first have to make an images of the partitions to another location (the external HDD f.e.) and than rewind them to the new HDD (Both with the MBR). Did such things long time ago several times with success to clone a system to many PCs.

Or you can just user DD and copy all single bits from the source to the destination. Might work too. But never did for me.

Or you can user "tar" to copy the files and then "grub-install" to get the bootloader in the right manner back. (Would be my choice for you task and would not even require a live-cd-system)
# cd /mnt_old_system
# tar -cvpf - . | (cd /mnt_new_system ; tar -xvf -)
# grub-install /dev/new_system

so about... much fun and luck!

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#4

I always make this, booting from Ubuntu live cd and using dd to make a copy from older disk to newer disk

Assuming /dev/hda size is < than /dev/hdb (your hard disk letter might be different for example sda and sdb or a mix of them, discover it with fdisk command)

Open a terminal and type:

sudo -i

fdisk -l

dd if=/dev/hda of=/dev/hdb

Replace /dev/hda with your Ubuntu Drive
Replace /dev/hdb with the drive you wish to copy TO!

check & double check the fdisk -l output

Unplug the older disk and keep it as secure backup of your current installation for a while and plug the new hard disk as primary and boot your pc.
After you can put your old disk as secondary on the same pc or use it on a different pc (it usually works, you might need to reconfigure graphics layer) .

Then booting from Ubuntu live cd and using System → Administration → Partition editor, increase the just copied partitition size to fill new disk size (bigger than previous disk).

This is my usual Ubuntu cloning method...

Hope this helps

Can you help with this problem?

Provide an answer of your own, or ask eric tennant for more information if necessary.

To post a message you must log in.