Skip to content
Commit 743968ef authored by Mike Fleetwood's avatar Mike Fleetwood Committed by Curtis Gedak
Browse files

Add clearing of SWRaid metadata 0.90 and 1.0 super blocks (#756829)

The super blocks for Linux Software RAID arrays using metadata types
0.90 and 1.0 are stored at the end of the partition and not currently
cleared by GParted.

Create a SWRaid array, stop it and format it to cleared using GParted.
The signature remains.

    # mdadm --create /dev/md1 --level=linear --raid-devices=1 --force --metadata=1.0 /dev/sdb1
    # mdadm --stop /dev/md1
    [In GParted format to cleared /dev/sdb1]
    # blkid /dev/sdb1
    /dev/sdb1: UUID="8ac947a7-063f-2266-5f2a-e5d178198139" UUID_SUB="49bd51d4-4c54-fb16-a45e-bd795f783f59" LABEL="rockover:1" TYPE="linux_raid_member"

As fixed in other cases before [1][2] it is necessary to clear all
signatures before formatting as a new file system to prevent recognition
issues.  For example now format the partition as a FAT32 file system.
Now there are two signatures and libparted reports one type and blkid
reports another.

    # mkdosfs -F 32 /dev/sdb1
    # blkid /dev/sdb1
    /dev/sdb1: UUID="8ac947a7-063f-2266-5f2a-e5d178198139" UUID_SUB="49bd51d4-4c54-fb16-a45e-bd795f783f59" LABEL="rockover:1" TYPE="linux_raid_member"
    # parted /dev/sdb print
    Model: ATA SAMSUNG SSD UM41 (scsi)
    Disk /dev/sdb: 8012MB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos

    Number  Start   End     Size    Type      File system  Flags
     1      1049kB  538MB   537MB   primary   fat32

(Deliberately avoided btrfs, ext2/3/4 and xfs as recent versions of
their mkfs tools clear other signatures first for the same reason).

[1] Bug 688882 - Improve clearing of file system signatures
[2] 3c75f3f5
    Use wipefs to clear old signatures before creating new file systems (#688882)

Update erase_filesystem_signatures() to also zero the necessary sectors
to clear SWRaid metadata 0.90 and 1.0 super blocks.

Bug 756829 - SWRaid member detection enhancements
parent a86f28bc
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment