Upgrade to 2.12~rc1-4ubuntu1 failed with "umount: /tmp/zfsmnt.5DJ7yi: target is busy."

Bug #2031042 reported by Danilo Egea Gondolfo
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Fix Released
Low
Julian Andres Klode

Bug Description

Tried to update my system today and got the error below. It's Mantic with the standard ZFS installation.

Setting up linux-image-6.3.0-7-generic (6.3.0-7.7+1) ...
Setting up grub-pc (2.12~rc1-4ubuntu1) ...
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
/etc/grub.d/10_linux_zfs: 425: version_find_latest: not found
umount: /tmp/zfsmnt.5DJ7yi: target is busy.
rmdir: failed to remove '/tmp/zfsmnt.5DJ7yi': Device or resource busy
dpkg: error processing package grub-pc (--configure):
 installed grub-pc package post-installation script subprocess returned error exit status 1
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          dpkg: dependency problems prevent configuration of grub-efi-amd64-signed:
 grub-efi-amd64-signed depends on grub-efi-amd64 | grub-pc; however:
  Package grub-efi-amd64 is not installed.
  Package grub-pc is not configured yet.

dpkg: error processing package grub-efi-amd64-signed (--configure):
 dependency problems - leaving unconfigured
Processing triggers for linux-image-6.3.0-7-generic (6.3.0-7.7+1) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 6.3.0-7-generic
 * dkms: autoinstall for kernel 6.3.0-7-generic
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-6.3.0-7-generic
W: Possible missing firmware /lib/firmware/amdgpu/ip_discovery.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega10_cap.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/sienna_cichlid_cap.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_cap.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/aldebaran_cap.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/gc_11_0_0_toc.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/sienna_cichlid_mes1.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/sienna_cichlid_mes.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi10_mes.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/gc_11_0_3_mes.bin for module amdgpu
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
/etc/grub.d/10_linux_zfs: 425: version_find_latest: not found
umount: /tmp/zfsmnt.ftFfAn: target is busy.
rmdir: failed to remove '/tmp/zfsmnt.ftFfAn': Device or resource busy
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 1
dpkg: error processing package linux-image-6.3.0-7-generic (--configure):
 installed linux-image-6.3.0-7-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 grub-pc
 grub-efi-amd64-signed
 linux-image-6.3.0-7-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

In the end these mount points were left behind:

rpool/ROOT/ubuntu_nedhsb on /tmp/zfsmnt.5DJ7yi type zfs (rw,noatime,xattr,posixacl,casesensitive)
bpool/BOOT/ubuntu_nedhsb on /tmp/zfsmnt.5DJ7yi/boot type zfs (rw,nodev,noatime,xattr,posixacl,casesensitive)
rpool/ROOT/ubuntu_nedhsb on /tmp/zfsmnt.ftFfAn type zfs (rw,noatime,xattr,posixacl,casesensitive)
bpool/BOOT/ubuntu_nedhsb on /tmp/zfsmnt.ftFfAn/boot type zfs (rw,nodev,noatime,xattr,posixacl,casesensitive)

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

It's not clear why they're in use, you may want to run fuser to find out. But ultimately I guess that's a kernel bug that we can't do anything about in grub.

The real bug in grub here is bug 2029260.

Changed in grub2 (Ubuntu):
status: New → Incomplete
Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote (last edit ):

Well, I guess this error happens (umount: /tmp/zfsmnt.5DJ7yi: target is busy.) because there is another thing mounted inside of it (/tmp/zfsmnt.5DJ7yi/boot) as mentioned in the end of the bug description.

I guess these commands are coming from grub2/debian/patches/ubuntu-zfs-enhance-support.patch?

I'm not sure who (what team) owns it.

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

So this is caused by the other bug because the cleanup function running as an exit trap only unmounts the root dataset, but not the boot one. I can fix that with the other change.

Changed in grub2 (Ubuntu):
assignee: nobody → Julian Andres Klode (juliank)
importance: Undecided → Low
status: Incomplete → Triaged
tags: added: foundations-todo
Changed in grub2 (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 2.12~rc1-4ubuntu2

---------------
grub2 (2.12~rc1-4ubuntu2) mantic; urgency=medium

  * ubuntu-zfs-enhance-support.patch: Adjustments for 2.12 library
    (LP: #2029260)
  * zfs: on_exit: Unmount ${MNTDIR}/boot before ${MNTDIR} (LP: #2031042)
  * Temporarily rmmod peimage for os-prober chainloader entries (LP: #2030810)

 -- Julian Andres Klode <email address hidden> Mon, 21 Aug 2023 14:26:07 +0200

Changed in grub2 (Ubuntu):
status: Fix Committed → Fix Released
Benjamin Drung (bdrung)
tags: removed: foundations-todo
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.