• Re-create RAID1

    I was trying to create RAID1 as per https://wiki.archlinux.org/index.php/RAID#Build_the_array and succeeded. However, I wasn’t happy about system creating some random number (like /dev/md127) for RAID instead of /dev/md0, so I decided to re-create it and this is where I fu**ed up.

    I followed instructions about deleting existing mdadm RAID and failed. Then I found instructions how to mark RAID drives as failed to remove them, and succeeded with one drive only (other couldn’t be removed because “resource is busy”). As a result, I now have RAID with 1 disk and can’t do anything with it. In short, I want to re-create RAID1 using sda and sdb drives. They are empty, so I don’t mind format/data loss, etc.

    My current cat /proc/mdstat output:

    Personalities : [raid1] 
    md127 : active (auto-read-only) raid1 sda1[0]
          976630464 blocks super 1.2 [2/1] [U_]
          bitmap: 8/8 pages [32KB], 65536KB chunk
    unused devices: <none>

    Running mdadm --stop /dev/md127 succeeds.

    Then running mdadm --remove /dev/md127 fails:

    mdadm: error opening /dev/md127: No such file or directory

    Running mdadm --zero-superblock /dev/sda (sdb) fails too:

    unrecognised md component device - /dev/sda (sdb)

    As a result, trying to re-create array using mdadm --create /dev/md0 --level=mirror --raid-devices=2 /dev/sda1 /dev/sdb1 fails:

    mdadm: /dev/sda1 appears to contain an ext2fs file system
           size=976761540K  mtime=Thu Jan  1 03:00:00 1970
    mdadm: /dev/sda1 appears to be part of a raid array:
           level=raid1 devices=2 ctime=Wed Jun 13 13:21:20 2018
    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
  • So after playing 20 more minutes I got it solved. In case someone else has such a problem in future, this is how I solved it:

    mdadm -S /dev/mdX
    dd if=/dev/zero of=/dev/sda bs=1M count=1024
    dd if=/dev/zero of=/dev/sdb bs=1M count=1024
    rm /etc/mdadm.conf

    Rebooted (not sure if it was needed, but did anyways) and was able to re-create RAID using the same HDDs again.

  • @toxpal said in Re-create RAID1:

    Rebooted (not sure if it was needed

    could be solve that the drive was flagged as busy… but raid no little knowing ;)

re-create1 raid11 Posts 3Views 242
Log in to reply
Bloom Email Optin Plugin

Looks like your connection to Antergos Community Forum was lost, please wait while we try to reconnect.