So many Grubs for only 2 distros... What should I do?

I have two hard disks, one HDD (/dev/nvme0n1) and one SSD (/dev/sda).

The first one contains mainly Fedora, and the second one mainly OpenSUSE Tumbleweed. The details are below:

And for good measure, here’s the Boot section of my Bios:


My goal is: one Grub, for everything (Tumbleweed, Fedora, Advanced options for both, Bios, and Tumbleweed snapshots). But here’s what I have instead…


When I do Ctrl+F12 at boot, here are the choices I have:

Let’s go through in order:

  1. If I select opensuse (the first or the gourth one), I get greeted by a nice Grub:
  1. If I select Fedora (the second entry), I get to this Grub:
  • Fedora’s Grub (I apologize for the quality, you all know how hard it is to take a photo of this kind of screen…)

I tried my best to even just change the background from Fedora’s Gub config files, but nothing worked, not even changing the timeout… Which makes me think I might not be seeing the right Grub?

In that one, any of the first 3 Fedora entries will boot properly to Fedora, but the 4th one will launch Bios. And the opensuse entry…

…redirects me to a glitched version of the one from above:

It looks just like the Fedora Grub on top of the Tumbleweed Grub, doesn’t it? Here, none of the entries works (aside from the UEFI ones), they all give me errors in a black window in the middle of my display for a few seconds, and then redirect me to the glitched Grub. After a while, the graphical interface even completly disappears, leaving with a black screen where I can show the options one at a time, using the arrow keys:

Finally, if I choose the 3rd entry from the Boot Manager (Linux Boot Manager) (which I suppose comes from a failed attempts to install systemd-boot), I only get a black screen with one option: “Reboot into firmware’s interface”, that leads me into the Bios.

In fact I’m facing so many different Grubs that here’s a photo of one I don’t even remember how I got to:


So, last few words:

  • I know, I have 2 EFI partitions (one on each disk), and that’s completely stupid. I didn’t know what I was doing when I created the second one (the one on sda), I was confused about how “Grub with EFI” worked… Anyway, that may be part of the problem.

Other problems are:

  • in Tumbleweed, I can make changes to grub2 by editing /boot/grub2/grub.cfg, and they are effective; however, if I try to run the command: sudo grub2-mkconfig -o /boot/grub2/grub.cfg I get the error:

      insmod: ERROR: could not load module part_msdos: No such file or directory
    

So my Grub here kind of works, but kind of doesn’t work either…

I tried adding Fedora by copying the contents of /boot/efi/EFI/fedora/grub.cfg into etc/grub.d/40_custom, or even directly into /boot/grub2/grub.cfg, but though I managed to make a Fedora entry appear in the Grub menu, I never managed to boot from it.

From the other side, I can update Grub in Fedora (by which I mean I see no error, and it says it detects UEFI and Tumbleweed), but no change I make in /.../grub2/themes/Fedora/theme.txt, or in /etc/default/grub, seems to be effective (as I said, I can’t even change the default timeout…).


I posted the contents of my config files in this Gitlab snippet.


So any ideas as to how to build one Grub to rule them all, are welcome! And if you read this thanks for taking the time to read my post to the end!

I can’t deal with so many different screenshots of mousetype in diverse locations, so only two suggestions for now:

1-make every distro installation include a unique value in /etc/default/grub’s GRUB_DISTRIBUTOR=, which results in unique values in /boot/efi/EFI/ for each installation, keeping various distros from overwriting each others’ boot files.

2-depend on custom.cfg instead of grub.cfg as I outlined here.

Please, not all here are willing to go to all sorts of commercial sites to see screen shots.

To begin with, we prefer computer text from the terminal. Best is to copy/paste the prompt/command line, all output and the next prompt line into a post. There select the text and use the “Preformatted text” button </> from the tool bar of the post editor.

If that text becomes to large to be swallowed by the forums software, you can paste it to https://paste.opensuse.org/ (or use the tool susepaste, see the man page).

When you must fall back to a screen schot (or even to a photo of the screen), you can also use https://paste.opensuse.org/ , see the Image button upper right.

Ok, I’ll do that next time, I had no idea this forum had this kind of utilities. However, I wouldn’t qualify Imgur or even less GitLab as “all sorts of commercial sites”. And believe me, I did copy and paste directly from the terminal all I could in my post, it’s just that there isn’t such a thing as “copy and paste Grub entries”.

