You could proceed like this. (I am assuming you don't have and have never had a separate partition for /boot.) Doing it this way will still use the grub files on your old partition, but will allow you to boot to the new one. (This is a safe way to start, but don't delete the old partition.)
On the new copy which you created using rsync, you will need to edit the file /etc/fstab. In that file, there will be a reference to your old hardy partition, with a line that instructs linux to mount the old partition at "/". You need to change that line so that it refers to the new partition (either by its name of the form /dev/xxx or by its uuid).
Similarly, in the new partition, you will need to edit the copy of /boot/grub/menu.lst, replacing references to the old partition with references to the new one. These references are in three places. (The second two are only used by the Debian/Ubuntu auto-update-of-grub features.) First, in the "root=xxxxxx" part of the stanzas that look like
Code:
title Ubuntu 8.04.1, kernel 2.6.24-19-generic
root (hd0,4)
kernel /vmlinuz-2.6.24-19-generic root=XXXXXXX ro quiet splash
initrd /initrd.img-2.6.24-19-generic
quiet
Second, in a stanza near the beginning that looks like
Code:
## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)
(Grub numbers stuff starting from 0. This line would be changed to (hd1,3) for the fourth partition on the second drive.) Third, in a line like
Code:
# kopt=root=XXXXXXX ro
After you have replaced all references to the old partition in the new menu.lst, you can proceed as follows. Edit the copy of /boot/grub/menu.lst on your old and add a stanza at the end like this:
Code:
title Ubuntu on my new partition
savedefault
configfile (hd1,3)/boot/grub/menu.lst
replacing (hd1,3) by whatever grub calls your new partition. This will add a new menu item to the old grub menu. The new menu item will "chain" on to the menu on the new partition. Following this chain, you will be able to boot to the new partition. If it doesn't work, you haven't broken the old setup, so you can boot to the old partition.
Once this works, you can dispense with the old partition by getting grub to go straight to the new partition. To do this, boot to new partition, and then do something like
Code:
sudo grub-install /dev/sda
where (I'm presuming) sda is the disk that your BIOS looks to for the boot loader.
Bookmarks