I just installed my new 120G drive a month ago. My 40G drive had 13 partitions. What I did was I made partitions on the new drive which were big enough to hold all the data from the old partitions, plus I gave myself some breathing room. I then used rsync to copy the partitions one at a time. You could also use dd to copy the data.
First download one of the small Linux distributions available. Check
www.linux.org for more. Here are some popular rescue systems which boot off CD.
Lets say you have 3 partitions on old 40G drive, and you have it installed as
hdb. Suppose the partitions look like this:
hdb1 = vfat - Windows
hdb2 = ext3 - Linux
hdb3 = swap - Linux-swap
Then you partition the new hda with 3 partitions and you format the partitions with matching filesystems. Now you are ready to transfer the data.
Once you boot the cd you just need to:
- Mount the partitions and transfer the data. -OR-
- Use dd to transfer the data.
Here is how you would use rsync.
mkdir /hda /hdb
mount /dev/hda1 /hda
mount /dev/hdb1 /hdb
rsync -a /hda/ /hdb/
umount /hda
umount /hdb
mount /dev/hda2 /hda
mount /dev/hdb2 /hdb
rsync -a /hda/ /hdb/
mkswap /dev/hda3
If you instead wanted to use dd, this would work.
dd if=/dev/hdb1 of=/dev/hda1 bs=512 skip=1 seek=1
dd if=/dev/hdb2 of=/dev/hda2 bs=512 skip=1 seek=1
mkswap /dev/hda3
The skip and seek make sure you dont overwrite the boot sectors on the destination.
Now dd seems easier to use however it will take longer because it will copy the entire partition (including unused space.)
Once you finish copying the data you just need to run lilo or grub to reinstall the bootloader.
With /dev/hda2 mounted at /hda you can run lilo like this:
lilo -r /hda
Now you should be able to boot your new drive.