Skip to content

Commit

Permalink
udev: persist properties of MD devices after switch_root
Browse files Browse the repository at this point in the history
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>
aafeijoo-suse authored and mtkaczyk committed Jan 27, 2025
1 parent b1ee932 commit 21e4efb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions udev-md-raid-arrays.rules
Original file line number Diff line number Diff line change
@@ -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}"

0 comments on commit 21e4efb

Please sign in to comment.