Skip to content
  • Mike Fleetwood's avatar
    Prevent GParted starting stopped Linux Software RAID arrays (#709640) · a255abf3
    Mike Fleetwood authored and Curtis Gedak's avatar Curtis Gedak committed
    Applying operations or just scanning the partitions in GParted was
    causing all stopped Linux Software RAID arrays to be automatically
    started.  This is not new with this patch set, but as a result of the
    following behaviour which has existed for a long time.  Chain of events
    goes likes this:
    
     1) Gparted calls commit_to_os() to update the kernel with the new
        partition table;
     2) Libparted calls ioctl() BLKPG_DEL_PARTITION on every partition to
        delete every partition from the kernel.  Succeeds on non-busy
        partitions only;
     3) Kernel emits udev partition remove event on every removed partition;
     4) Libparted calls ioctl() BLKPG_ADD_PARTITION on every non-busy
        partition to re-add the partition to the kernel;
     5) Kernel emits udev partition add event on every added partition;
     6) Udev rule:
          SUBSYSTEM=="block", ACTION=="add", ENV{ID_FS_TYPE}=="linux_raid_member", \
                  RUN+="/sbin/mdadm -I $tempnode"
        from either /lib/udef/rules.d/64-md-raid.rules or
        .../65-md-incremental.rules incrementally starts the member in a
        Linux Software RAID array.
    
    Fix by temporarily adding blank override rules files which does nothing,
    so that when the udev add and remove events for Linux Software RAID
    array member partitions fire nothing is done; but only when required.
    Note that really old versions of udev don't have rules to incrementally
    start array members and some distributions comment out such rules.
    
    Bug #709640 - Linux Swap Suspend and Software RAID partitions not
                  recognised
    a255abf3