grub2 needs to properly manage kernel device name changes (nvme-eui -> nvme-nvme)

Bug #2039108 reported by theofficialgman
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Triaged
Undecided
Unassigned

Bug Description

failed to install on upgrade on mantic

ProblemType: Package
DistroRelease: Ubuntu 23.10
Package: shim-signed 1.56+15.7-0ubuntu1
ProcVersionSignature: Ubuntu 6.5.0-7.7-generic 6.5.3
Uname: Linux 6.5.0-7-generic x86_64
.proc.sys.kernel.moksbstate_disabled: Error: [Errno 2] No such file or directory: '/proc/sys/kernel/moksbstate_disabled'
ApportVersion: 2.27.0-0ubuntu5
Architecture: amd64
BootEFIContents:
 BOOTX64.CSV
 grub.cfg
 grubx64.efi
 mmx64.efi
 shimx64.efi
CasperMD5CheckResult: unknown
Date: Wed Oct 11 17:41:29 2023
ErrorMessage: installed shim-signed package post-installation script subprocess returned error exit status 32
InstallationDate: Installed on 2021-06-21 (842 days ago)
InstallationMedia: Ubuntu 20.04.2.0 LTS "Focal Fossa" - Release amd64 (20210209.1)
Python3Details: /usr/bin/python3.11, Python 3.11.6, python3-minimal, 3.11.4-5
PythonDetails: /usr/bin/python3.11, Python 3.11.6, python-is-python3, 3.11.4-1
RelatedPackageVersions:
 dpkg 1.22.0ubuntu1
 apt 2.7.3
SecureBoot: 6 0 0 0 1
SourcePackage: shim-signed
Title: package shim-signed 1.56+15.7-0ubuntu1 failed to install/upgrade: installed shim-signed package post-installation script subprocess returned error exit status 32
UpgradeStatus: Upgraded to mantic on 2023-08-10 (62 days ago)

Revision history for this message
theofficialgman (theofficialgman) wrote :
Revision history for this message
Steve Langasek (vorlon) wrote :

> Setting up shim-signed (1.56+15.7-0ubuntu1) ...
> mount: /var/lib/grub/esp: special device /dev/disk/by-id/nvme-eui.0025384361b46f51-part1 does not exist.
> dmesg(1) may have more information after failed mount system call.
> dpkg: error processing package shim-signed (--configure):
> installed shim-signed package post-installation script subprocess returned error exit status 32

Your df output shows that you do have an EFI system partition mounted at /boot/efi. Please show the output of ls /dev/disk/by-id on this system.

Changed in shim-signed (Ubuntu):
status: New → Incomplete
Revision history for this message
theofficialgman (theofficialgman) wrote :

This update was run from KDE software center (so no terminal) and that's where it failed.

When run from a terminal afterwards I was prompted with a terminal dialog prompt to regenerate grub due to (apparently) the id of the system drive changing.

Revision history for this message
Steve Langasek (vorlon) wrote :

Please show the output of ls /dev/disk/by-id on this system.

Revision history for this message
theofficialgman (theofficialgman) wrote :

Note that before your first response I already updated successfully via terminal with `sudo apt install --fix-broken` as I wrote in the previous post. So I have updated and rebooted since then and am not sure if this helps now at this point.

sudo ls /boot/efi
 EFI 'System Volume Information'

ls /dev/disk/by-id
nvme-nvme.144d-533243544e584148333035393838-53414d53554e47204d5a564c5635313248434a482d3030304831-00000001
nvme-nvme.144d-533243544e584148333035393838-53414d53554e47204d5a564c5635313248434a482d3030304831-00000001-part1
nvme-nvme.144d-533243544e584148333035393838-53414d53554e47204d5a564c5635313248434a482d3030304831-00000001-part2
nvme-nvme.144d-533243544e584148333035393838-53414d53554e47204d5a564c5635313248434a482d3030304831-00000001-part3
nvme-nvme.144d-533243544e584148333035393838-53414d53554e47204d5a564c5635313248434a482d3030304831-00000001-part4
nvme-nvme.144d-533243544e584148333035393838-53414d53554e47204d5a564c5635313248434a482d3030304831-00000001-part5
nvme-nvme.144d-533243544e584148333035393838-53414d53554e47204d5a564c5635313248434a482d3030304831-00000001-part6
nvme-SAMSUNG_MZVLV512HCJH-000H1_S2CTNXAH305988
nvme-SAMSUNG_MZVLV512HCJH-000H1_S2CTNXAH305988_1
nvme-SAMSUNG_MZVLV512HCJH-000H1_S2CTNXAH305988_1-part1
nvme-SAMSUNG_MZVLV512HCJH-000H1_S2CTNXAH305988_1-part2
nvme-SAMSUNG_MZVLV512HCJH-000H1_S2CTNXAH305988_1-part3
nvme-SAMSUNG_MZVLV512HCJH-000H1_S2CTNXAH305988_1-part4
nvme-SAMSUNG_MZVLV512HCJH-000H1_S2CTNXAH305988_1-part5
nvme-SAMSUNG_MZVLV512HCJH-000H1_S2CTNXAH305988_1-part6
nvme-SAMSUNG_MZVLV512HCJH-000H1_S2CTNXAH305988-part1
nvme-SAMSUNG_MZVLV512HCJH-000H1_S2CTNXAH305988-part2
nvme-SAMSUNG_MZVLV512HCJH-000H1_S2CTNXAH305988-part3
nvme-SAMSUNG_MZVLV512HCJH-000H1_S2CTNXAH305988-part4
nvme-SAMSUNG_MZVLV512HCJH-000H1_S2CTNXAH305988-part5
nvme-SAMSUNG_MZVLV512HCJH-000H1_S2CTNXAH305988-part6