I looked at this, and initially decided to not reply – because you have such a mess.

But maybe things can at least be improved by deleting some unneeded UEFI boot entries.

Please post the out from the following commands (requires root):

blkid | grep EFI

efibootmgr -v

Thanks a lot for your time. Here you go:

> sudo blkid | grep EFI
/dev/nvme0n1p1: LABEL_FATBOOT="ESP" LABEL="ESP" UUID="BAFC-2878" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="5dff6717-47a9-4681-a12d-2ce66cc67b4b"
>  sudo efibootmgr -v 



BootCurrent: 0008
Timeout: 0 seconds
BootOrder: 0003,0008,0005,2001,2002,2003,0004,0001,0002
Boot0000* Windows Boot Manager  HD(1,GPT,5dff6717-47a9-4681-a12d-2ce66cc67b4b,0x800,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d00000034000100000010000000040000007fff0400
      dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 20 03 00 00 00 00 00 17 67 ff 5d a9 47 81 46 a1 2d 2c e6 6c c6 7b 4b 02 02 / 04 04 46 00 5c 00 45 00 46 00 49 00 5c 00 4d 00 69 00 63 00 72 00 6f 00 73 00 6f 00 66 00 74 00 5c 00 42 00 6f 00 6f 00 74 00 5c 00 62 00 6f 00 6f 00 74 00 6d 00 67 00 66 00 77 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
    data: 57 49 4e 44 4f 57 53 00 01 00 00 00 88 00 00 00 78 00 00 00 42 00 43 00 44 00 4f 00 42 00 4a 00 45 00 43 00 54 00 3d 00 7b 00 39 00 64 00 65 00 61 00 38 00 36 00 32 00 63 00 2d 00 35 00 63 00 64 00 64 00 2d 00 34 00 65 00 37 00 30 00 2d 00 61 00 63 00 63 00 31 00 2d 00 66 00 33 00 32 00 62 00 33 00 34 00 34 00 64 00 34 00 37 00 39 00 35 00 7d 00 00 00 34 00 01 00 00 00 10 00 00 00 04 00 00 00 7f ff 04 00
Boot0001* Fedora        HD(1,GPT,5dff6717-47a9-4681-a12d-2ce66cc67b4b,0x800,0x32000)/File(\EFI\fedora\shim.efi) File(.䍒)
      dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 20 03 00 00 00 00 00 17 67 ff 5d a9 47 81 46 a1 2d 2c e6 6c c6 7b 4b 02 02 / 04 04 2e 00 5c 00 45 00 46 00 49 00 5c 00 66 00 65 00 64 00 6f 00 72 00 61 00 5c 00 73 00 68 00 69 00 6d 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
    data: 52 43
Boot0002* opensuse-secureboot   HD(1,GPT,5dff6717-47a9-4681-a12d-2ce66cc67b4b,0x800,0x32000)/File(\EFI\opensuse\shim.efi)
      dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 20 03 00 00 00 00 00 17 67 ff 5d a9 47 81 46 a1 2d 2c e6 6c c6 7b 4b 02 02 / 04 04 32 00 5c 00 45 00 46 00 49 00 5c 00 6f 00 70 00 65 00 6e 00 73 00 75 00 73 00 65 00 5c 00 73 00 68 00 69 00 6d 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
Boot0003* openSUSE      HD(1,GPT,5dff6717-47a9-4681-a12d-2ce66cc67b4b,0x800,0x32000)/File(\EFI\opensuse\grubx64.efi)RC
      dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 20 03 00 00 00 00 00 17 67 ff 5d a9 47 81 46 a1 2d 2c e6 6c c6 7b 4b 02 02 / 04 04 38 00 5c 00 45 00 46 00 49 00 5c 00 6f 00 70 00 65 00 6e 00 73 00 75 00 73 00 65 00 5c 00 67 00 72 00 75 00 62 00 78 00 36 00 34 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
    data: 52 43
Boot0004* openSUSE      HD(2,MBR,0xb20d2b86,0x1c596000,0x77000)/File(\EFI\opensuse\grubx64.efi)RC
      dp: 04 01 2a 00 02 00 00 00 00 60 59 1c 00 00 00 00 00 70 07 00 00 00 00 00 86 2b 0d b2 00 00 00 00 00 00 00 00 00 00 00 00 01 01 / 04 04 38 00 5c 00 45 00 46 00 49 00 5c 00 6f 00 70 00 65 00 6e 00 73 00 75 00 73 00 65 00 5c 00 67 00 72 00 75 00 62 00 78 00 36 00 34 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
    data: 52 43
Boot0005* Linux Boot Manager    HD(1,GPT,5dff6717-47a9-4681-a12d-2ce66cc67b4b,0x800,0x32000)/File(\EFI\systemd\systemd-bootx64.efi)
      dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 20 03 00 00 00 00 00 17 67 ff 5d a9 47 81 46 a1 2d 2c e6 6c c6 7b 4b 02 02 / 04 04 46 00 5c 00 45 00 46 00 49 00 5c 00 73 00 79 00 73 00 74 00 65 00 6d 00 64 00 5c 00 73 00 79 00 73 00 74 00 65 00 6d 00 64 00 2d 00 62 00 6f 00 6f 00 74 00 78 00 36 00 34 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
Boot0008* Fedora        HD(1,GPT,5dff6717-47a9-4681-a12d-2ce66cc67b4b,0x800,0x32000)/File(\EFI\fedora\shimx64.efi)
      dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 20 03 00 00 00 00 00 17 67 ff 5d a9 47 81 46 a1 2d 2c e6 6c c6 7b 4b 02 02 / 04 04 34 00 5c 00 45 00 46 00 49 00 5c 00 66 00 65 00 64 00 6f 00 72 00 61 00 5c 00 73 00 68 00 69 00 6d 00 78 00 36 00 34 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
Boot000A* debian        HD(1,GPT,5dff6717-47a9-4681-a12d-2ce66cc67b4b,0x800,0x32000)/File(\EFI\debian\shimx64.efi)
      dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 20 03 00 00 00 00 00 17 67 ff 5d a9 47 81 46 a1 2d 2c e6 6c c6 7b 4b 02 02 / 04 04 34 00 5c 00 45 00 46 00 49 00 5c 00 64 00 65 00 62 00 69 00 61 00 6e 00 5c 00 73 00 68 00 69 00 6d 00 78 00 36 00 34 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
Boot2001* EFI USB Device        RC
      dp: 7f ff 04 00
    data: 52 43
Boot2002* EFI DVD/CDROM RC
      dp: 7f ff 04 00
    data: 52 43
Boot2003* EFI Network   RC
      dp: 7f ff 04 00
    data: 52 43

I ran these two commands from Fedora (1rst hard disk, nvme…)

Everyone, my suspitioon is that since eveything breaks whenever I try to repair my Tumbleweed Grub (that, like I said in my post, returns an error when I try to regenerate a config file), and since I can change whatever in Fedora’s Grub and nothing changes, maybe… We could look for the Grub that’s actually linked to the config files I can edit in Fedora, and work on that one? I have no idea, just truing to help

Thanks. Unfortunately I didn’t understand online what you could precisely mean by

make every distro installation include a unique value in /etc/default/grub’s GRUB_DISTRIBUTOR=

Also, I tried to replicate as best as I could your 06_custom executable from your link, but even though I made it executable as root it did nothing to my config when I re-generated it. And… if you (or anyone) could double-check on that it would be very helpful

In each file /etc/default/grub, directly after GRUB_DISTRIBUTOR=, append something unique to that installation, e.g. “bookworm”, “fedora38” or “ostw2sda”, with the quotes, and no whitespace. Whatever is in the quotes becomes the applicable directory name in /boot/efi/EFI/, so the characters you use must be legal on FAT filesystems.

The custom stanza(s) you create don’t get put directly into /boot/grub2/grub2.cfg. Instead, Grub incorporates them in its menu at boot time.

Let’s look at those entries.

You say that you are not using systemd-boot. So you can remove the entry for that. As root:

efibootmgr -b0005 -B

and it might also be a good idea to remove all files in the directory “/boot/efi/EFI/systemd”.

Next, let’s look at Tumbleweed. Boot into Tumbleweed, and provide the output from:

df /boot/efi
grep LOADER_TYPE /etc/sysconfig/bootloader

Those commands do not require root.

1 Like
> sudo df /boot/efi 
Filesystem     1K-blocks  Used Available Use% Mounted on
/dev/nvme0n1p1     98304 47592     50712  49% /boot/efi

 > sudo grep LOADER_TYPE /etc/sysconfig/bootloader
LOADER_TYPE="grub2-efi"

I’m commenting for everyone about my progess in another comment, please check it out also!

Ok everyone, thanks for your help. One sleepless night fixed many things…

Here’s the situation now. I only have one EFI partition left (on nvme[…]). My Tumbleweed boot is still ok. So I decided I’d work on this one to create the Grub entry I need for the other one. Here’s what I added to /boot/grub2/grub.cfg:

menuentry 'Fedora' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-8a9a8f64-1ce9-45d2-b9dc-ba4cd756134e' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_gpt
    insmod fat
    set root='hd1,gpt2'
    search --no-floppy --fs-uuid --set=root e130ac5a-55fb-4620-a63b-41184c9c680f
    linux    /vmlinuz-6.5.7-200.fc38.x86_64 root=UUID=e130ac5a-55fb-4620-a63b-41184c9c680f resume=/dev/disk/by-uuid/81a52966-11cf-4204-8e0b-4568796b2e5b quiet
    echo 'Loading Linux ...'
    initrd   /initramfs-6.5.7-200.fc38.x86_64.img
    echo 'Loading initial ramdisk ...'
}

