No bootmenu items generated by grub-mkconfig on ZFS

Bug #2052878 reported by Vladimir S.
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Environment:
# lsb_release -rd
Description: Ubuntu 22.04.3 LTS
Release: 22.04
# apt-cache policy grub2-common
grub2-common:
  Installed: 2.06-2ubuntu7.2
  Candidate: 2.06-2ubuntu7.2
  Version table:
 *** 2.06-2ubuntu7.2 500
        500 http://cz.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     2.06-2ubuntu7 500
        500 http://cz.archive.ubuntu.com/ubuntu jammy/main amd64 Packages

Observed behavior: Got unbootable system after kernel upgrade.

Expected behavior: Booting perfectly booting shiny new linux system. :-)

Symptoms:
Ubuntu 20.04 is installed on ZFS. Datasets on bpool (and rpool) use are being snapshot as part of recovery plan. Package upgrade triggered grub-mkconfig. There is always a lot of warnings. This time the generated grub.cfg contained no items to boot linux. The system was unbootable.

Steps to reproduce (and correction):

Run
# grub-mkconfig

observe stderr message "/etc/grub.d/10_linux_zfs: 905: GRUB_DISTRIBUTOR: parameter not set"

and the output from /etc/grub.d/10_linux_zfs is empty in stdout.

Run
# GRUB_DISTRIBUTOR= GRUB_CMDLINE_LINUX_DEFAULT= GRUB_CMDLINE_LINUX= grub-mkconfig

the output contans linux boot items generated by /etc/grub.d/10_linux_zfs

Comments and suggestions:
It seems that either the required parameters (environnment variables) are not set during apt-upgrade or 10_linux_zfs misbehaves when optional parameters in envvars are missing.
I can't decide.
Anyway, there is an availability problem after upgrade, so I am considering this as a security incident.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: grub2-common 2.06-2ubuntu7.2
ProcVersionSignature: Ubuntu 6.5.0-17.17~22.04.1-generic 6.5.8
Uname: Linux 6.5.0-17-generic x86_64
NonfreeKernelModules: zfs
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Sun Feb 11 08:07:09 2024
InstallationDate: Installed on 2022-11-19 (448 days ago)
InstallationMedia: Ubuntu 22.04.1 LTS "Jammy Jellyfish" - Release amd64 (20220809.1)
SourcePackage: grub2
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Vladimir S. (charchar8) wrote :
Revision history for this message
Julian Andres Klode (juliank) wrote :

GRUB_DISTRIBUTOR and the other variables are set in /etc/default/grub on a normal system, but it seems you have inadvertently broken this file. I suggest having a look at that and fixing it, and reaching out to one of the support forums if you need further assistance.

Changed in grub2 (Ubuntu):
status: New → Invalid
Revision history for this message
Vladimir S. (charchar8) wrote (last edit ):

Well, as this happened to me for the third time since I installed the machine, I'm in doubt I deleted the file intentionally.

I found the file was missing since 2024-02-04T07:34:56Z.

Well, actually, this other bug: https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1879466 seems to be linked with this recent failure of mine because of the root cause was missing /etc/default/grub.

I restored the file from snapshot and will watch its presence closely.

Thanks a lot for your time!

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.