Results 1 to 2 of 2

Thread: Convert system to RAID5

Threaded View

  1. #1
    Join Date
    Feb 2008
    Beans
    92

    Red face Convert system to RAID5

    Hello,

    I will update this post with specifics as I work through this process, and respond with comments as I have questions I have not solved.

    I'll try to make this a short as possible. My end goal is to have a system using RAID5, made from my current system that has multiple partitions.

    Current setup:
    • 2TB drive
      • SWAP Partition - 2GB
      • / Partition - 20GB
      • /home partition - the rest
    • 750GB drive
      • SWAP partition - 2GB
      • /home/myuser/xtradata partition - the rest


    I recently acquired 3 more of the same 2TB disk I already have. What I would like to end up with is a system with 4 identically partitioned disks, with each one like this:
    • SWAP Partition - 2GB
    • RAID1 - /boot - 1GB
    • RAID5 - / - The rest


    The RAID1 partition will actually be a 4 disk RAID1 (I know that writes will be slower, but it is only for the /boot partition, and I want all disks to be "swapppable" with the same MBR so that I can pull any damaged disk and run in degraded mode, if necessary)

    So, I will lay out my plan with current holes and questions. Here goes:
    1. Partition my 3 currently empty 2TB disks with the layout above
    2. Create the RAID1 and RAID5 arrays in "degraded" mode using
      Code:
      mdadm --create --verbose /dev/md1 --level=5 --chunk=32 --raid-devices=4 missing /dev/sdb3 /dev/sdc3 /dev/sdd3
      (I used the webmin RAID interface to create the RAID1 array because I couldn't figure out how to set the "persistent superblock" option with mdadm, although I think it is simply specifying the version 0.9 superblock...)
    3. Format the drives using
      Code:
      sudo mkfs.ext4 -E stride=8,stripe-width=32 /dev/md1
      sudo mkfs.ext4 /dev/md0
    4. Copy the boot data to the new boot partition using
      Code:
      rsync -avxHAXS --delete --progress /boot /mnt/NewRAID1/
    5. Copy the rest of the data to the new root partition using
      Code:
      rsync -avxHAXS --delete --progress / /mnt/NewRAID5/
    6. Remove boot from the new root partition (rm -R /mnt/NewRAID5/boot/*)
    7. Update /etc/fstab on the new RAID5 to mount NewRAID1 as /boot and NewRAID5 as /
    8. ???
    9. Remove primary disk and verify function with 3 disks in "degraded mode"
    10. Copy the "extradata" stuff over to the new array
    11. Test system functions thoroughly
    12. Partition primary disk same as other 3
    13. Add 4th disk to arrays and update fstab to use the 4th SWAP, too


    The ??? represents these questions:
    How do I update GRUB to use these partitions appropriately?
    How do I write GRUB to the disks (using the installer CD? I don't think it has mdadm on it...)?
    How do I copy the MBR to each of the disks? (I guess I could just "update-grub" to each of the 4 disks, right?)

    Also, if anyone has any suggestions or pointers on how I can make this better, I would love to hear them.

    Thanks!

    --mobrien118
    Last edited by mobrien118; January 6th, 2012 at 01:16 PM. Reason: Forgot a step; added mdadm and mkfs commands

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •