11

Admittedly I'm not too familiar with MDADM. I recently set up an array for a NAS, but incorrectly sized the partitions in my setup script, and need to remove the array, re-partition the disks, and re-create the array.

In my Googling, I found the following process to delete an mdadm array:

# mdadm --stop /dev/md0
# mdadm --remove /dev/md0
# mdadm --zero-superblock ( /dev/sda /dev/sdb ... )

However, I get the following output:

sudo mdadm --stop /dev/md0
mdadm: stopped /dev/md0

sudo mdadm --remove /dev/md0
mdadm: error opening /dev/md0: No such file or directory

Then, if I attempt to format the drives, parted returns an error and the array re-appears in /proc/mdstat.

I've tried just running mdadm --remove /dev/md0 to no avail as well.

Any help with the issue would be appreciated.

1 Answer 1

13

After some more digging, I found the combination of commands that fixed the issue:

sudo mdadm --stop /dev/md0
sudo mdadm --zero-superblock /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1
2
  • mdadm: Unrecognised md component device - /dev/XXX. I.e. the recommendation doesn't work.
    – wvxvw
    Commented Mar 5 at 13:26
  • This worked for me. You need to use the mdadm name for the array, not the disk
    – MikeKulls
    Commented May 10 at 2:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .