Problems creating a new RAID array on Debian GNU/Linux Bullseye

A quick entry to remember a problem which I found creating a new RAID array on my Debian box.

1. This is not a problem is just a reminder: when you create a partition in a hard drive with a GPT label you need to setup as partition type 29 (Linux RAID) instead of partition type fd (Linux RAID) in drive with DOS labels.

2. Problem creating RAID array:

# mdadm --create /dev/md0 --level=mirror --raid-devices=2 /dev/sd[a-b]1
 mdadm: Note: this array has metadata at the start and
     may not be suitable as a boot device.  If you plan to
     store '/boot' on this device please ensure that
     your boot-loader understands md/v1.x metadata, or use
 mdadm: super1.x cannot open /dev/sdb1: Device or resource busy
 mdadm: /dev/sdb1 is not suitable for this array.
 mdadm: create aborted

After checking with lsof and mount commands that partition is not been used by any process in the system it’s needed to be sure that those partitions are not being used in other RAID array:

# mdadm --detail /dev/md0
            Version : 1.2
         Raid Level : raid0
      Total Devices : 1
        Persistence : Superblock is persistent
              State : inactive
    Working Devices : 1
     Number   Major   Minor   RaidDevice
        -       8       17        -        /dev/sdb1

So let’s to release that partition removing the old array:

# mdadm -vS /dev/md0
mdadm: stopped /dev/md0
# mdadm -vr /dev/md0

Now you can create successfully the new array.

The greatest teacher, failure is.
— Yoda. The Last Jedi

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s