Commit graph

1132 commits

Author SHA1 Message Date
Mike Fleetwood 5f02bcf463 Detect Linux SWRaid members by querying mdadm (#756829)
Detection of Linux SWRaid members currently fails in a number of cases:

1)  Arrays which use metadata type 0.90 or 1.0 store the super block at
    the end of the partition.  So file system signatures in at least
    linear and mirrored arrays occur at the same offsets in the
    underlying partitions.  As libparted only recognises file systems
    this is what is detected, rather than an SWRaid member.

    # mdadm -E -s -v
    ARRAY /dev/md/1  level=raid1 metadata=1.0 num-devices=2 UUID=15224a42:c25bbcd9:15db6000:4e5fe53a name=chimney:1
       devices=/dev/sda1,/dev/sdb1
    ...
    # wipefs /dev/sda1
    offset               type
    ----------------------------------------------------------------
    0x438                ext4   [filesystem]
                         LABEL: chimney-boot
                         UUID:  10ab5f7d-7d8a-4171-8b6a-5e973b402501

    0x1fffe000           linux_raid_member   [raid]
                         LABEL: chimney:1
                         UUID:  15224a42-c25b-bcd9-15db-60004e5fe53a

    # parted /dev/sda print
    Model: ATA VBOX HARDDISK (scsi)
    Disk /dev/sda: 34.4GB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos

    Number  Start   End     Size    Type      File system  Flags
     1      1049kB  538MB   537MB   primary   ext4         boot, raid
    ...

2)  Again with metadata type 0.90 or 1.0 arrays blkid may report the
    contained file system instead of an SWRaid member.  Have a single
    example of this configuration with a mirrored array containing the
    /boot file system.  Blkid reports one member as ext4 and the other as
    SWRaid!

    # blkid | egrep 'sd[ab]1'
    /dev/sda1: UUID="10ab5f7d-7d8a-4171-8b6a-5e973b402501" TYPE="ext4" LABEL="chimney-boot"
    /dev/sdb1: UUID="15224a42-c25b-bcd9-15db-60004e5fe53a" UUID_SUB="0a095e45-9360-1b17-0ad1-1fe369e22b98" LABEL="chimney:1" TYPE="linux_raid_member"

    Bypassing the blkid cache gets the correct result.

    # blkid -c /dev/null /dev/sda1
    /dev/sda1: UUID="15224a42-c25b-bcd9-15db-60004e5fe53a" UUID_SUB="d0460f90-d11a-e80a-ee1c-3d104dae7e5d" LABEL="chimney:1" TYPE="linux_raid_member"

    However this can't be used because if a user has a floppy configured
    in the BIOS but no floppy attached, GParted will wait for minutes as
    the kernel tries to access non-existent hardware on behalf of the
    blkid query.  See commit:
        18f863151c
        Fix long scan problem when BIOS floppy setting incorrect

3)  Old versions of blkid don't recognise SWRaid members at all so always
    report the file system when found.  Occurs with blkid v1.0 on
    RedHat / CentOS 5.

The only way I can see how to fix all these cases is to use the mdadm
command to query the configured arrays.  Then use this information for
first choice when detecting partition content, making the order: SWRaid
members, libparted, blkid and internal.

GParted shell wrapper already creates temporary blank udev rules to
prevent Linux Software RAID arrays being automatically started when
GParted refreshes its device information[1].  However an administrator
could manually stop or start arrays or change their configuration
between refreshes so GParted must load this information every refresh.
On my desktop with 4 internal hard drives and 3 testing Linux Software
RAID arrays, running mdadm adds between 0.20 and 0.30 seconds to the
device refresh time.

