I have a system with two version of Ubuntu in two hard drives, "Ubuntu Desktop 12.04" on the first one (sda1) and "Ubuntu Server 12.04" on the second one (sdb2).
(first installed Desktop then installed Server version).
Neither of the two installations have a separate boot partition.
Both have grub 2 installed.
Only sda1 has a boot flag.
Output from sudo parted -l
:
Model: ATA OCZ-VERTEX2 (scsi)
Disk /dev/sda: 115GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 111GB 111GB primary ext4 boot
2 111GB 115GB 4122MB extended
5 111GB 115GB 4122MB logical linux-swap(v1)
Model: ATA TOSHIBA MK3252GS (scsi)
Disk /dev/sdb: 320GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
4 1049kB 236GB 236GB primary ntfs
2 236GB 290GB 54,5GB primary ext4
1 290GB 320GB 30,0GB primary lvm
By default, (as it is expected I believe) computer runs the grub installed on the Server version as it is the last one installed.
I know that this is the one running, because when I'm updating the kernel on the Desktop version, I have to run "update-grub" on the Server to list the new kernel in the grub menu!
My question is how can I make it run the grub of the Desktop version by default?
When I unplug the second hard drive (with the Server version), I get this error message:
error: no such device .... #(I don't remember the name of the device)
grub rescue>
You can also boot from your Desktop 12.04 live medium and reinstall Grub. Make sure your second disk is plugged in, then from a terminal:
Note that's /dev/sda (without the 1 at the end).
If you add installs or distros in the future, you can keep Grub associated with your first install by either 1) choosing the option to not install any bootloader in the new install or 2) if you don't have that option, choosing the same partition (this time with number) that you are using for the new install. Then boot the first install as normal and run update-grub again. If you forget and install a bootloader to /dev/sda again, you can always boot from the live medium and run the two commands above.