
Bruce Kingsbury wrote:
2008/8/22 Glenn Ramsey <glenn(a)componic.co.nz>:
Hi,
I need to install a bigger hard drive in my laptop which dual boots Windows & Linux. I was wondering if anyone knows of any gotchas that I should be aware of?
What I'm planning to do is to boot from the GParted liveCD and first use dd to clone the original drive with
dd if=/dev/sda of=/dev/sdb
and then use gparted to resize the partitions.
Seems too simple, have I missed something?
Glenn
That would probably work, but it's not how I'd do it because it is likely to result in your partition table being 'less than ideal' for the new drive geometry.
I generally create a new filesystem (with the new drive where it's going to be permanently, and the old drive as slave). Mount the new filesystem as '/target' and the old one as '/source', use cp -a to copy everything over.
Then update the UUID's in /target/boot/grub/menu.lst and /target/etc/fstab to match the new filesystem. You can get filesystem UUID's using the vol_id command.
Then run grub-install --root-directory=/target.
There may be better ways, but this works for me.
Thanks everyone for the advice. Bruce, what is the issue with the partition table? Here's how it went... I was copying from an 80GB drive and I ended up by using clonezilla to clone it onto a 120GB drive in a USB caddy. Then I booted Linux from the original drive and used gparted to move & resize the partitions, using almost the same layout as the original. Then I made the adjustments to the grub menu and fstab as detailed above before swapping the drives. This was suprisingly painless, and there was only one gotcha, which was when I tried to mount the cloned drive from the original it got confused because the UUIDs were the same; uuidgen and tune2fs -U fixed this. Glenn -- Glenn Ramsey <glenn(a)componic.co.nz> 07 8627077 http://www.componic.co.nz