0

I'm installing 18.04 on a new machine and need to modify the partitioning of devices on which I installed software RAID. Per Want to Remove Software RAID (closed as solved) I have done this:

mdadm --stop /dev/md0
mdadm --stop /dev/md1
mdadm --zero-superblock /dev/sda1
mdadm --zero-superblock /dev/sda2
mdadm --zero-superblock /dev/sdb1
mdadm --zero-superblock /dev/sdb2

The installer no longer shows the RAID arrays but still sees the partitions as being RAID and won't allow them to be changed:

No modifications can be made to partition #1 of device SCSI (0,0,0) (sda) for the following reasons:
In use by software RAID device md0.

But /dev/md0 no longer exists.

How can I get back to where I can re-partition?

Eric Lee
  • 1
  • 1

1 Answers1

0

The easiest way is to delete the partitions.

Run sudo fdisk /dev/sda

To create a new GPT header, press g followed by enter.

To create a new MBR header, press o followed by enter.

Exit fdisk by pressing w followed by enter.

This will create a new, clean, disk label, without any of the previous partitions. You will have to repeat it for each of your disks (sda and sdb in your case). This will obviously delete any data present on the disks.

If there's partitions you want to keep, you can delete the individual partitions used for the md device. In this case, run fdisk as above, but do not create new labels; use d to delete individual partitions.

vidarlo
  • 23,497