Changing the Linux boot partition
Changing the Linux boot partition
I have multiple Linux installations on the same drive:
- /sda1 = Ubuntu 10.04 64-bit
- /sda5 = Ubuntu 13.04 16-bit
- /sda6 = Xubuntu 12.04 64-bit
- /sda7 = Xubuntu 12.04 64-bit
- /sda9 = Mint 12 64-bit
As I installed different versions, so whichever I installed last appeared at the top of the GRUB menu and became the default.
To change this, boot from the partition you want as the default (in my case /sda7 for Xubuntu 11.10) and go into the terminal and enter:
sudo grub-install /dev/sda7
where you substitute whichever partition you want in place of the "sda7".
If that gives you a load of old bunny like this
/usr/sbin/grub-setup: warn: Attempting to install GRUB to a partitionless disk or to a partition. This is a BAD idea.. /usr/sbin/grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged.. /usr/sbin/grub-setup: error: will not proceed with blocklists.
you will find advice telling you to use
sudo grub-install --force /dev/sda7
and if that leaves you tearing your hair out because the grub-install command used to work and now doesn't (as happened to me when I installed Xubuntu 13.04 which uses grub2 on a system where I wanted to go back to the 12.04 partition which uses grub), try this:
grub-install --root-directory=/mnt/boot /dev/sda7
with /mnt/boot being the mounted partition for your boot directory.
Alternatively: boot into the Linux you want grub to run from then
sudo grub-install /dev/sda
followed by
sudo update-grub