Announcement

Collapse
No announcement yet.

Multi-Boot btrfs grub not updating

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Multi-Boot btrfs grub not updating

    I have my system set to multi boot different flavors with btrfs. It works pretty well, normally.

    I just installed Kubuntu 24.04 to @ and @home, leaving all my other distros intact. My primary booting OS is Kubuntu 22.04

    Ku24 did not show up on the boot menu. So I mounted the @ subvolume from inside Ku22 and dug around with Krusader to see what was going on.

    Kubuntu 24.04 is missing both:
    • boot/grub/grub.cfg file
    • boot/efi/ directory where the EFI boot.cfg resides on 22.04
    It DOES have /etc/default/grub

    I ran
    Code:
    sudo grub-mkconfig
    and
    Code:
    sudo update-grub
    but there was no change.

    How do I update grub to add Kubuntu 24.04 to grub?
    Last edited by TwoFistedJustice; Yesterday, 06:17 PM. Reason: add tags

    #2
    Grub has OS Prober disabled by default.

    See https://askubuntu.com/questions/1475...able-os-prober
    Windows no longer obstructs my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      Last time I checked, GRUB would not boot multiple BTRFS installs on the same file system automatically. OS-prober just doesn't have the ability to "see" separate installs per subvolume so enabling it won't help.

      I currently have 3 installs on my main BTRFS file system, but I've had as many as 7. Here's how I manage it:

      My 3 "booting" subvolumes: @grub, @KDEneon, @Kubuntu2404

      First, I have a "dedicated" GRUB install - "@grub". It's actually Ubuntu server 20.04 (no desktop) and mostly stripped down to minimums - about 3GB. It is the OS that boots when I reboot the machine.

      In @grub/etc/grub.d/40_custom are stanzas that link to each of the other installs GRUB menus:
      Code:
      #!/bin/sh
      exec tail -n +3 $0
      # This file provides an easy way to add custom menu entries. Simply type the
      # menu entries you want to add after this comment. Be careful not to change
      # the 'exec tail' line above.
      menuentry 'KDEneon 24.04' --class kdeneon {
      insomd part_gpt
      insmod btrfs
      insmod gzio
      search --no-floppy --fs-uuid --set=root 247e6a5b-351d-4704-b852-c50964d2ee6
      configfile /@KDEneon/boot/grub/grub.cfg
      }
      menuentry 'Kubuntu 24.04' --class kubuntu {
      insmod part_gpt
      insmod btrfs
      search --no-floppy --fs-uuid --set=root 247e6a5b-351d-4704-b852-c50964d2ee6
      configfile /@kubuntu2404/boot/grub/grub.cfg
      }
      ​So when I boot I initially see this:
      Code:
      Grub install GNU/Linux
      KDEneon 24.04
      Kubuntu 24.04
      I have my "main" OS - KDEneon - set as the default with a 3 second timeout. If I do nothing, in 3 seconds the KDEneon grub menu appears. I again have a 3 second timeout before it launches KDEneon. During those 3 second intervals, I can select another boot line rather than the default. Or when I see the KDEneon grub menu, I can hit ESC and return to the @grub install menu. If I power on and leave the room, KDEneon boots automatically.

      To insure that each new install has a full working grub menu, when I install it, I have the installer install grub to a different drive or a partition instead of the main boot drive. That way, @grub remains in control of the boot cycle but each installation has a working grub menu of it's own.

      The reason for the dedicated GRUB install is so that when I add or remove a distro from my boot BTRFS file system, I don't have to worry that I might be removing the install that controls GRUB. I've been using this setup for about 7 years without a mishap.

      You can make it a bit "fancier" by adding the other installs to ALL 40_custom menus, but I found this to be extra work for no real advantage. Pressing ESC always take me back to the main grub menu and lets me select Neon or Kubuntu.

      Finally, it isn't really required to have a dedicated GRUB install. You can just pick which OS you want as your default and add the 40_custom entry to it for the other OS. I decided on the dedicated GRUB install because I had so many distros installed it made it a lot easier to have only one main menu to worry about.


      Bunus "fancy" add-on: The ability to boot to an ISO from grub.

      Instead of continually burning ISOs to bootable USB drives, I added this to my 40_custom on the GRUB install:
      Code:
      menuentry 'Latest ISO download' --class iso {
      set isofile="/iso/latest.iso"
      loopback loop (hd2,1)$isofile
      linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noprompt noeject
      initrd (loop)/casper/initrd.lz
      }
      ​Drive "hd2", partition 1, has a folder named "/iso" and I just download the next ISO I want to boot to this folder. Then rename it to "latest.iso" and reboot. The GRUB menu let's me select it and boot to it.

      Note: Not all ISOs boot the same way. The above stanza will boot *buntu ISOs but not all. You might have to create other 40_custom entries if you wanted to boot to a different ISO.

      Please Read Me

      Comment

      Working...
      X