Delete mdadm array but keep data

9,781

Solution 1

No. But if I understand correctly, the update of mdadm has replaced your configuration. It should've asked you if you wanted to keep the old one or replace it. If that is the case, then you can either use "sudo dpkg-reconfigure mdadm" or edit /etc/initramfs-tools/conf.d/mdadm so that BOOT_DEGRADED=true.

Solution 2

It depends. If you are using mdadm superblock format 0.9, or 1.0 ( but not 1.1 or 1.2 ), then you can simply use mdadm --zero-superblocks ( from a livecd or otherwise with the array stopped ) to zap the raid superblocks, and then can access the disk normally. You can also reshape the array so that it is only supposed to have one disk instead of two and then it won't be degraded anymore. Then if you do get around to replacing the failed disk later, you can grow it back.

To reshape the array so that having only the single disk is considered normal, do:

mdadm -G /dev/md0 -n 1 --force

Also you can see what superblock format you are using with mdadm -E /dev/sdXX

Share:
9,781

Related videos on Youtube

Oli
Author by

Oli

Hi, I'm Oli and I'm a "full-stack" web-dev-op. Eurgh. I'm also allergic to jargon BS. I spend most of my professional time writing Django websites and webapps for SMEs. I write a lot of Python outside of Django sites too. I administer various Linux servers for various tasks. I contribute to the open source projects that I use when I can. I'm a full-time Linux user and that has lead to helping other people live the dream. I am an official Ubuntu Member and I earnt my ♦ on SE's own Ask Ubuntu in 2011's moderator election. That's probably where I spend most of my unpaid time. I also run thepcspy.com which has been my place to write for the last decade or so. If you need to contact me for extended help, you can do so via my website, just remember that I have bills so if I feel your request is above and beyond normal duty, I might ask for remuneration for one-on-one support. For more social contact, you can usually find me (or just my computer) lurking in the Ask Ubuntu General Chat Room and on Freenode in #ubuntu and #ubuntu-uk under the handle Oli or Oli``.

Updated on September 18, 2022

Comments

  • Oli
    Oli over 1 year

    I have a two-disk mdadm RAID1 array. One of the disks has died so the array is in a degraded state. It's been like this for a while and while I didn't mind getting the occasional email through, recently mdadm had an update that now forces the boot process to halt in an interactive mode where I have to press y to continue or it falls to busybox. Very dull.

    I'd like to keep the remaining data but I'd like the drive not to be mdadm-reliant any more. Is there a quick way to delete toe MD superblocks and mount it directly without losing data?

  • Oli
    Oli almost 13 years
    /etc/initramfs-tools/conf.d/mdadm was the problem. Thanks.