In my home lab I've got an Ubuntu Server 18.04 that's been a physical machine for a long time now. Today I decided to make it virtual and moved it over to my Proxmox server without issue. I'm up and running with one small issue I wanted to get some help on resolving.

When the device was physical I had a software RAID 1 configured. Now that it's been converted I would like to remove that RAID configuration since obviously it isn't needed now. I can't seem to figure out how to remove it using about every guide and suggestion I've found online. Other than saying "degraded" it looks perfectly fine. Like it doesn't notice it's only a single disk now.

sudo mdadm -D /dev/md0
           Version : 1.2
     Creation Time : Mon Aug 15 19:11:21 2016
        Raid Level : raid1
        Array Size : 7806976 (7.45 GiB 7.99 GB)
     Used Dev Size : 7806976 (7.45 GiB 7.99 GB)
      Raid Devices : 2
     Total Devices : 1
       Persistence : Superblock is persistent

       Update Time : Fri Mar 15 19:37:07 2019
             State : clean, degraded
    Active Devices : 1
   Working Devices : 1
    Failed Devices : 0
     Spare Devices : 0

Consistency Policy : resync

              Name : ubuntu:0  (local to host ubuntu)
              UUID : f9c09690:4edfb4ba:083bba5c:4f50adaa
            Events : 110

    Number   Major   Minor   RaidDevice State
       0       8        1        0      active sync   /dev/sda1
       -       0        0        1      removed


sudo cat /proc/mdstat

    Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10]
    md1 : active raid1 sda2[0]
          70273024 blocks super 1.2 [2/1] [U_]

    md0 : active raid1 sda1[0]
          7806976 blocks super 1.2 [2/1] [U_]

If you really want it really gone, you have to destroy the md super block, so mdadm will no longer be able recognize it as a array member.

Even though you're in raid 1, your data may still be at risk. Make a backup before proceeding.



The thing to understand here is that a virtual machine is still a machine, the operating system isn't supposed to know that it's virtualized. If you took virtualization out of the equation and instead said "I got a new computer and moved just one of the disks in my RAID1 set over and now it says it's degraded" the problem becomes obvious. The disk itself carries the configuration that it is part of a RAID.

To divorce the disk from that RAID set you have to destroy that configuration, that config exists as binary data (metadata) in what's known as a "super block", a predetermined place where MD knows to look to find out if a disk has been delegated to it's control.

If erasing magic data off your disk makes you nervous then good, it should. The general procedure for this is:

  • boot to a live cd
  • make sure the volume is not mounted
  • stop the array
  • cross your fingers
  • destroy the metadata on the array members per the link provided above
  • run fsck on the partitions
  • reboot and hope you didn't just corrupt all your data

This is only even plausible because it is in a MIRROR (RAID 1) so "in theory" the partitions should be fine after the operation and the filesystem will still know where the data is. A RAID 0/5/6 on the other hand spreads the data over each disk in the set in chunks, there's no "undoing it" without destroying everything. You have to copy the data somewhere safe first.

Which is why I said make a backup. The alternative is to just leave it alone, a degraded RAID1 offers no appreciable performance hit, it's just annoying that it's still there.

| improve this answer | |
  • I don't know that I fully understand what you linked. My data isn't in RAID 1 any longer it's on a single virtual hard disk. The storage for my host is RAID however. I just need to figure out how to remove the RAID completely. – Ilinuxnoob Mar 16 '19 at 21:21
  • @llinuxnoob the disk doesn't know or care that it lives in a virtual machine now. The metadata on disk is marked for MD and until you remove it, MD will continue to rightfully act that it owns the disk. There's no harm in leaving it the way it is, but there is risk in trying wipe the metadata off the disk. – ppetraki Mar 17 '19 at 0:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.