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?

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
  • 22,691
  • Thank you. I'm still in the Installer and fdisk isn't available in the shell there. – Eric Lee Mar 07 '20 at 20:07
  • I'm trying to avoid Aborting the Install because of the warning about making the system "unusable". But I don't seem to have much choice. The system is not bootable as it is.

    After Aborting I'll try the Installer again to see if it has forgotten about RAID. If it hasn't I'll try deleting the partitions with GParted.

    – Eric Lee Mar 07 '20 at 20:15
  • Instead of Aborting I unintentionally rebooted. No disaster. I started the Install again and when I got to the Partitioning it still had them marked raid Still raid but there was no more No modifications allowed message. Following the same instructions noted above the Install went smoothly. – Eric Lee Mar 09 '20 at 02:28
  • I'm not sure of the etiquette here. I'm grateful for @vidarlo 's quick response but couldn't use it as things stood and eventually got out of difficulty a different way. – Eric Lee Mar 09 '20 at 02:45
  • @EricLee I suggest you answer your own question and mark your answer accepted then :) – vidarlo Mar 09 '20 at 06:16