grub-mkconfig fails with ZFS when /etc/fstab was touched: find: ‘mount: (hint) your fstab has been modified, but systemd still uses[…]/tmp/zfsmnt.2a85H0/boot’: No such file or directory

Bug #2110050 reported by Louis Sautier
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hello,
If /etc/fstab is newer than /run/systemd/systemd-units-load, mount emits a hint to STDOUT.
This causes the following mount call to return a message which is later interpreted as a path:
https://git.launchpad.net/~ubuntu-core-dev/grub/+git/ubuntu/tree/debian/patches/ubuntu-zfs-enhance-support.patch?h=debian/2.12-5ubuntu5.3#n180
https://git.launchpad.net/~ubuntu-core-dev/grub/+git/ubuntu/tree/debian/patches/ubuntu-zfs-enhance-support.patch?h=debian/2.12-5ubuntu5.3#n472
To reproduce:
* Install Ubuntu 25.04 with a /boot and a / dataset:
  root@test:~# zfs list
  NAME USED AVAIL REFER MOUNTPOINT
  zp0 2.73G 212G 24K none
  zp0/zd0 118M 906M 118M /boot
  zp0/zd1 2.61G 212G 2.61G /
* Run "touch /etc/fstab"

root@test:~# grub-mkconfig
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
[…]
### BEGIN /etc/grub.d/10_linux_zfs ###
find: ‘mount: (hint) your fstab has been modified, but systemd still uses\n the old version; use 'systemctl daemon-reload' to reload.\n/tmp/zfsmnt.f2yDJq/boot’: No such file or directory
### END /etc/grub.d/10_linux_zfs ###
[…]

util-linux's upstream might change mount's behavior to skip the hint when STDOUT is not a TTY, see https://github.com/util-linux/util-linux/issues/3558#issuecomment-2854381281

In the meantime, I think it might be prudent to discard output from all mount calls from /etc/grub.d/10_linux_zfs, or to use upstream's 10_linux for ZFS too.

Tags: patch
Revision history for this message
Louis Sautier (lesbraz) wrote :

Could you please backport this util-linux patch to fix the bug? https://github.com/util-linux/util-linux/commit/cdc8b265bff5ee1ebd496aa1d6211e4ba120f766

tags: added: patch
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.