Convert running system to RAID 5

8,302

Solution 1

Try this:

  1. Make a backup.
  2. Test the backup.
  3. If needed, install mdadm
  4. Create a RAID 5 array with mdadm --create --level=5 missing /dev/sdb1 /dev/sdc1
    Adjust drives or partitions as needed.
  5. Format the new array (mkfs -t ext2 /dev/mdx).
  6. Copy all data to the new array. rsync -av --exclude-from=excludefile /source/ /destination/ might come in handy since you do not want to copy /dev/ :)
  7. Setup your bootloaded (grub2?) to boot from the new array.
  8. Reboot and test.
  9. Add the old drive to the degraded array. This will fail if you have the drive in use at the time of adding. (So make sure it is not mounted from step 6, or reboot to a liveCD).

Solution 2

Even if you could come up with a means of doing this, you will face several issues:

  1. RAID 5 is never recommended today. It is effectively a deprecated technology, avoid completely.
  2. RAID 5 should not be used in a three drive array, it is highly inefficient at this scale. No array size is good for RAID 5 but it gets worse at smaller spindle counts.
  3. One of the biggest risks of RAID 5 is its high likelihood of failing during an array rebuild. So starting from a degraded position means that you are in a position of doing this because you can't risk your data being offline while at the same time putting yourself into a position of being extremely likely to lose your entire array before it finishes rebuilding.

Move to RAID 1 with two drives. Or use all three in RAID 1. Avoid RAID 5.

http://www.smbitjournal.com/2012/11/choosing-a-raid-level-by-drive-count/ http://www.smbitjournal.com/2012/07/hot-spare-or-a-hot-mess/

Solution 3

Take a look at:

http://raider.sourceforge.net/

Seems to do what you are looking for.

Share:
8,302

Related videos on Youtube

Ken
Author by

Ken

Updated on September 18, 2022

Comments

  • Ken
    Ken almost 2 years

    I have a machine with 3 identical disks. I performed a clean installation of ubuntu 12.10 on one disk.

    How can I convert the running system to boot off a (software) raid5 comprised of all three disks (one of these is in use running the system)?

    Is it possible to start a raid 5 md device in degraded mode using 2 disks(disks 2&3), copy the data over from disk1, boot of of 2&3 (raided 5) and then add disk1 into the md device and let them resync? If possible, how would I got about doing this? what are the steps I need to perform? and if possible, do you know of a tutorial I can follow?

    [I know something similar is possible if you want to boot off of a RAID 1, you started a degraded device and add the first disk later]

    Thanks.

  • Hennes
    Hennes over 11 years
    RAID 5 needs a minimum of 3 disks, but mdadm --create --level=5 missing /dev/sdb1 /dev/sdc1 might just work.
  • gertvdijk
    gertvdijk over 11 years
    Welcome to Ask Ubuntu! Whilst this answers the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
  • Ken
    Ken about 11 years
    This is for a home HTPC, not a production server. Having data offline is not an issue, speed is also less of an issue seeing as it's fast enough for it's intended use, however with three slow dirt cheap old drives (WD 1TB Green 3yr. old) I currently have, I'm more concerned about a failure causing me to lose all the data. RAID 5 also leaves me with more disk space for storage (1.8 TB vs. 1TB I would get with RAID 1).