• Bug#1109801: Mdadm fails to give error message if the wrong parameters

    From Daniel Baumann@21:1/5 to Patrick Dunford on Thu Jul 24 07:50:01 2025
    Hi Patrick,

    thank you for your report.

    On 7/24/25 03:59, Patrick Dunford wrote:
    When an array is created or modified, new disks are added. The add command takes a parameter,
    which must be a partition of an existing disk e.g. /dev/sda1

    If the user only specifies a device e.g. /dev/sda, mdadm will claim the disk has been added
    and show all normal indications and messages for the device.

    To be sure that I understand you correctly, can you clarify for me which
    case you're after:

    a) the correct device to be added is /dev/sda (without a /dev/sda1 being present) and that doesn't work like you described.

    or

    b) the correct device to be added is /dev/sda1 (which is being present)
    but when you add /dev/sda instead, it doesn't work like you described.

    Regards,
    Daniel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Daniel Baumann@21:1/5 to Patrick Dunford on Thu Jul 24 10:20:02 2025
    Hi Patrick,

    please keep the bug in CC, so your messages get added to the bug in the tracking system. I've forwarded your previous message accordingly.

    On 7/24/25 09:27, Patrick Dunford wrote:
    In order to create a working array the following steps of preparation are required for each disk in the array (this has been found to be the only method which works):

    1. Create a GPT partition table on the disk e.g. /dev/sda
    2. Create a filesystem partition (e.g. ext4) on the disk e.g. /dev/sda1
    3. Add the partition to the MD array

    I'm afraid this is not what you initially wrote, so I guess that was
    just a typo (you wrote you'd be adding /dev/sda, not /dev/sda1 to the
    array).

    now, given the above, there are two things to note:

    a) when you add a device to an array, there is no need to format it as
    all data will be overwritten by mdadm during the resync anyway.
    (it might even cause problems if you do so)

    b) all partitions need to be of type "raid", usually presented as
    "Linux RAID" (e.g. in cfdisk).

    both a) and b) are the standard way of doing things, which is inline
    with all documentation I've ever seen about mdadm/RAID on Linux. Doing
    so, also never resultet in any problems for where things wouldn't work
    as expected.

    can you retry with both taking a) and b) into account?

    Regards,
    Daniel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)