RVP <r...@sdf.org> wrote: > On Sat, 5 Jul 2025, beaker wrote: > > > I'm having trouble setting up GRUB2 chainloader booting of a NetBSD system. > > > > Here's my working GRUB config on my home laptop: > > ``` > $ cat /etc/grub.d/40_custom > #!/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 'FreeBSD 14.2' --class freebsd --class bsd --class os > $menuentry_id_option 'freebsd' { > search --efidisk-only --fs-uuid 42F8-14F2 --hint hd0,gpt6 --set root > chainloader /efi/boot/bootx64.efi > } > > menuentry 'NetBSD HEAD' --class netbsd --class bsd --class os > $menuentry_id_option 'netbsd' { > search --efidisk-only --fs-uuid 7AB0-0BFD --hint hd0,gpt9 --set root > chainloader /efi/boot/bootx64.efi > } > > menuentry 'OpenBSD 7.6' --class openbsd --class bsd --class os > $menuentry_id_option 'openbsd' { > search --efidisk-only --fs-uuid C8D7-D5E8 --hint hd0,gpt13 --set root > chainloader /efi/boot/bootx64.efi > } > > menuentry 'rEFInd' --class openbsd --class bsd --class os > $menuentry_id_option 'refind' { > search --efidisk-only --fs-uuid C8D7-D5E8 --hint hd0,gpt13 --set root > chainloader /efi/refind/refind_x64.efi > } > $ > ``` > > The only tricky part is figuring out the `--fs-uuid' value. Use `lsblk -f' on > Linux to get this. (It's _not_ any of the GPT GUIDs.) As you can see, I have > separate EFI ESP partitions for each of the OSes. > > HTH,
Thanks but my system isn't UEFI so I think this won't work but I'll squirrel this away for future reference. I think Elst's comment is right, that there isn't actually a primary NetBSD bootloader present on the referenced partition so one needs to be installed, though I'm unsure how to do this with non-UEFI gpt partitioning; do I use gpt(8) or installboot(8) and where to install it? If I install it to gpt6 (bios) partition is wipes out GRUB (know this from experience...), but if I install it on gpt3 (FFS) is it going to mess up the existing file system? Think I'll need to dig out an old laptop and do some more testing. -B