Signed-off-by: Xiao Ni <xni@xxxxxxxxxx> --- udev-md-raid-assembly.rules | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/udev-md-raid-assembly.rules b/udev-md-raid-assembly.rules index 39b4344b8592..748ea05dadaa 100644 --- a/udev-md-raid-assembly.rules +++ b/udev-md-raid-assembly.rules @@ -11,6 +11,11 @@ SUBSYSTEM!="block", GOTO="md_inc_end" ENV{SYSTEMD_READY}=="0", GOTO="md_inc_end" # handle potential components of arrays (the ones supported by md) +# For member devices which are md/dm devices, we don't need to +# handle add event. Because md/dm devices need to do some init jobs. +# Then the change event happens. +# When adding md/dm devices, ID_FS_TYPE only be linux_raid_member +# after change event happens. ENV{ID_FS_TYPE}=="linux_raid_member", GOTO="md_inc" # "noiswmd" on kernel command line stops mdadm from handling @@ -28,6 +33,11 @@ GOTO="md_inc_end" LABEL="md_inc" +# We only handle add event on raw disks. If we handle change event on raw disk, +# the tool parted can't change partition table unless clear superblock on +# member disks +ACTION=="change", KERNEL!="dm-*|md*", GOTO="md_inc_end" + # remember you can limit what gets auto/incrementally assembled by # mdadm.conf(5)'s 'AUTO' and selectively whitelist using 'ARRAY' ACTION!="remove", IMPORT{program}="BINDIR/mdadm --incremental --export $devnode --offroot $env{DEVLINKS}" -- 2.32.0 (Apple Git-132)