I booted Ubuntu on a different suvol and updated it, that apparently overwrote grub?

Been happily running manjaro ever after and had Ubuntu on a different subvolume with it’s own little entry in grub. Now I booted Ubuntu for some software I couldn’t get to run on Manjaro and figured there was no harm in running an update/upgrade. I hit restart and land back in Ubuntu instead of Manjaro, the update seems to have killed my grub? Is this normal for Ubuntu updates? That’s highly annoying … is there a no brainz solution of restoring my manjaro grub settings? Thanks !

Assuming bios-legacy/msdos.
You most likely update/upgrade your grub as well in Ubuntu.
That will make Ubuntu grub the ‘default’ (unless you set Ubuntu grub to partition [1]).
So hope this will help.

[1] - to set Ubuntu grub to partition,
at Ubuntu terminal "sudo grub-install --force /dev/sdxy"
where /dev/sdxy is Ubuntu partition.
See this.

thanks, will give that a shot !

Since it’s @ on btrfs, do I need to mention the subvol or is sudo grub-install --force /dev/sda1" sufficient?

I haven’t used btrfs as OS partition (tested once) and so I don’t know.
I think if you used the whole btrfs partition (@) as Ubuntu, it should be /dev/sdxy
But if Ubuntu is on one of the subvolumes, I wouldn’t know (I can guess, but that will be irresponsible of me).

You can of course leave it (Ubuntu grub) alone and when Ubuntu grub updates (grub-install only not ‘update-grub’) again, repeat setting Manjaro to ‘default’.
But if you find out (/dev/sdxy or subvolume), please let us know. Thanks.

[edit] - don’t guess, do a “sudo mount” (or findmnt) and find out ‘partitioning naming’.

Ubuntu always installs on @ and @home since it’s too silly to give you a choice :slight_smile:

Grub cannot find any OS in a different btrfs subvolume automatically. You need to create a manual Entry in /etc/grub.d/40_custom

did you look in your bios under boot to see if there is a manjaro entry if so make it first boot in your bios reboot then do a sudo update-grub that should get you booting from mamjaro with a menu with ubuntu in it

I think that would be for UEFI, I did legacy boot …

funnily enough I have this custom.cfg in my manjaro /boot/grub/

    menuentry 'Ubuntu using sym-link ' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple**' {
set gfxpayload=1024x768
insmod part_msdos
insmod btrfs
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 **
search --no-floppy --fs-uuid --set=root **
linux /@/vmlinuz root=UUID=** rw rootflags=subvol=@ quiet
initrd /@/initrd.img

Does manjaro also overwrite grub when it updates? Shall I stick with Ubuntu as owning grub or manjaro owning grub?

Is it enough to change the subvol @ to @manjaro in the custom.cfg to make it work? Thanks!

Fine, you can use Ubuntu Grub or Manjaro Grub as you wish, but if you use Ubuntu Grub you need to have the code for Manjaro entry look like this:

menuentry 'manjaro LXQt x86_64 (4.7)' --class manjaro --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-d81d7053-313f-4941-bd2d-c3db7298e052' {
#	savedefault
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos 
	insmod btrfs
	set root='hd0,msdos1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  3b21f2....
	  search --no-floppy --fs-uuid --set=root 3b21f2....
	linux	/@mjr/boot/vmlinuz-4.7-x86_64 root=UUID=3b21f2.... rw rootflags=subvol=@mjr  quiet
	initrd	/@mjr/boot/intel-ucode.img /@mjr/boot/initramfs-4.7-x86_64.img

With @mjr being an example name for your Manjaro root subvolume.

Almost enough, a reference to intel-ucode.img is necessary!

Hurray I’m finally back in Manjaro, thank you so much! Now I did sudo grub-install /dev/sda1 from within manjaro but that didn’t give me my trusted manjaro grub back, I still have to hit CTRL + ALT + DEL to interrupt the Ubuntu boot and choose my custom entry …

That should be

sudo grub-install /dev/sda

Awesome, hurray! You’re my hero !

And because I did

sudo grub-install /dev/sda1

inside Ubuntu, the next Ubuntu update won’t overwrite my Manjaro Grub, correct?

Correct. :slight_smile:

Epic ! Thanks again so much ! Every linux user should be handed an info pack on how to deal with grub.

info packs don’t help, experience is what really matters

Type into your terminal

info -f grub -n ‘Simple configuration’


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by Bytemark