Moving current installation to a new hard disk?

Associate
Joined
25 Jul 2003
Posts
1,241
Location
Cornwall/Bristol
Hi,

Ive just bought a new 500GB HD. I installed Ubuntu on an old 60GB IDE drive just to try it out. I like it so am sticking with Ubuntu, but would like to copy the whole installation over to the new drive. Im also currently dual booting with WinXP which is on a separate SATA drive using GRUB.

Whats the easiest way to do this, so that I still have WinXP on the current SATA drive, and the the current Ubuntu install on the new SATA drive?

How's best to format the new disk also? What partitions do I need? used the old IDE drive, I just formatted the whole disk and let Ubuntu set partitions for SWAP etc.....I dont really know what size and what partitions I really need?

Thanks for any help.
 
This is super easy with Linux. You'll use the dd command to copy the whole thing. The syntax is like so:
dd if=/dev/sda of=/dev/sdb

Where sda is the location of the old disk and sdb is the new one,

It'll do a bit-for-bit copy of the one device to the other. You can then take the extra space and make new partitions out of it or expand your current filesystem to fill it.
 
Use mondoarchive and mondorestore - will resize the partitions accordingly.

Or, partition and format the disk as you'd like and just copy over all the directories (perhaps omit /proc and /tmp), edit /etc/fstab and /etc/mtab then reinstall the bootloader.
 
Ok, so i'll plug the new drive in, think it will be sdb, then use dd from hda (as its IDE not SATA) to sdb straight away, with no need to format the disk first? Then use something (gpart?) to expand the filesystem to fill the rest of the drive?

What size swap/extended partition's should I be using, I have 1GB RAM, or is this something that I dont need to worry about or change?

After this I'll need to change fstab and mtab to point to sdb instead if hda? And also change GRUB so it knows linux is on the new disk?
 
Back
Top Bottom