[Bug 2025294] [NEW] /etc/grub/10_linux_zfs has bad zpool command

Ben Stoltz 2025294 at bugs.launchpad.net
Wed Jun 28 20:38:56 UTC 2023


Public bug reported:

$ 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}')

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

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

Title:
  /etc/grub/10_linux_zfs has bad zpool command

Status in grub2 package in Ubuntu:
  New

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}')

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




More information about the foundations-bugs mailing list