Revision history for this message
Steve Langasek (vorlon) wrote :

Thank you. Your logs show that shim-signed was being update from 1.54+15.7-0ubuntu1 to 1.56+15.7-0ubuntu1.
shim-signed 1.54+15.7-0ubuntu1 was published to Ubuntu on 2023-03-31.

Between March and now, have you made any changes to the hardware in this system? Have you had to replace your hard drive at any point?

I am looking to establish that the change to the device name from nvme-eui.0025384361b46f51 to nvme-nvme.144d-533243544e584148333035393838-53414d53554e47204d5a564c5635313248434a482d3030304831 is the result of a behavior change in the kernel, and not as a result of a change to the physical hardware since the last time this command was successfully executed.

Revision history for this message
Steve Langasek (vorlon) wrote :

(Because if it is a result of a behavior in the kernel, it is our responsibility to automatically detect this and handle it instead of erroring out.)

Revision history for this message
theofficialgman (theofficialgman) wrote :

This occurred on my laptop so I can pretty confidently state that there have been no hardware changes to my system over that period of time (or ever).

Revision history for this message
theofficialgman (theofficialgman) wrote :

just did some quick searching. it does appear to have been caused by a kernel update for a user of rocky linux https://forums.rockylinux.org/t/lvm-device-identifiers-changed-after-kernel-updates-resulting-in-missing-vgs-pvs/10059 . same change from nvme-eui to nvme-nvme

not sure what kernel I would have been using back in march (I use whatever is default for the release I am on). I generally hop to the latest in development ubuntu release about 1-2 months before its release. So at that point in march 2023 I am sure I was already using the 23.04 (mantic) developement release. So probably was running this kernel at the time:
linux-meta (6.2.0.19.19) lunar; urgency=medium

  * Bump ABI 6.2.0-19

 -- Andrea Righi <email address hidden> Sat, 25 Mar 2023 09:47:55 +0100

Revision history for this message
Steve Langasek (vorlon) wrote :

> This occurred on my laptop so I can pretty confidently state that there
> have been no hardware changes to my system over that period of time (or
> ever).

Well it is your hardware in any case, so you would be in a position to know! (Swapping out hard drives in a laptop is certainly a possibility.)

> just did some quick searching. it does appear to have been caused by a
> kernel update for a user of rocky linux
> https://forums.rockylinux.org/t/lvm-device-identifiers-changed-after-
> kernel-updates-resulting-in-missing-vgs-pvs/10059 . same change from
> nvme-eui to nvme-nvme

Yes, so this is a change in kernel device names which we need to handle gracefully on the grub side instead of throwing errors / debconf prompts.

affects: shim-signed (Ubuntu) → grub2 (Ubuntu)
Changed in grub2 (Ubuntu):
status: Incomplete → Triaged
summary: - package shim-signed 1.56+15.7-0ubuntu1 failed to install/upgrade:
- installed shim-signed package post-installation script subprocess
- returned error exit status 32
+ grub2 needs to properly manage kernel device name changes (nvme-eui ->
+ nvme-nvme)
tags: added: grub-nvme
Revision history for this message
Julian Andres Klode (juliank) wrote :

Oh god this is horrible. While we plan to address this for UEFI by switching to UUID we also need to handle this for grub-pc, and we really need stable disk ids, kernel can't go around changing disk ids, I mean their entire purpose is to be a stable name and this subverts it.

tags: removed: need-duplicate-check
Revision history for this message
Mate Kukri (mkukri) wrote :

In this case it's the kernel's fault, but this is still sort of a dupe of 1940723, and the only real long term solution is switching to UUID based installs as per 1940723

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.