Skip to content

Skip Xen Partitions in Grub OS Prober

Henryk Paluch edited this page Nov 5, 2022 · 3 revisions

Skip XEN paritions in Grub OS prober

I have complex setup where I want to keep GRUB's OS prober (to see other systems), but to skip XEN Guest partitions - in my case there is Volume Group VG called xen_vg.

To skip xen_vg Volume Group from os-prober list I just updated /etc/grub.d/30_os-prober this way

diff -u /root/30_os-prober.old /etc/grub.d/30_os-prober 
--- /root/30_os-prober.old	2021-07-11 00:00:00.000000000 +0200
+++ /etc/grub.d/30_os-prober	2022-11-05 10:09:40.968000000 +0100
@@ -138,6 +138,11 @@
     if [ x"${DEVICE#*@}" != x ] ; then
       EXPUUID="${EXPUUID}@${DEVICE#*@}"
     fi
+    #echo "DEVICE=$DEVICE EXPUUID=$EXPUUID" >&2
+    if echo "$DEVICE" | fgrep -q xen_vg;then
+      echo "Skipped XEN Guest VG ${LONGNAME} on ${DEVICE}" >&2
+      continue
+    fi
 
     if [ "x${GRUB_OS_PROBER_SKIP_LIST}" != "x" ] && [ "x`echo ${GRUB_OS_PROBER_SKIP_LIST} | grep -i -e '\b'${EXPUUID}'\b'`" != "x" ] ; then
       echo "Skipped ${LONGNAME} on ${DEVICE} by user request." >&2

And run update-grub (on Debian flavours of Linux - in my case Debian 11 with XEN support).

NOTE: It seems that os-prober has trouble finding FreeBSD... So you have to add it manually - in my case by adding those lines to /etc/grub.d/40_custom:

Clone this wiki locally