Announcement

Collapse
No announcement yet.

Grub not doing its whole sequence

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

    Grub not doing its whole sequence

    The title is based on my supposed understanding of grub. Doing update-grub rewrites the text and binary config files /boot/grubenv and /boot/grub.cfg. SOMETHING must then copy that into /boot/efi/EFI/kde, but I can't figure out what.

    Here's the problem. I do

    $sudo apt update && sudo apt dist-upgrade
    ​...
    Generating grub configuration file ...
    Found theme: /boot/grub/themes/breeze/theme.txt
    Found linux image: /boot/vmlinuz-6.8.0-49-generic
    Found initrd image: /boot/initrd.img-6.8.0-49-generic
    Found linux image: /boot/vmlinuz-6.8.0-48-generic
    Found initrd image: /boot/initrd.img-6.8.0-48-generic
    Found memtest86+ 64bit EFI image: /boot/memtest86+x64.efi
    Warning: os-prober will be executed to detect other bootable partitions.
    Its output will be used to detect bootable binaries on them and create new boot entries.
    Found KDE neon User Edition (24.04) on /dev/sda2
    Found KDE neon 6.2 (22.04) on /dev/sda5
    Found KDE neon User Edition (24.04) on /dev/sdb2t
    Adding boot menu entry for UEFI Firmware Settings ...
    done
    The last part, concerning os-prober is the same as output from updae-grub, so I suppose apt is executing that.​

    After this, grub.cfg has been update in /boot/grub. It contains, among other things

    menuentry 'KDE neon 6.2 GNU/Linux' --class kde --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-34c6a3f4-395c-44a9-b614-7949c4338ae0' { <----/dev/sdb3
    recordfail
    load_video
    gfxmode $linux_gfx_mode
    insmod gzio
    if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    insmod part_gpt
    insmod ext2
    set root='hd1,gpt3'
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 --hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3 34c6a3f4-395c-44a9-b614-7949c4338ae0
    else
    search --no-floppy --fs-uuid --set=root 34c6a3f4-395c-44a9-b614-7949c4338ae0
    fi
    linux /boot/vmlinuz-6.8.0-49-generic root=UUID=34c6a3f4-395c-44a9-b614-7949c4338ae0 ro quiet splash $vt_handoff
    initrd /boot/initrd.img-6.8.0-49-generic <----system level 49
    }​
    which tells me (note the two reverse arrows) that it has indeed taken into account system level 49 on sdb3, identified only by its uuid=34c6a3...

    However, the grub files in /boot/efi/EFI/kde are still those of several days ago. They are what is seen by grub at boot time.

    So how do I do to get grub to take that last step? I suspect it has something to do with the fact that this system is on my /dev/sdb, not /dev/sda.
    Last edited by joneall; Nov 19, 2024, 07:21 AM.
    'I must have a prodigious quantity of mind; it takes me as much as a week sometimes to make it up.' Mark Twain

    #2
    Is something not working right? not booting?
    Is there a reason why you are not running sudo grub-install?

    I don't know anything about Neon. And we don't know what your setup is (disks, partitions, one ESP or two ESPs, etc.).

    Ok.

    the grub files in /boot/efi/EFI/kde are still those of several days ago. They are what is seen by grub at boot time.
    In "regular" Kubuntu (I don't know about Neon), that is normal.
    The grub.cfg file in the ESP (/boot/efi/EFI/ubuntu/grub.cfg) contains ONLY a pointer at the full grub boot file in your Kubuntu OS (/boot/grub/grub.cfg).

    For example, here's my entire file /boot/efi/EFI/ubuntu/grub.cfg:

    search.fs_uuid 7b6a2e52-93ec-4544-ad02-0e0aae1210e5 root hd0,gpt2
    set prefix=($root)'/boot/grub'
    configfile $prefix/grub.cfg​

    hd0,gpt2 is the location of my Kubuntu OS.

    In fact, in "regular" Kubuntu, THAT pointer (contained in /boot/efi/EFI/ubuntu/grub.cfg) is actually hard-coded in the grub executable in the ESP: hard-coded into grubx64.efi.

    Edit: to expand the last sentence to read:

    In fact, in "regular" Kubuntu, THAT pointer contained in /boot/efi/EFI/ubuntu/grub.cfg (pointing at /boot/grub/grub.cfg in hd0,gpt2 = sda2, in my example) is actually hard-coded in the grub executable in the ESP: i.e., hard-coded into grubx64.efi.
    Last edited by Qqmike; Nov 19, 2024, 08:35 AM.
    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

    Comment


      #3
      I edited my post # 2.
      An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

      Comment


        #4
        Originally posted by Qqmike View Post
        Is something not working right? not booting?
        Is there a reason why you are not running sudo grub-install?
        Is there some reason I should run grub-install? I would think from the name that once grub is installed -- once -- there is no need to do it again.

        If I run it, should I run it twice, since I have systems on both sda and sdb?

        This is all the same in Neon and "orginary" Kubuntu. THanks for your reply.
        'I must have a prodigious quantity of mind; it takes me as much as a week sometimes to make it up.' Mark Twain

        Comment


          #5
          No, there is no need to run grub-install again if everything is working OK.
          As you know, grub-install re-installs grub to your OS and sets things up in the ESP (/boot/efi/EFI/kubuntu).

          No need to run grub-install again.
          An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

          Comment


            #6
            I see now how the pointer in /boot/efi/EFI/kde (in my case, Kubuntu in yours) points to /boot/grub//grub.cfg. That file, as I quoted it in post #1, does indeed have all four systems in "menuentry" section, with sdb3 in system level 49 (in detail, 6.8.0-49 ). But the grub menu I see when I boot boots level 48. How can that be? It must be that the boot process is not booting that efi entry. But then, what...?
            'I must have a prodigious quantity of mind; it takes me as much as a week sometimes to make it up.' Mark Twain

            Comment


              #7
              I have systems on sda and sdb. If /dev/sda crashes, will I be able to boot the sdb systems without acces to the sda efi partition?

              Maybe I should have grub installed on both systems. I have efi partitions on both, but the sdb one is empty.
              'I must have a prodigious quantity of mind; it takes me as much as a week sometimes to make it up.' Mark Twain

              Comment


                #8
                Looking at posts 6 & 7, yeah, there's a lot going on! The sequence of how it is all set up is not clear.
                However, I do believe I have outlined all possibilities in my latest how-to:
                Dual booting two (or more) *ubuntu operating systems in UEFI mode -- 1 drive or 2 drives, 1 ESP or 2 ESPs
                https://www.kubuntuforums.net/forum/...-esp-or-2-esps

                Now, that 48 vs 49 issue seems to suggest something related to this fact:

                The very last OS installed will control the booting of the PC ... (through it's grub in ESP, /boot/efi/EFI/<the OS name>) and its /boot/grub/grub.cfg in the OS being installed NOW).

                I am not familiar with the ESP directory/boot/efi/EFI/kde, but that must be where Neon puts its OSs. In other words, you do not have any "normal" Kubuntu's installed (which use /boot/efi/EFI/ubuntu).
                So that is not complicating things here; it is not a factor -- all OSs are Neons.
                And the Neon you installed lastly is the OS occupying the ESP, /boot/efi/EFI/kde -- I think, right?

                If /dev/sda crashes, will I be able to boot the sdb systems without acces to the sda efi partition?
                Well, that's a problem! Yes, you could lose your booting if that happens.
                Two solutions:
                (1) ALWAYS have rEFInd ready, available (by making a rEFInd bootable USB, as per my how-to's, or as per Rod Smith's website).
                (2) Use two ESPs, as you suggest, one on each disk.

                My how-to goes through all this for "regular" Kubuntu's, which should also apply to other *ubuntu OSs, including Neon (I hope!).
                An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                Comment


                  #9
                  Originally posted by Qqmike View Post
                  Looking at posts 6 & 7, yeah, there's a lot going on! The sequence of how it is all set up is not clear.
                  However, I do believe I have outlined all possibilities in my latest how-to:
                  Dual booting two (or more) *ubuntu operating systems in UEFI mode -- 1 drive or 2 drives, 1 ESP or 2 ESPs
                  https://www.kubuntuforums.net/forum/...-esp-or-2-esps
                  Thanks, I will take a look at that ... tomorrow. (It's suppertime here.)

                  'I must have a prodigious quantity of mind; it takes me as much as a week sometimes to make it up.' Mark Twain

                  Comment


                    #10
                    OP, to help understand what is happening, install efibootmgr. The boot entries in non-volatile RAM are where a UEFI system starts from. efibootmgr​ is clunky and can output a mess, it's at the mercy of the firmware.

                    Now, IME, having several installs that have grub installed and updating the ESP (EFI system partition), all trying to control the boot, will screw up sooner or later. I suggest designating one install to control the boot and uninstalling grub from the others, or at install time not choosing an ESP at all.
                    Regards, John Little

                    Comment

                    Working...
                    X