Here’s the relevant part of sudo blkid:

/dev/nvme0n1p1: LABEL_FATBOOT="ESP" LABEL="ESP" UUID="BAFC-2878" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="5dff6717-47a9-4681-a12d-2ce66cc67b4b"

/dev/nvme0n1p2: UUID="e130ac5a-55fb-4620-a63b-41184c9c680f" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="e317be0c-9d57-4652-8b1d-012695fedc14"

/dev/nvme0n1p3: UUID="81a52966-11cf-4204-8e0b-4568796b2e5b" TYPE="swap" PARTLABEL="swap" PARTUUID="85d0f9d4-ee34-49f7-899d-59aea5b8002e"

/dev/nvme0n1p4: LABEL="fedora_localhost-live" UUID="8a9a8f64-1ce9-45d2-b9dc-ba4cd756134e" UUID_SUB="5fe247b5-98e2-43f2-af8e-de9f1624016f" BLOCK_SIZE="4096" TYPE="btrfs" PARTUUID="e2a9ada3-4e91-4441-b7d2-8a49048b1573"

The mount tree of a correctly booted Fedora is:

  • /dev/nvme0n1p1 mounted on /boot/efi
  • /dev/nvme0n1p2 mounted on /boot
  • /dev/nvme0n1p4 mounted on /
  • and swapon /dev/nvme0n1p3.

