You are not logged in.

#1 2025-03-29 00:18:08

vchakhno
Member
Registered: 2025-03-28
Posts: 1

Triple booting, two grub menus

I installed Arch successfully, and I can boot it from the (first) grub menu when I turn my laptop on. But my laptop is triple-boot, and the other options don't show up in this menu. When I launch Ubuntu from UEFI though, I get access to a second grub menu - the one I used before installing Arch - which contains Ubuntu, Arch and Windows.

I installed Arch by following the step by step installation guide, on an ASUS laptop which already had a Windows 11/Ubuntu 24 dual boot.

During the liveusb installation, I noticed my /boot mounted on the EFI System partition was too small: 260 MB whereas guide recommends at least 1GiB. Soon after, installing a few packages mentionned in Install essential packages errored out with the message "Partition /boot too full".

I then decided to deviate a bit from the path in the installation and created a Linux Extended Boot partition, and mounted it as /boot and the actual EFI boot segment as /boot/efi. That way, /boot is the right size (1G). Still from the liveusb, I installed grub and enabled os-probing in hope that it would detect Ubuntu and Windows (it did not).

Here's the partition table printed by fdisk:

Device             Start        End   Sectors   Size Type
/dev/nvme0n1p1      2048     534527    532480   260M EFI System
/dev/nvme0n1p2    534528     567295     32768    16M Microsoft reserved
/dev/nvme0n1p3    567296  499519815 498952520 237.9G Microsoft basic data
/dev/nvme0n1p4 998473728 1000214527   1740800   850M Windows recovery environment
/dev/nvme0n1p5 499521536  748998655 249477120   119G Linux filesystem
/dev/nvme0n1p6 748998656  751095807   2097152     1G Linux extended boot
/dev/nvme0n1p7 751095808  759484415   8388608     4G Linux swap
/dev/nvme0n1p8 759484416  998473727 238989312   114G Linux root (x86-64)

