pvscan in udev rules - buster vs bullseye

Markus Rexhepi-Lindberg Markus.Rexhepi-Lindberg at axis.com
Wed Sep 7 11:21:46 CEST 2022


Hi,

I was affected by the same issue and the suggested patch fixed it.
Thank you Andrew.

Can we add this to FAI? I assume it can be added to fai-make-nfsroot.

    Cheers!

--
Markus
________________________________________
From: linux-fai <linux-fai-bounces at uni-koeln.de> on behalf of andrew bezella <abezella at archive.org>
Sent: Wednesday, September 7, 2022 12:07:05 AM
To: fully automatic installation for Linux
Subject: pvscan in udev rules - buster vs bullseye

hello -

i had been experiencing a problem trying to use a bullseye netboot to
reinstall a server's os.  the same configuration worked with a buster
netboot.

when a logical volume exists on a metadevice then that lv was being
activated soon after the completion of `mdadm --assemble --scan --
config=/tmp/fai/mdadm-from-examine.conf`.  this caused the subsequent
`mdadm -W --stop` loop to fail when it reached that md:
(CMD) mdadm -W --stop /dev/md5 1> /tmp/RhKvizyXZk 2> /tmp/DrTvcNhaf6
Executing: mdadm -W --stop /dev/md5
(STDERR) mdadm: Cannot get exclusive access to /dev/md5:Perhaps a
running process, mounted filesystem or active volume group?
mdadm -W --stop /dev/md5 had exit code 1
(STDERR) mdadm: Cannot get exclusive access to /dev/md5:Perhaps a
running process, mounted filesystem or active volume group?
Command had non-zero exit code

eventually i found the udev rule that triggers the difference.  to
revert to the older behavior i copied /lib/udev/rules.d/69-lvm-
metad.rules into /etc/udev/rules.d and applied the following patch:
--- /srv/fai/nfsroot/bullseye-amd64/etc/udev/rules.d/69-lvm-metad.rules.orig 2021-02-22 13:39:14.000000000 -0800
+++ /srv/fai/nfsroot/bullseye-amd64/etc/udev/rules.d/69-lvm-metad.rules 2022-09-01 19:22:52.426117170 -0700
@@ -75,8 +75,7 @@

 ENV{SYSTEMD_READY}="1"

-TEST!="/run/systemd/system", GOTO="direct_pvscan"
-TEST=="/run/systemd/system", GOTO="systemd_background"
+GOTO="systemd_background"

 LABEL="systemd_background"

further down it is noted that the direct_pvscan mode is not used and
should be removed.  but it seems that since there is no systemd in
fai's bullseye nfsroot it currently is the default.  in buster the
method for invoking pvscan is apparently selected at build time and
defaults to systemd_background.  if/when FAI migrates to systemd this
may raise its head again.

hope this helps if someone else has a similar issue.

        andy

--
andrew bezella <abezella at archive.org>
internet archive


More information about the linux-fai mailing list