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.
- 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:
- Partition my 3 currently empty 2TB disks with the layout above
- Create the RAID1 and RAID5 arrays in "degraded" mode using(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...)Code:mdadm --create --verbose /dev/md1 --level=5 --chunk=32 --raid-devices=4 missing /dev/sdb3 /dev/sdc3 /dev/sdd3
- Format the drives usingCode:sudo mkfs.ext4 -E stride=8,stripe-width=32 /dev/md1 sudo mkfs.ext4 /dev/md0
- Copy the boot data to the new boot partition usingCode:rsync -avxHAXS --delete --progress /boot /mnt/NewRAID1/
- Copy the rest of the data to the new root partition usingCode:rsync -avxHAXS --delete --progress / /mnt/NewRAID5/
- Remove boot from the new root partition (rm -R /mnt/NewRAID5/boot/*)
- Update /etc/fstab on the new RAID5 to mount NewRAID1 as /boot and NewRAID5 as /
- Remove primary disk and verify function with 3 disks in "degraded mode"
- Copy the "extradata" stuff over to the new array
- Test system functions thoroughly
- Partition primary disk same as other 3
- 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.