I ran into this issue too after setting up dual boot with FreeBSD on my
system. An unattended upgrade wiped out my grub menu since it mistook
the "etc" dataset in the FreeBSD zfs pool as a signal that it contained
an Ubuntu install.

The hack described by Benjamin worked for me, although it definitely
doesn't seem like a very sound solution.

```
ubuntu@ubuntu:~$ diff -u /etc/grub.d/10_linux_zfs /mnt/etc/grub.d/10_linux_zfs
--- /etc/grub.d/10_linux_zfs    2020-09-08 10:24:35.000000000 +0000
+++ /mnt/etc/grub.d/10_linux_zfs        2020-10-13 00:10:59.644606544 +0000
@@ -383,7 +384,8 @@
     # read machine-id/os-release from /etc
     etc_dir=$(get_system_directory "${dataset}" "etc" "true" "${mntdir}" "")
-    if [ -z  "${etc_dir}" ]; then
+    # KWA: Temporary hack from 
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1850003
+    if [ -z  "${etc_dir}" ] || [ ! -f "${etc_dir}/os-release" ]; then
         grub_warn "Ignoring ${dataset}"
         mountpoint -q "${mntdir}/etc" && umount "${mntdir}/etc" || true
         umount "${mntdir}"
```

Rather than inspecting the contents of the dataset, it might be better
to just set a property on the dataset tagging it as part of an Ubuntu
install. I'm not sure at the moment whether it's possible to just set
arbitrary custom properties on a dataset.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1850003

Title:
  /etc/grub.d/10_linux_zfs doesn't skip non-linux zpools

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1850003/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to