Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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>

share|improve this question
    
Use this program to correct the grub (and I assume is grub 1.99, not grub 2.00. Ubuntu 12.04 uses grub 1.99 by default). Boot-Repair. Follow the instructions from the link I gave and it should be fine after the [Recommended Repair] –  NikTh Dec 31 '12 at 13:41
    
Thanks a lot! That did the trick! I had already installed Boot-Repair but I was afraid to continue with recommended repair! –  naskoos Jan 1 '13 at 13:36
add comment

1 Answer

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:

sudo grub-install /dev/sda
sudo update-grub

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.

share|improve this answer
    
Thank you for your answer! I believe your suggestion would work too as Boot-Repair works! Thank you for your advice! –  naskoos Jan 1 '13 at 13:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.