`grub2-mkconfig`: skip a particular device for locating kernel

I updated grub as follows:

$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
File descriptor 3 (pipe:[240340]) leaked on vgs invocation. Parent PID 45665: grub2-probe
File descriptor 9 (pipe:[208755]) leaked on vgs invocation. Parent PID 45665: grub2-probe
File descriptor 3 (pipe:[240340]) leaked on vgs invocation. Parent PID 45665: grub2-probe
File descriptor 9 (pipe:[208755]) leaked on vgs invocation. Parent PID 45665: grub2-probe
File descriptor 3 (pipe:[240340]) leaked on vgs invocation. Parent PID 45718: grub2-probe
File descriptor 9 (pipe:[208755]) leaked on vgs invocation. Parent PID 45718: grub2-probe
File descriptor 3 (pipe:[240340]) leaked on vgs invocation. Parent PID 45718: grub2-probe
File descriptor 9 (pipe:[208755]) leaked on vgs invocation. Parent PID 45718: grub2-probe
Found Ubuntu 22.10 (22.10) on /dev/mapper/vgubuntu-Data
Found Ubuntu 23.04 (23.04) on /dev/mapper/vgubuntu-UbuntuRoot
Adding boot menu entry for UEFI Firmware Settings ...
done
  • It found Ubuntu 22.10 (22.10) on /dev/mapper/vgubuntu-Data, how can I instruct to avoid looking for kernels and operating system in a particular device /dev/mapper/vgubuntu-Data?

I am not aware of an “exclude” flag that you can set for grub2-mkconfig, however, the workaround I am thinking of is the lock the (ubuntu) volumes that don’t want to be scanned before invoking the command.

Honestly, I switched to Systemd-boot recently since my system is UEFI and I won’t go back to Grub2. Systemd-boot is wayyyyyy easier to use/modify and it boots faster.

1 Like