From Newsgroup: alt.os.linux
On 2026-Sep-25 8:39 AM, J.O. Aho wrote:
On 24/09/2026 22.49, bad sector wrote:
At best it's a tool made for developers (tail wagging the dog) and
doesn't even resemble a user-oriented boot loader. If all I want in my
menu for (currently) 6 onboard OSes is the partition number and the
distro name ending with a UEFI boot
11 Artix
12 Devuan
13 Slackware
14 Tumbleweed
15 Debian
16 Leap
UEFI
then the only way to do that is with a /etc/grub.d/40_Custom file but
those directives need to be hand-edited after every update in any of
the systems.
Let each distribution to handle their own grub.cfg as they see it fit,
just don't install the grub loader on disk.
You then have one master grub stored in mbr/gpt/efi, which has only your custom configuration, it points to the grub in the partition, for example:
-a-a-a menuentry '11 Artix' {
-a-a-a-a-a-a insmod chain
-a-a-a-a-a-a set root=(hd0,11)
-a-a-a-a-a-a configfile /boot/grub/grub.cfg
-a-a-a }
This makes you to have to edit the master grub install only each time
you install a new distro. Each time a distro updates kernels it will
update it's own grub configuration.
I'll keep this for future reference, for now 'Claude' has helped out
with the TS:
... the usable 40_custom file
#!/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 "11 Artix (rolling)" {
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root 97e..
linux /boot/vmlinuz-linux root=UUID=97e.. rw
initrd /boot/amd-ucode.img /boot/initramfs-linux.img
}
menuentry "12 Devuan 6.1.2 Excalibur" {
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root 37f..
linux /vmlinuz root=UUID=37f.. ro
initrd /initrd.img
}
menuentry "13 Slackware 15.0" {
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root ea9..
linux /boot/vmlinuz-6.12.30 root=UUID=ea9.. ro
initrd /boot/initrd.gz
}
menuentry "14 Tumbleweed (rolling)" {
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root 700..
linux /boot/vmlinuz root=UUID=700.. ro
initrd /boot/initrd
}
menuentry "15 Debian 13.7" {
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root d45..
linux /vmlinuz root=UUID=d45.. ro
initrd /initrd.img
}
menuentry "16 Leap 16.0" {
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root 147..
linux /boot/vmlinuz root=UUID=147.. ro
initrd /boot/initrd
}
...PLUS
GRUB_DISABLE_RECOVERY="true"
GRUB_DISABLE_SUBMENU="true"
GRUB_DISABLE_OS_PROBER="true"
...PLUS
sudo chmod -x /etc/grub.d/10_linux
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
On my x870e board invoking UEFI bios is a 500% PITA, the only way to
reliably get to it is unplugging the drive tray and booting that way,
leaving the systyem nothig but bios to launch. Admittedly the inclusion
of the UEFI menu makes it much easier and keeping THAT extra entry is a
winner for me.
....Heads-UP:
GRUB MULTI-BOOT MENUENTRY FAILS WITH "file '/vmlinuz' not found" DESPITE CORRECT UUIDs =========================================================================
SYMPTOM
-------
A hand-written GRUB 40_custom menu entry for a non-Debian-family Linux installation fails to boot with:
error: file '/vmlinuz' not found.
error: you need to load the kernel first.
This happens even when:
- search --no-floppy --fs-uuid --set=root <uuid> uses the correct,
verified filesystem UUID (confirmed with blkid / lsblk -f)
- the correct insmod modules for the partition table and filesystem
are loaded
- the target filesystem is a normal, healthy ext4 partition
- grub2-mkconfig / update-grub has been re-run after editing 40_custom
Meanwhile, Debian and Devuan entries using the identical style of
menuentry, generated the same way, boot without any problem.
ROOT CAUSE
----------
search --fs-uuid --set=root only locates the partition and sets $root.
It does NOT check whether the kernel/initrd files named in the linux
and initrd lines actually exist. That lookup happens separately, at
boot time, when GRUB tries to load those exact paths.
Debian and Devuan are unusual among mainstream distributions: their
packaging creates a generic symlink at the filesystem root, e.g.
/vmlinuz -> boot/vmlinuz-<version>
/initrd.img -> boot/initrd.img-<version>
This convention exists specifically so external bootloaders (or
manually written stanzas) can reference a short, version-independent
path.
Arch-based distributions (Artix), Slackware, and openSUSE (Tumbleweed,
Leap) do NOT create this root-level alias. Their kernels and initrds
exist only under /boot/:
/boot/vmlinuz-linux
/boot/vmlinuz-6.12.30
/boot/vmlinuz -> vmlinuz-<version>
(openSUSE, Slackware: relative symlink, but still under /boot)
A 40_custom entry written by copying the Debian-style pattern
(linux /vmlinuz ..., initrd /initrd.img ...) will therefore search the
correct partition, succeed, and then fail immediately afterward,
because no file named /vmlinuz exists at that partition's root - only
under /boot/.
THE FIX is simply prefixing the kernel/initrd paths with /boot/ (or
using the real versioned filename directly), matching whatever that
specific distribution's own filesystem layout actually is. No UUID,
search, module, or grub2-mkconfig/update-bootloader fix was required -
those were all red herrings that had to be independently ruled out
first.
WHY THIS IS EASY TO MISDIAGNOSE
--------------------------------
Several plausible-looking causes have to be excluded before the real
one is visible, and all of them feel like the right area to
investigate:
1. UUID mismatch - a natural first suspect, especially if the file
was edited or partitions were reformatted at any point. Worth
checking, but in this case the UUIDs were already correct.
2. Missing filesystem driver module (insmod ext4/btrfs/etc.) -
genuinely can cause search to fail outright, but produces a
different error (no such device), not a file-not-found on the
kernel line.
3. ext4 on-disk feature flags (metadata_csum, 64bit, etc.) - a
reasonable hypothesis when comparing distros with different
e2fsprogs versions, but a dead end here since the flags didn't
correlate with which entries failed.
4. Wrong bootloader "owns" the boot process in a multi-distro EFI
setup - worth ruling out with efibootmgr -v any time several OSes
are installed, but in this case a single GRUB (openSUSE's) was
confirmed as the sole, master bootloader for all six systems.
5. The SUSE-specific note that "update-bootloader --refresh" should
be used instead of "grub2-mkconfig" - this is true only when SUSE's
own installation owns /boot/grub2; in a shared multi-boot setup
where one distro's GRUB serves everyone, running
"grub2-mkconfig -o /boot/grub2/grub.cfg" directly is the reliable,
explicit choice, and using it side-stepped any ambiguity about
what the wrapper script does internally.
Only after all of the above were eliminated did directly listing each partition's actual /boot contents (ls -la /boot/vmlinuz* /boot/initrd*)
reveal the real, simple mismatch.
DOCUMENTATION / TOOLING GAPS THIS EXPOSES ------------------------------------------
- GRUB's own error message is misleading in context. "file
'/vmlinuz' not found" is accurate but gives no hint that the issue
is a path convention difference between distributions, not a
missing or corrupt file. Nothing in the message or in GRUB's
manual flags this distro-to-distro inconsistency.
- The Debian-family root-level /vmlinuz symlink convention is not
something other distributions replicate or warn about, and it is
easy to internalize it as "how GRUB entries work" if Debian/Devuan
is the first or main system someone writes manual entries for.
- No mainstream distribution's documentation cross-references this
explicitly (i.e. "if writing manual GRUB entries for distro X,
don't assume the Debian-style root-level vmlinuz/initrd paths").
It is scattered, implicit knowledge rather than documented
anywhere central.
- Generic multi-boot / custom GRUB entry tutorials online
overwhelmingly use Debian/Ubuntu-derived examples, which quietly
reinforces the bare /vmlinuz pattern as if it were universal.
Two separate skill levels are involved:
DIAGNOSING IT (the process this whole exchange walked through -
systematically ruling out UUIDs, modules, filesystem flags, EFI
bootloader ownership, and only then inspecting each partition's real
/boot contents) is beyond what a typical desktop Linux user would be
expected to do unassisted. It requires comfort with lsblk, tune2fs,
efibootmgr, manual mounting of foreign partitions read-only, and
interpreting GRUB's rescue-mode command line - this is
intermediate-to-advanced sysadmin territory, not something covered in
beginner distro documentation.
APPLYING THE FIX once known is straightforward and within reach of any
user already comfortable manually editing /etc/grub.d/40_custom in the
first place: it is a one-line-per-entry change (adding a /boot/ prefix
or the correct versioned filename) followed by a standard grub2-mkconfig/update-grub regeneration.
In short: writing custom multi-distro GRUB entries at all already puts
someone outside "average user" territory (most distros generate
correct boot entries automatically via os-prober or their own
installer without any manual intervention). For anyone already doing
this manually across several distributions on shared hardware, this
particular pitfall - silently mixing Debian-style bare /vmlinuz paths
into entries for non-Debian systems - is common enough, and the fix
simple enough, that it's worth checking first, before working through
the fuller diagnostic chain above.
--- Synchronet 3.22a-Linux NewsLink 1.2