1

I installed Xubuntu on a pcie ssd to use side-by-side with Mint. But, I still want to use Mint on its current SATA ssd drive. Ideally, I'd like to make sure that the Xubuntu installation is bootable (I haven't been able to yet), and then have an entry for each in Grub. I have a boot-repair USB for executing any grub commands or generating more info.

I've tried several different combinations of grub installations, but so far no luck. Is there a canoncial way to add a xubuntu distro to grub, assuming I want my current drive (Mint/SATA) to handle grub management?

Here's my lsblk output (excluding snap/loop devices)...

sda           8:0    0 111.8G  0 disk 
└─sda1        8:1    0 108.4G  0 part /
sr0          11:0    1  1024M  0 rom  
nvme0n1     259:0    0   477G  0 disk 
└─nvme0n1p1 259:1    0   477G  0 part /media/alpha/xubuntu

sda1 is where my current Mint distro lives.

Output of update-grub:

$ sudo update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/50_linuxmint.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-66-generic
Found initrd image: /boot/initrd.img-4.15.0-66-generic
Found linux image: /boot/vmlinuz-4.15.0-58-generic
Found initrd image: /boot/initrd.img-4.15.0-58-generic
Found linux image: /boot/vmlinuz-4.15.0-20-generic
Found initrd image: /boot/initrd.img-4.15.0-20-generic
done
1

Edit: Seems the cause was that one of the the systems booted via legacy BIOS instead of UEFI. This caused Mint being unable to detect the secondary system on nvm.

So for people having a similar problem: be sure all your Linux installations use the same boot method. If fixing this did not help, check the rest of this post.

  • boot both of your Linux installations and apply the steps below - one after the other because when installing a new kernel in one of them update-grub will be called and probably overwrite the settings you made in the other.
  • edit /etc/default/grub and set GRUB_TIMEOUT_STYLE=menu to make the menu appear, and GRUB_TIMEOUT to maybe 10 (seconds)
  • run sudo update-grub this installs all kernels of your currently running Linux into the menu. After that it adds all kernels of all other Linux installations it finds on the disks currently available. Check if it detected all systems available!
  • If the above did not help, run sudo grub-install /dev/sda to install grub into the SSD. But most likely this will not change anything as it already was done automatically.

The Linux where update-grub was called last will be at the top and will boot automatically if GRUB_DEFAULT=0. This may change because update-grub is called automatically whenever a new kernel is installed.

If for some reason the auto-detection does not work, edit /etc/grub.d/ files. But you have to update-grub always from the Linux where you modified these files. This might be a problem when update-grub is called automatically after installing new kernels.

If you want the UEFI boot menu to chose which Linux to boot, simply do it this way:

  • boot Mint
  • sudo grub-install /dev/sda
  • boot Xubuntu
  • sudo grub-install /dev/nvme0n1

This will cause a different priority in grub, depending which disk the UEFI booted from. To be sure, don't forget update-grub afterwards.

PS. If for some reason autodetect does not work (with the nvme...) Then you have to edit the files in /etc/grub.d

PPS. If it still does not work and you want to try from a live CD. You will need to chroot into the installed system. This is not trivial. And making it install install menu entries for all your Linuxes might be even more difficult.

BTW I am not sure how Linux handles the grub installation point set with grub-install /dev/sda. How does the connection between grub menu and grub boot-sector code work?

| improve this answer | |
  • Thanks! When I run grub-install dev/sda from Mint I get grub-install: error: cannot find a GRUB drive for dev/sda. Check your device.map. Maybe a partition problem? I can't see any sign that it detects Xubuntu. When I try to boot the nvme, there is no Grub menu and Mint boots anyway. I'm all for editing grub.d if that's what it takes. Happy to keep a working version of that in a repo for reference. There is nothing valuable on the nvme, so it's fine to repartition that drive or reinstall xubuntu as well. – alphaharris Nov 19 '19 at 20:24
  • 1. you forgot the leading / in /dev/sda? Grub is stored in the bootsector (the partition table) and in the 1 MB which is kept free by recent partition managers. check that your first partitions start at sector 2048. - 2. Please show us the output of update-grub - 3. If you don't see grub, then grub is hidden. Press Shift while booting and edit /etc/default/grub to remove the hidden flag, then update-grub. – JPT Nov 20 '19 at 9:25
  • Good call on leading slash! The first partitions of both drives do indeed start on 2048. $ sudo grub-install /dev/sda Installing for i386-pc platform.Installation finished. No error reported. So, I tried to boot xubuntu from grub> to continue with your instructions, but when runing ls on the (hd0) entry that seems to be the nvme, I got error: unknown file system and didn't get any further. gparted says the file system is ext4 which is what I was expecting. Maybe something wrong with MBR? I have not yet successfully booted from this drive. – alphaharris Nov 20 '19 at 21:07
  • 1. It should not be necessary to fiddle with grub while booting. If you want to try, you probably need (hd0,0) which means first partition on first disk. -- 2. so yes, the scripts in /etc/grub.d do not detect your xubuntu installation. check what sudo os-prober says. -- 3. is your PC very old? Installing for i386-pc means you boot in legacy BIOS mode not UEFI. Not sure if this may cause trouble with nvm. – JPT Nov 22 '19 at 12:57
  • It's not old, but needed MBR/Legacy for a Windows dual boot a while back (no longer necessary). I think you're right, that the nvme needs GPT/UEFI, but this seems a separate question.. will treat it as such. For this question, I will try your solution with a non-nvme drive to test that theory (: – alphaharris Nov 23 '19 at 1:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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