Bug#958397: Missing 60-block.rules breaks grub-installer
steve at einval.com
Tue Apr 21 15:34:45 BST 2020
Awesome work on tracking this down!
On Tue, Apr 21, 2020 at 03:19:36PM +0200, Pascal Hambourg wrote:
>Control: found -1 232-25+deb9u12
>Control: unarchive 852323
>X-Debbugs-CC: steve at einval.com
>Udev has a rule with OPTIONS+="watch" to generate an event and update
>symlinks in /dev/disk/ when a block device is written to. In Jessie, the rule
>was in /lib/udev/rules.d/60-persistent-storage.rules. In Stretch and Buster,
>it was moved to /lib/udev/rules.d/60-block.rules. However
>/lib/udev/rules.d/60-block.rules was *not* included in :
>- the initramfs hook script /usr/share/initramfs-tools/hooks/udev, therefore
>in the initramfs built by update-initramfs
>- the udev-udeb package
>- the Debian installer initrd.gz (I guess it uses udev-udeb)
>The most visible consequence is in the Debian installer. When a device is
>formatted, symbolic links pointing to that device in /dev/disk/ are not
>updated immediately. Then if the symlink pointing to the root device in
>/dev/disk/by-uuid/ is missing or wrong, update-grub/grub-mkconfig puts the
>root device name instead of the UUID in the root= kernel parameter (see
>/etc/grub.d/10_linux). Drive and partition device names are unreliable and
>may change at each boot, causing the boot to fail.
>The following bugs may be related to this issue :
>Steps to reproduce the issue :
>Boot the Debian installer.
>Select "advanced options" > "Expert install".
>Follow steps up to "Partition disks".
>Select manual partitioning.
>Create or select and format a partition for /.
>Do not create or use any swaps.
>Install the base system.
>Skip "Configure the package manager" and "Select and install software".
>Install the GRUB boot loader.
>Jump into a shell.
>Check the symlink pointing to the root partition in /dev/disk/by-uuid/ is
>missing or wrong.
>Check that /target/boot/grub/grub.cfg "linux" lines have
>root=/dev/<partition> instead of root=UUID=<uuid>.
>Suggested fix :
>The issue could be worked around by executing "udevadm trigger" to update
>symlinks at a proper time after formatting the root filesystem and before
>installing GRUB. This is actually what seems to happen at the "select and
>install software" step. But I think is is easier, safer and cleaner to
>include /lib/udev/rules.d/60-block.rules and fix the root cause than to rely
>on executing "udevadm trigger" at the proper time.
To be honest, I'm curious if there's a good reason to not just include
all the udeb rules files in the udev-udeb package? That would fix this
bug and save us from any potential future possible reshuffles. It's
not like they're very large.
Happy to send a patch to modify debian/udev-udeb.install if that will
help. It would be lovely to also get the same fix backported to Buster
(and even Stretch!) if you're ok with that.
/me goes to do a test build now.
Steve McIntyre, Cambridge, UK. steve at einval.com
You lock the door
And throw away the key
There's someone in my head but it's not me
More information about the Pkg-systemd-maintainers