I have a computer with three hard drives - one is the boot drive and the other two are in RAID1. The RAID is software RAID created during the Ubuntu installation. If I reformat and reinstall Ubuntu on the boot drive will it recognize the two RAID drives as being a RAID or will I have to reconfigure them back into a RAID? If I have to recreate the RAID1 array will have to reformat the drives and lose the data on them?

Basically I may have to do a fresh install of Ubuntu on my boot drive and I do not want to lose the data on my RAID.

  • What kind of RAID system are you talking about? Hardware RAID? Fake RAID by your motherboard chipset vendor? Software RAID (which one)? – David Foerster Nov 13 '14 at 22:21
  • Software RAID set up during the Ubuntu install, which I assume is the same as using mdadm. – beatsforthemind Nov 13 '14 at 23:02
  • Please edit your question to include that info. It's highly relevant to the issue at hand. – David Foerster Nov 14 '14 at 0:09

I had faced this predicament once. I took the gamble and formatted my boot drive. Later on i realized that mdadm can assemble the RAID arrays even after a clean installation. What this means is, you dont need to re-configure the RAID once again. mdadm does it and the RAID device would be active for the system.

Run sudo fdisk -l. This will list the RAID device, something like /dev/md0

Then run sudo mdadm --assemble /dev/md0 and you are done.

Check if it worked by running cat /proc/mdstat

If fdisk doesnt output any RAID device, you can run sudo mdadm --assemble --scan to automatically detect and assemble the RAID

The above instruction assumes that you boot from a completely different drive and the RAID is just a media storage

| improve this answer | |
  • Ok cool, it sounds like I will have to do this. So I can run mdadm --assemble without specifying the drives (like /dev/sda1 /dev/sdb2)? Ubuntu will detect thay they are meant to be in a RAID and will automatically assemble them into /dev/md0? – beatsforthemind Nov 13 '14 at 19:44
  • Once /dev/sda1 and /dev/sdb2 are configured as a raid, they are not valid any more individually. I would suggest, you better run sudo mdadm --assemble --scan. This should take care automatically. – astrob0t Nov 13 '14 at 19:49
  • So to confirm, I can run 'sudo mdadm --assemble --scan' and then update my fstab so it will be automatically mounted? – beatsforthemind Nov 13 '14 at 19:57
  • Yes, Exactly. :) – astrob0t Nov 13 '14 at 19:59

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.