Public bug reported:

If you manually modify a Ubuntu 19.10 on ZFS install to do mirroring,
running update-grub will generate a /boot/grub/grub.cfg missing the file
paths for the vmlinuz and initrd.img files, which creates an unbootable
system. update-grub will report "Syntax errors are detected in generated
GRUB config file.".

The problem occurs because of a single line
`initrd_device=$(${grub_probe} --target=device "${boot_dir}")` in
`get_dataset_info()` in `/etc/grub.d/10_linux_zfs`. The code is designed
to expect a single device, but a mirrored pool will give two. This
inserts boht devices separated by a line break, which messes up the
script.

Changing the line in question to `initrd_device=$(${grub_probe}
--target=device "${boot_dir}" | head -1)` will workaround the problem.
Looking at what is being done, I think this change could go into
production without any ill effect. I have attached a patch with the
change.

As for the other information requested by the bug reporting guidelines:

1) $ lsb_release -rd
Description:    Ubuntu 19.10
Release:        19.10

2) $ apt-cache policy grub-common
grub-common:
  Installed: 2.04-1ubuntu12.1
  Candidate: 2.04-1ubuntu12.1
  Version table:
 *** 2.04-1ubuntu12.1 500
        500 http://us.archive.ubuntu.com/ubuntu eoan-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     2.04-1ubuntu12 500
        500 http://us.archive.ubuntu.com/ubuntu eoan/main amd64 Packages

3) The system should have been fine with a mirrored boot pool.

4) A bug broke the boot process. A patch fixing it is attached.

** Affects: grub2 (Ubuntu)
     Importance: Undecided
         Status: New

** Patch added: "This trivial patch fixes the issue."
   
https://bugs.launchpad.net/bugs/1859090/+attachment/5318931/+files/10_linux_zfs-mirror-bpool-support.patch

** Package changed: os-prober (Ubuntu) => grub2 (Ubuntu)

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

Title:
  [zfs-root] Trivial bug in 10_linux_zfs breaks booting from ZFS
  mirrored boot pools

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

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

Reply via email to