]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
udev: persist properties of MD devices after switch_root
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Thu, 23 Jan 2025 18:46:38 +0000 (19:46 +0100)
committerMariusz Tkaczyk <mtkaczyk@kernel.org>
Mon, 27 Jan 2025 09:15:32 +0000 (10:15 +0100)
dracut installs in the initrd a custom udev rule for MD devices
(59-persistent-storage-md.rules) only to set the db_persist option (see
[1]). The main purpose is that if an MD device is activated in the initrd,
its properties are kept on the udev database after the transition from the
initrd to the rootfs. This was added to fix detection issues when LVM is
on top.

This patch would allow to remove the custom udev rule shipped by dracut
(63-md-raid-arrays.rules is already being installed in the initrd), and it
will also benefit other initrd generators that do not want to create
custom udev rules.

[1] https://github.com/dracutdevs/dracut/blob/master/modules.d/90mdraid

Signed-off-by: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
udev-md-raid-arrays.rules

index d8de6d00cff650711b904ef3157b965f335c0111..a8098dc54d703b44ded38d1ea2683269e24bee30 100644 (file)
@@ -29,6 +29,7 @@ ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[0-9]", SYMLINK+="md/$env{MD_DEVNA
 IMPORT{builtin}="blkid"
 OPTIONS+="link_priority=100"
 OPTIONS+="watch"
+OPTIONS+="db_persist"
 ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
 ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_PART_ENTRY_UUID}=="?*", SYMLINK+="disk/by-partuuid/$env{ID_PART_ENTRY_UUID}"
 ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"