(partitions 6, 7, 8 are the ones I created during Arch's installation)

So now I have two grubs, and I don't have any clue how to boot to the right one and delete the other. In fact, I am very clueless about the whole booting process and would very much like links to documentation about who launches what, or what are /boot and /efi about. I feel like the reason it happened in the first place is because I don't know what I'm doing when messing with booting.

Last edited by vchakhno (2025-03-29 00:19:06)

Offline

#2 2025-03-29 11:27:22

Succulent of your garden
Member
Registered: 2024-02-29
Posts: 214

Re: Triple booting, two grub menus

Well that's going to depend of what are you willing to do.

As for me I would just delete everything an install all over again. But if you don't want to lose your windows key that probably came with your laptop, maybe wait until someone with more wizard skills than me came to post here.  Because I would never do what you made, so I don't know how to approach your issue.

To be honest don't do dual booting like you do, if you have more than one storage device, then is far more better and stable in the future to just boot with your UEFI/BIOS instead of chain loading everything in one drive. The main reason ? Someday windows is going to send a not so good patch and broke everything. Using chain loading is going to demand a lot of time in fixing these kind of issues, and if I'm not wrong, you should need first to install grub and then chain load to windows, so in that case windows have less probablity of breaking grub in a update. So if you have another drive just use the drive and switch during UEFI/BIOS, it's far more convenient and far less demanding to maintain.

Probably that would recommend you. If you can't have two drives in the same machine and need windows. The best approach is to do a windows vm and do pci passtrhough of a gpu. You can do that with lookingglass to have native performance https://looking-glass.io/  . If you need ubuntu by some reason you can launch it also in a vm. Linux virtualization of another Linux system works very well and most of the time without any latency, the performance issues came when you try to virtualize another os with another type of kernel.

So if you just nuke your laptop, and came to the conclusion that you need to install all over it again, I would recomend that. First install Arch Linux, then use something like virt-manager to install your ubuntu virtual machine, then go for the windows one if your laptop have two gpus, one integrated and one discrete  then do the vm with looking glass. if you don't have the two gpu options then go for booting in another drive your windows and always select in UEFI/BIOS what you would like to boot first. If you don't then (I don't recommend this to be honest) do the bootloader chain loading but with two os. So you can boot arch and then inside create a virtual machine using ubuntu, you can also do the contrary.

tip: Don't use ubuntu desktop go for ubuntu server LTS without the snap thing, and do the configurations by yourself, far more better experience to be honest instead of default desktop.

Last edited by Succulent of your garden (2025-03-29 11:31:12)

Offline

#3 2025-03-30 02:12:00

Nyctfall
Member
Registered: 2023-04-03
Posts: 53

Re: Triple booting, two grub menus

Hi @vchakhno, welcome to Arch and the forums!

I'm one of the more experienced people when it comes to GRUB configuration.

vchakhno wrote:

I ... would very much like links to documentation about who launches what, or what are /boot and /efi about.

I learned from the Rodsbooks "Managing EFI Boot Loaders for Linux" series (a very useful resource when dealing with UEFI booting), and the Arch Wiki pages UEFI, GRUB, GRUB/Tips and tricks, Arch boot process, GRUB/Multiboot USB drive, systemd-boot, and Partitioning.

This in particular is essential to reference when managing multi-boot scenarios, as configuring default "fallback" boot entries helps a lot: "Managing EFI Boot Loaders for Linux: Using fallback.efi" by Rod Smith.

Also, I recommend making a backup of system files and user data (TimeShift or Back In Time/rsync, Deja Dup/duplicity, Vorta/borg, bareos, bacula, rear "Relax and Recover", etc.), and keep track of changes to config files using either the backups or with [extra]/etckeeper.

vchakhno wrote:

During the liveusb installation, I noticed my /boot mounted on the EFI System partition was too small: 260 MB whereas guide recommends at least 1GiB. Soon after, installing a few packages mentionned in Install essential packages errored out with the message "Partition /boot too full".

If the ESP (EFI System Partition) was mounted on "/boot" and not "/efi" (or /boot/efi), that would explain why it ran out of space. Usually, OEMs allocate at most 512MB to the ESP. So some boot-loaders are configured to start reading the "/" root partition for the kernel, initramfs, and other needed files in the /boot directory on the "/" root partition, or a separate /boot partition (like the systemd-boot XBOOTLDR).
Also, beware the BIOS "Fast boot" setting when using partitions other than the ESP for booting, as some BIOS's Fast Boot implementations might not load them.

vchakhno wrote:

I installed grub and enabled os-probing in hope that it would detect Ubuntu and Windows (it did not).

Yeah, the man pages for GRUB are almost useless because GNU tools use info pages instead for most documentation (though no one mentions that enough...), install [core]/texinfo to view them with `info grub`. GRUB usually isn't configured to run os-prober automatically, as GRUB defaults to not using os-prober, and os-prober needs the partitions with the other OSes to be mounted when it's run.
Also, it might not always work well when run in a chroot.

Setup the GRUB config to run with os-prober active and with other OS partition mounted. Note that os-prober uses mtab, so mounting the partitions anywhere (like /mnt, /run/media/*, or somewhere on "/") will work.

  1. Make sure it has the config option to enable os-prober uncommented:

    $ cat /etc/default/grub
    GRUB_DISABLE_OS_PROBER=false
  2. Check available drives and partitions:

    $ lsblk -f
  3. Mount the other OS partitions, using GUI tools like GNOME Disks or KDE's "Disks and Devices" Applet in the task bar (these with use "/run/media/*").

    Or mount them manually with `mount`, replace DEVICE with "/dev/nvme0n1p3" and "/dev/nvme0n1p8", and replace MOUNTPOINT with a directory that's not already in use, like somewhere on "/mnt/" or "/", like "/mnt/Windows" or "/Windows-partition".

    # mount -v DEVICE MOUNTPOINT
  4. Check that the other OS partitions are mounted:

    $ lsblk -f
  5. Find the location of the "grub.cfg" on the ESP. Replace OTHER_DIRECTORY with the location of the Arch Linux install's GRUB "grub.cfg" file,
    (Replace '/boot' with '/efi' if the ESP is mounted on '/efi').

    # find /boot -name '*.cfg' -print
    # cat /boot/efi/EFI/OTHER_DIRECTORY/grub.cfg
  6. Run `grub-mkconfig` and output it to the location the ESP Arch GRUB "grub.cfg" searches for.
    Or possibly the same directory as "grubx64.efi" on the ESP, depending on how it's setup.

    # grub-kmconfig -o /boot/grub/grub.cfg
vchakhno wrote:

So now I have two grubs, and I don't have any clue how to boot to the right one and delete the other.

  1. What is the output of:

    # cat /etc/fstab
  2. What is the output of:

    # cat /sys/firmware/efi/fw_platform_size
  3. What is the output of:

    # ls -lahF /sys/firmware/efi/efivars
  4. What is the output of:

    # efivar --list
  5. What are the outputs of:

    # findmnt /efi
    # findmnt /boot
    # findmnt /boot/efi

    And also:

    # ls -lahF -R /boot /efi
  6. What is the output of:

    # efibootmgr --unicode
  7. Preferably move the extra GRUB install the the fallback path, replace paths as needed. Note that "shimx64.efi" is for getting secure boot to work with GRUB by calling "grubx64.efi" in the same directory, and usually comes with Ubuntu installs.
    Or delete the extra GRUB install from the ESP with `rm`, if it's really unwanted.

    # mv -vi /boot/efi/EFI/ubuntu/* /boot/efi/EFI/BOOT/
    # mv -vi /boot/efi/EFI/BOOT/shimx64.efi /boot/efi/EFI/BOOT/BOOTX64.EFI
    # grub-mkconfig -o /boot/efi/EFI/BOOT/grub.cfg
  8. And finally delete the boot entry from the motherboard BIOS NVRAM, replace UBUNTUGRUB with the hexadecimal boot number for the Ubuntu GRUB NVRAM entry.

    # efibootmgr --bootnum UBUNTUGRUB --delete-bootnum --verbose

Then: Reorder the BIOS boot order with `efibootmgr` or in the BIOS to your liking.
Reorder the GRUB boot options, like remembering the last selected boot entry, by modifying the "/etc/default/grub", "/etc/grub.d/*", and output "grub.cfg" configs to your liking.
And GRUB can even be used to chain-load other boot-loaders like BSD, Mac OS, Windows, systemd-boot, rEFInd, GRUB, etc.

Last edited by Nyctfall (2025-03-30 02:23:57)

Offline

Board footer

Powered by FluxBB