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

Bug #1859090 reported by Richard Yao
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
New
Undecided
Unassigned

Bug Description

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.

Tags: patch zfs
Revision history for this message
Richard Yao (ryao-3) wrote :
affects: os-prober (Ubuntu) → grub2 (Ubuntu)
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "This trivial patch fixes the issue." seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thank you for your report.

This bug has already been reported in bug 1848856 and fixed in the latest development release. There is an SRU in progress to fix it in 19.10.

I'm marking your report as duplicate.

tags: added: zfs
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.