[1] a255abf343
    Prevent GParted starting stopped Linux Software RAID arrays (#709640)

Bug 756829 - SWRaid member detection enhancements
2015-11-02 10:03:45 -07:00
Wolfgang Stöggl cf48f07038 Updated German translation 2015-10-26 04:40:40 +00:00
Daniel Korostil f09249750f Updated Ukrainian translation 2015-10-22 17:13:01 +03:00
Anders Jonsson 8a27b073b7 Updated Swedish translation 2015-10-21 21:53:34 +00:00
Daniel Mustieles bcb3628ab6 Updated Spanish translation 2015-10-21 14:29:03 +00:00
Alexandre Franke d9c76be725 Updated French translation 2015-10-21 08:41:41 +00:00
Jiri Grönroos 27f3b6c9a0 Updated Finnish translation 2015-10-21 07:28:33 +00:00
Milo Casagrande 459144eeff Updated Italian translation 2015-10-20 17:08:22 +00:00
Daniel Șerbănescu 8fd4043d8f Updated Romanian Translation 2015-10-20 18:56:12 +02:00
Rafael Fontenelle 3ec385142d Updated Brazilian Portuguese translation 2015-10-20 16:29:18 +00:00
Jiri Grönroos 27a12d82d1 Updated Finnish translation 2015-10-07 13:55:59 +00:00
Seong-ho Cho 5367af04a6 Updated Korean translation 2015-10-05 01:37:05 +09:00
Pedro Albuquerque 5c852e5415 Updated Portuguese translation 2015-09-26 10:14:21 +00:00
Pedro Albuquerque fe47d7a46a Updated Portuguese translation 2015-09-26 10:11:57 +00:00
Stas Solovey b4fe2f608e Updated Russian translation 2015-09-20 20:54:07 +00:00
Andika Triwidada 2d55b74699 Updated Indonesian translation 2015-09-20 06:28:30 +00:00
Aurimas Černius 681acdfd2c Updated Lithuanian translation 2015-09-19 18:17:05 +03:00
Piotr Drąg 8b8dbabc73 Updated Polish translation 2015-09-19 09:52:20 +02:00
Dušan Kazik a85a91aacd Updated Slovak translation 2015-09-17 16:31:05 +00:00
Balázs Úr c7120ba975 Updated Hungarian translation 2015-09-17 15:01:30 +00:00
Marek Černocký 7f9503eb8f Updated Czech translation 2015-09-17 09:54:23 +02:00
Aurimas Černius d4a8e21578 Updated Lithuanian translation 2015-09-09 17:35:40 +03:00
Kjartan Maraas 32aba0c39a Updated Norwegian bokmål translation from ProjectX. 2015-09-07 21:59:32 +02:00
Seong-ho Cho 0916a50cbe Updated Korean translation 2015-09-08 02:34:33 +09:00
Piotr Drąg 68a162ab68 Updated Polish translation 2015-09-04 00:18:34 +02:00
Anders Jonsson ee26d4fffc Updated Swedish translation 2015-08-10 18:23:18 +00:00
Rūdolfs Mazurs 226f7ee8e8 Updated Latvian translation 2015-08-03 21:07:35 +03:00
Wolfgang Stöggl 14e6b7639a Updated German translation 2015-07-31 22:14:55 +00:00
Milo Casagrande 48a9d7eec7 Updated Italian translation 2015-07-31 07:13:47 +00:00
A S Alam 574ac285c5 Punjabi Translation updated 2015-07-27 22:59:12 -05:00
Enrico Nicoletto b23092ae77 Updated Brazilian Portuguese translation 2015-07-27 16:06:04 +00:00
Josef Andersson c3f865e10f Updated Swedish translation 2015-07-26 19:01:00 +00:00
Alexandre Franke 8a7b3d23b4 Updated French translation 2015-07-26 17:26:05 +00:00
Baurzhan Muftakhidinov 12b2fc4237 Updated Kazakh translation 2015-07-26 15:42:19 +00:00
Daniel Șerbănescu 1b562ad1dd Updated Romanian Translation 2015-07-26 17:40:36 +02:00
Dušan Kazik b4084db410 Updated Slovak translation 2015-07-23 18:02:31 +00:00
Marek Černocký 8dff5af807 Updated Czech translation 2015-07-21 19:30:27 +02:00
Balázs Úr 72f9a2a3c8 Updated Hungarian translation 2015-07-17 14:09:29 +00:00
Daniel Mustieles 0adc0a0bda Updated Spanish translation 2015-07-13 14:07:51 +02:00
Stas Solovey 4e19422312 Updated Russian translation 2015-07-13 11:14:04 +00:00
Piotr Drąg fef569552c Updated Polish translation 2015-07-05 20:28:07 +02:00
Gábor Kelemen 7090866b2a Updated Hungarian translation 2015-06-01 14:27:03 +00:00
Daniel Șerbănescu aaddc15295 Updated Romanian Translation 2015-04-24 08:39:45 +02:00
Sveinn í Felli 5aa58519b6 Updated Icelandic translation 2015-04-22 10:15:44 +00:00
Sveinn í Felli 1002864e4c Updated Icelandic translation 2015-04-22 10:09:25 +00:00
Jordi Mas 6630320b0d Fixes to Catalan translation 2015-04-18 20:07:17 +02:00
Akom Chotiphantawanon ec910b9699 Updated Thai translation 2015-04-07 12:46:02 +07:00
Dušan Kazik b549a48640 Updated Slovak translation 2015-04-01 18:25:44 +00:00
Piotr Drąg 038274c9fd Updated Polish translation 2015-03-29 21:00:27 +02:00
GNOME Translation Robot 4baaf4436f Updated Scottish Gaelic translation 2015-03-28 11:23:27 +00:00