3

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.

0

4 Answers 4

3

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).
1

Take a look at:

http://raider.sourceforge.net/

Seems to do what you are looking for.

1
  • 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.
    – gertvdijk
    Feb 9, 2013 at 11:41
1

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/

1
  • 1
    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).
    – Ken
    Mar 30, 2013 at 11:17
0

RAID 5 requires at minimum, 3 disks. RAID 1 only mirrors data between two disks, whereas RAID 5 formats data in such a way that part of its data is stored across all three disks. In my mind, you will need at least one more disk.

I'm not very linux-ey, but this is what I'd do under Windows. If you have a LiveCD which supports the Software RAID you're trying to set up, I would first make sure the image is set up with the required drivers, image the drive under LiveCD, build the RAID, and then re-image your Linux system to the RAID. From here you may need to do a fix to the bootsector (should be doable under LiveCD), and make any necessary changes to the boot config.

Note: followed this from Serverfault :P hence why a non-linux guy is posting on askubuntu

Hope this helps,

1
  • 1
    RAID 5 needs a minimum of 3 disks, but mdadm --create --level=5 missing /dev/sdb1 /dev/sdc1 might just work.
    – Hennes
    Feb 8, 2013 at 16:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .