I have a laptop which I dual boot, well actually I have 3 distros running on it.
I currently have Linux Mint 18, which is my daily driver. I find it is very stable, simple and not as much bloat as Ubuntu. I also have Windows 10, which I hardly use, but can be good for some gaming.
The third and last partition I typically use as a bit of a play pen where I install various other distros I want to try and have recently been running Kali Linux. However this morning I decided to install a new’ish distro called Solus.
Anyway after I installed Solus on my EFI based laptop it overwrote my boot loader (GRUB) and I lost access to all but Solus to boot into. This is not uncommon when installing other OS onto the same disk but it usually takes me longer than it should to remember how to recover thus I thought I should just document the process here.
So lets get started…
Basically the first thing to do is to boot up using a USB key/drive with a live linux distro such as Ubuntu or Linux Mint.
Once booted, if you are not sure you need to find where your / and EFI partition are. Whilst it is not obvious my partition are:
sda1 = /boot/efi
sda4 = Windows 10
sda6 = Linux Mint root (/)
sda8 – Solus root (/)
sda9 = Swap
Once you know these you can start by mounting these partitions, with the following commands:
mount /dev/sda6 /mnt
mount /dev/sda1 /mnt/boot/efi
Next you need to also mount all the file systems you will need with the following command:
for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt$i; done
To ensure our kernel has loaded the UEFI model to enable efibootmgr to access the boot manager variables we run:
modprob efivars
Then we chroot to /mnt and use that as our base filesystem
chroot /mnt
Once this is done we can now install grub which will also can the paritions and setup boot entries in grub for the OS’s it finds.
apt-get install –reinstall grub-efi-amd64
Once this is finished you can type ‘exit’ to get out of the chrooted environment. The above command can be seen in the below screenshot.
Once that is complete you can umount the file systems and reboot.
for i in /sys /proc /dev/pts /dev; do sudo umount /mnt$i; done
umount /dev/sda1 /mnt/boot/efi
umount /dev/sda6 /mnt
reboot
That is it. Once you rebooted you should get a new grub boot loader with all of your OS’s listed and accessible.