/etc/grub/10_linux_zfs has bad zpool command

Bug #2025294 reported by Ben Stoltz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zfs-fuse (Ubuntu)
New
Undecided
Unassigned

Bug Description

$ lsb_release -rd
No LSB modules are available.
Description: Ubuntu 23.04
Release: 23.04

$ apt-cache policy grub-common
grub-common:
  Installed: 2.06-2ubuntu16
  Candidate: 2.06-2ubuntu16
  Version table:
 *** 2.06-2ubuntu16 500
        500 http://us.archive.ubuntu.com/ubuntu lunar/main amd64 Packages
        100 /var/lib/dpkg/status

The zpool command does not have a -H flag (at least in Ubuntu 23.04).
This results in an error from the /etc/grub.d/10_linux_zfs script during update-grub.

The fix is to remove the -H flag and adjust the awk script to ignore the headline line (see diff).

$ sudo update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.2.0-24-generic
Found initrd image: /boot/initrd.img-6.2.0-24-generic
bad property list: invalid property '-H'
usage:
 get <"all" | property[,...]> <pool> ...

the following properties are supported:

 PROPERTY EDIT VALUES

 allocated NO <size>
 capacity NO <size>
 dedupratio NO <1.00x or higher if deduped>
 free NO <size>
 guid NO <guid>
 health NO <state>
 size NO <size>
 altroot YES <path>
 ashift YES <ashift, 9-13, or 0=default>
 autoexpand YES on | off
 autoreplace YES on | off
 bootfs YES <filesystem>
 cachefile YES <file> | none
 dedupditto YES <threshold (min 100)>
 delegation YES on | off
 failmode YES wait | continue | panic
 listsnapshots YES on | off
 version YES <version>
Found memtest86+ 64bit EFI image: /memtest86+x64.efi
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done

Diffing the original against a patched (working) version:

$ diff 10_linux_zfs /etc/grub.d/10_linux_zfs
102c102,103
< local rel_pool_root=$(zpool get -H altroot ${p} | awk '{print $3}')
---
> # local rel_pool_root=$(zpool get -H altroot ${p} | awk '{print $3}')
> local rel_pool_root=$(zpool get altroot ${p} | awk 'NR > 1 {print $3}')

Revision history for this message
Julian Andres Klode (juliank) wrote :

Removing wrongly subscribed ubuntu-sponsors as there is no debdiff to sponsor here, not that we'd be interested in debdiffs for grub. Right now, I'm not interested in taking any patches as I'm busy preparing the 2.12~rc1 rebase which creates a lot of complexities.

Revision history for this message
Julian Andres Klode (juliank) wrote :

The -H command does exist in zfsutils-linux version of zpool

$ zpool get -H
missing property argument
usage:
        get [-Hp] [-o "all" | field[,...]] <"all" | property[,...]> <pool> ...

It seems you have accidentally installed zfs-fuse from universe instead, which probably should be removed from the archive.

affects: grub2 (Ubuntu) → zfs-fuse (Ubuntu)
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.