Wipe a RAID disk

If for some reason you have a disk which used to be in a software RAID and you need to add it back into OMV then OMV will still recognize it as a RAID disk, even if you have reformatted it.

In my case I had a disk that was removed from the array for a while and then inserted back – the disk itself was not faulty. In this case I actually saw two arrays under RAID management:

MOV duplicate arrays

OMV allows you to wipe a disk by going to “Storage | Physical Disks”, selecting the disk concerned and then clicking on “wipe”. If you have the above scenario this doesn’t work until you remove any shares and then file system and so on. So we need another way to do this.

The best way I found is to shutdown the PC and remove/unplug all disks except for the one you need to wipe, just so you don’t accidentally wipe the wrong thing. Then boot from a Debian live USB key – see Create a Debian Live USB flashdrive.

Once you have booted into Debian live run:

lsblk

This should return something like:

NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0 74.5G  0 disk
sdb      8:16   1  7.5G  0 disk
└─sdb1   8:17   1  1.2G  0 part /lib/live/mount/medium
loop0    7:0    0  1.1G  1 loop /lib/live/mount/rootfs/filesystem.squashfs

You can see the USB key is showing up as “sdb1” which means the one to wipe is “sda”.

I would suggest you first run “sgdisk”:

sgdisk --zap /dev/sda

This will return:

Creating new GPT entries.
 GPT data structures destroyed! You may now partition the disk using fdisk or
 other utilities.

Just to be safe you can also run:

gdisk /dev/sda

This will ask “Command (? for help)”, to which you should enter “x” to go to expert mode. You should then enter “z” as the expert command. At the end you will be asked about “Blank out MBR? (Y/N)” to which you should enter “y”. This sequence would look like:

GPT fdisk (gdisk) version 0.8.10

Partition table scan:
MBR: not present
BSD: not present
APM: not present
GPT: not present

Creating new GPT entries.

Command (? for help): x

Expert command (? for help): z
About to wipe out GPT on /dev/sda. Proceed? (Y/N): y
GPT data structures destroyed! You may now partition the disk using fdisk or
other utilities.
Blank out MBR? (Y/N): y

Then you can reboot back into OMV and go to “Storage | Physical Disks” menu to select the disk and then click on wipe.

Wipe the entire disk

This was the first thing I tried and the method usually suggested is:

dd if=/dev/zero of=/dev/sda

But this zeros the entire drive and will take a very long time.

Where is the RAID metadata

Unlike the MBR the RAID metadata is not necessarily stored at the start of the disk in fact it is often stored at the end of the disk. This can make it challenging to remove.

Apparently it can be:

  • At the end
  • At the beginning
  • 4k from the beginning

This is not a secure wipe

Just remember we are only wiping the disk enough to add into OMV, though you won’t see anything on the disk this is in no way a secure wipe. If you want that there are lots of methods you can use, just not this one.