Can any Grub-expert tell me if my entry is right? Unfortunately I think it’s not, because when I try to boot from it:

  1. I get an error about zfs.mod not being found, but…
  2. …after a few seconds it starts to boot. However, at the initrd or switch-root stage, I get this error:

Failed to switch root: Specified switch root path '/sysroot' does not seem to be an OS tree. os-release file is missing.

I tried a few solutions I found online, that explained how to mount this /sysroot anyway, but the error didn’t go away and I couldn’t boot.

So please, if you know Grub entries, help!

And, while we’re at it… sudo grub2-mkconfig -o /boot/grub2/grub.cfg has never, as far as I can remember, worked on my Tumbleweed: I always get errors about missing something.mod files. If someone comments about that I’ll give him the full details.

Thanks!

That output looks okay. Apparently you are not using the EFI partition from “/dev/sda”. So you can delete the “Boot0004” entry:
As root:

efibootmgr -b 0004 -B

Either of “Boot0002” or “Boot0003” should work.

When you are next running Tumbleweed, maybe try (as root):

update-bootloader --reinit

That should reinstall grub, and maybe fix the problems you are having with “grub2-mkconfig”.

Maybe simplifying would help, like I have here among others in custom.cfg:

# inxi -S
System:
  Host: ab250 Kernel: 6.5.3-300.fc39.x86_64 arch: x86_64 bits: 64
    Console: pty pts/1 Distro: Fedora release 39 (Thirty Nine)
# lsblk -f | grep f3
├─nvme0n1p15 ext4   1.0   pt3p15f39   61cb9334-dda5-4732-9eb2-918ca6eea708    3.5G    50% /
├─nvme0n1p18 ext4   1.0   pt3p18f38   5cea3708-c91b-4679-8797-29a23804d0cd    2.9G    58% /disks/f38

From TW’s /boot/grub2/custom.cfg:

menuentry "Fedora 39 defkernel 5 on P15" {
	load_video
	set gfxpayload=keep
	search --no-floppy --set=root --hint-efi=ahci0,gpt15 --label pt3p15f39
	linux	/boot/vmlinuz root=LABEL=pt3p15f39 noresume audit=0 ipv6.disable=1 net.ifnames=0 consoleblank=0 preempt=full mitigations=off
	initrd	/boot/initrd
}
menuentry "Fedora 38 defkernel 5 on P18" {
	load_video
	set gfxpayload=keep
	search --no-floppy --set=root --hint-baremetal=hd0,gpt18 --label pt3p18f38
	linux	/boot/vmlinuz root=LABEL=pt3p18f38 noresume audit=0 ipv6.disable=1 net.ifnames=0 consoleblank=0 preempt=full mitigations=off 
	initrd	/boot/initrd
}

Thanks, that looks promising, but I would like to understand a little better what you changed before starting copying it blindly into my config…

First off, I don’t have labels like yours when I run lsblk -f, and the full command lsblk -f | grep f3 returns nothing. Here’s the result of sudo lsblk -f:

NAME        FSTYPE FSVER LABEL                 UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                                                
├─sda1      btrfs        Tumbleweed            37b1ace3-0889-4b40-9b0a-a2fe5da56d0a   70,1G    68% /.snapshots
│                                                                                                  /opt
│                                                                                                  /srv
│                                                                                                  /usr/local
│                                                                                                  /root
│                                                                                                  /home
│                                                                                                  /var
│                                                                                                  /boot/grub2/x86_64-efi
│                                                                                                  /boot/grub2/i386-pc
│                                                                                                  /snap
│                                                                                                  /
└─sda3      swap   1                           2b54516c-b818-4bfb-8305-28b0a17182d9                [SWAP]
sdb                                                                                                
├─sdb1      vfat   FAT32 FAT_LANOIRE           ADD8-94EA                                           
└─sdb2      vfat   FAT32 ESP                   BAFC-2878                                           
nvme0n1                                                                                            
├─nvme0n1p1 vfat   FAT32 ESP                   BAFC-2878                              49,5M    48% /boot/efi
├─nvme0n1p2 ext4   1.0                         e130ac5a-55fb-4620-a63b-41184c9c680f                
├─nvme0n1p3 swap   1                           81a52966-11cf-4204-8e0b-4568796b2e5b                
└─nvme0n1p4 btrfs        fedora_localhost-live 8a9a8f64-1ce9-45d2-b9dc-ba4cd756134e                

So as far as I can tell, the syntax you provided won’t work (and I tried it nonetheless with fedora_localhost-live as label and it got stuck at the same point as usual.

Then, I can’t see how your proposition could work since I face separate /boot and /root partitions; your entry only mentions the /root one, but then I will be missing kernels and such…

And finally, what’s the reliable way to get partition names in the form ahci0,gpt15 (for you) or (hd1, gpt4) (for me), that will work no matter how many external drives are plugged in? The only one I know is to ls in the Grub console but surely there’s a better way?

Thanks for you time, I’m looking forward for your answer.

There’s no automatic way to generate filesystem labels that I’m aware of. The admin has to determine what is appropriately unique and then apply. e.g. in my first stanza, pt3p15f39, pt3 is cut from the device’s serial number, p15 is the partition number, and f39 should be obvious. You might find simply fedora38 or root38 to be suitable for your needs.

Application of labels can be done using an option during formatting, or applied later via a tool, e.g. e2label or tune2fs -L on EXTx filesystems. As I never use btrfs and don’t have its support installed, I can only suppose you’d need btrfs filesystem label to add to an existing filesystem.

The linux and initrd lines must point to the appropriate files, so when using a separate /boot/ filesystem, instead of root filesystem labels you’d need boot filesystem labels for them and hinting.

I’ll just add to what was said by @mrmazda .

I don’t have labels on most partitions. But I do have them on boot partitions. That allows me to use search for labels in “grub.cfg” (actually in “/etc/grub.d/40_custom”. And I have to manually add the labels.

I do it that way, because if I do a re-install with existing partitions, then openSUSE preserves the labels but changes the UUID. So with a reinstall, it is easier to restore the same boot configuration if I am using labels.

To create a label, I use “e2label” for “ext2” and “ext4” file systems, and I use “btrfs filesystem label” with “btrfs” filesystems.

Those are not reliable, as best I can tell. That’s why search for label works better.

One important thing to understand when you want to unravel the confusion in the first place, is understanding the difference between a partition and a file system.

A file system is an organized heap of files, It is the data you are interested in. And a file system must be somewhere. And “somewhere” can be several things. For ease I will use the word “container” here (the word “volume” is also used) E.g. a mass-storage device (disk, SDD, memory stick, you name it), or a partition of such a device (and that seems to be your subject today), or a Logical Volume, or a part of memory (tmpfs), or …

Now when you want to address a file system, one of the ways you can do this is by addressing the container. And when the file system is on a partition, you can use the indication of the partition. For this foremost the device names given by the system (udev nowadays) come to mind, Like /dev/sdb2 or /dev/nvme0n1p1 . But always be aware of the fact that they point to a container/volume, not to the file system direct. What you say is : “I mean the file system that sits in …”.
Because those partition names (linked to the device names) can differ on different boots, you can use one of the alternatives that are also connected to the hardware:

  • id: a string that the manufacturer has build in the device and that can be read from it’s firmware.
  • path: is string of identifications given to the several hardware connections/busses through which the device is connected.

In a GPT partitioned device, every partition is/can also be identified by

  • partuuid: a UUID created automaticaly.
  • partlabel: a label that one can set for the partition with the partition tool.

And these are inside the partition table!

Another thing is that you can identify a file system direct (when the file system type supports this):

  • uuid: a UUID created at file system creation (can be changed with the corresponding tools).
  • label: a Volume Label that can be defined either on file system creation (and yes, YaST offer this) or created/changed later by the file system tools.

And remember that these two are inside the file system!

Whenever these identifiers are available, udev creates symbolic links for them in the appropriate directories in /dev/disk/

henk@boven:/dev/disk> ls -l
total 0
drwxr-xr-x  2 root root  780 Oct 24 15:03 by-id/
drwxr-xr-x  2 root root  100 Oct 24 08:39 by-label/
drwxr-xr-x  2 root root   60 Oct 24 08:39 by-partlabel/
drwxr-xr-x  2 root root  120 Oct 24 08:39 by-partuuid/
drwxr-xr-x  2 root root  400 Oct 24 15:03 by-path/
drwxr-xr-x  2 root root  120 Oct 24 08:39 by-uuid/
henk@boven:/dev/disk>

Look inside them to see what is found for the containers and file systems you have on your system.

Now, what to use in what circumstances is the big question which so many possibilities. And you must decide yourself on your policy. Of course you can look at the example of what is used in your own system on installation. Look e.g. in /etc/fstab or at the resume= kernel parameter in your Grub configuration.

And of course when you understand this you will understand (and take care of those situations) that when you make a byte for byte copy of a file system (e.g. using dd), you will copy the uuid and the label also and then you will have two file systems with the same uuid (not very unique anymore) and label on one and the same system. Go figure.
The same is true when you copy a whole device with a GPT. All the partuuid’s and partlabels will also be copied!

I used the same approach for several years. However I reverted entirely to each system using its own boot manager: Grub disordering in Leap 15.6 keeps recurring? - #54 by karlmistelberger

The basic idea is minimizing the interactions between installed systems and creating short and clear boot menus:

  1. Tumbleweed
  2. Advanced options for Tumbleweed
  3. UEFI Firmware Settings
  4. Start bootloader from a read-only snapshot

I am confronting my ideas with reality on a regular schedule.

Erm, I tried to assign a distinct label for each partition with the tools you suggested (e2label for nv[…]2 and btrfs filesystem label, and the label changed all right, but Grub tells me it doesn’t find it… More specifically:
blkid |grep nvme0n1p4 gives:

/dev/nvme0n1p4: LABEL="fedoratome" UUID="8a9a8f64-1ce9-45d2-b9dc-ba4cd756134e" UUID_SUB="5fe247b5-98e2-43f2-af8e-de9f1624016f" BLOCK_SIZE="4096" TYPE="btrfs" PARTUUID="e2a9ada3-4e91-4441-b7d2-8a49048b1573"

…and I put this in grub.cfg:

menuentry "Fedora 38" {
        load_video
        set gfxpayload=keep
        search --no-floppy --set=root --label fedoratome
        linux   /boot/vmlinuz root=LABEL=fedoraboot noresume audit=0 ipv6.disable=1 net.ifnames=0 consoleblank=0 preempt=full mitigations=off 
        initrd  /boot/initrd
}

I also tried using --uuid and --partuuid with the appropriate values, and I still got Grub not understanding which partition I’m talking about…