Thread: Convert system to RAID5
hello,
update post specifics work through process, , respond comments have questions have not solved.
i'll try make short possible. end goal have system using raid5, made current system has multiple partitions.
current setup:
- 2tb drive
- swap partition - 2gb
- / partition - 20gb
- /home partition - rest
- 750gb drive
- swap partition - 2gb
- /home/myuser/xtradata partition - rest
acquired 3 more of same 2tb disk have. end system 4 identically partitioned disks, each 1 this:
- swap partition - 2gb
- raid1 - /boot - 1gb
- raid5 - / - rest
raid1 partition 4 disk raid1 (i know writes slower, /boot partition, , want disks "swapppable" same mbr can pull damaged disk , run in degraded mode, if necessary)
so, lay out plan current holes , questions. here goes:
- partition 3 empty 2tb disks layout above
- create raid1 , raid5 arrays in "degraded" mode using
(i used webmin raid interface create raid1 array because couldn't figure out how set "persistent superblock" option mdadm, although think specifying 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 drives using
code:sudo mkfs.ext4 -e stride=8,stripe-width=32 /dev/md1 sudo mkfs.ext4 /dev/md0- copy boot data new boot partition using
code:rsync -avxhaxs --delete --progress /boot /mnt/newraid1/- copy rest of data new root partition using
code:rsync -avxhaxs --delete --progress / /mnt/newraid5/- remove boot new root partition (rm -r /mnt/newraid5/boot/*)
- update /etc/fstab on new raid5 mount newraid1 /boot , newraid5 /
- ???
- remove primary disk , verify function 3 disks in "degraded mode"
- copy "extradata" stuff on new array
- test system functions thoroughly
- partition primary disk same other 3
- add 4th disk arrays , update fstab use 4th swap, too
??? represents these questions:
how update grub use these partitions appropriately?
how write grub disks (using installer cd? don't think has mdadm on it...)?
how copy mbr each of disks? (i guess "update-grub" each of 4 disks, right?)
also, if has suggestions or pointers on how can make better, love hear them.
thanks!
--mobrien118
ok, finished this! , made major changes in direction, here procedure. if admin move tutorials/howtos folder, maybe helpful. how 1 request that?
anyway, discovered can boot raid5 array grub2, decided change partitioning scheme this:
- raid5 - swap - 2gb
- raid5 - / - 10gb
- raid5 - {mirror of /} - 10gb
- raid5 - /home - rest
structurally mimics current partitioning scheme.
here process:
- partition 3 empty 2tb disks layout above
- create raid5 arrays in "degraded" mode using
*y=0,1,2 , 3 , x=1,2,3 , 4code:mdadm --create --verbose /dev/mdy --level=5 --chunk=32 --raid-devices=4 missing /dev/sdbx /dev/sdcx /dev/sddx- format swap using
code:mkswap /dev/md0- format drives using
*x=1,2 , 3code:sudo mkfs.ext4 -e stride=8,stripe-width=32 /dev/mdx- mount last raid array using
code:sudo mkdir /mnt/newraid1 sudo mount /dev/md3 /mnt/newraid1/- copy /home data new boot partition using
code:rsync -avxhaxs --delete --progress /home/ /mnt/newraid1/- boot alternative livecd, tell assemble raid arrays (but don't set shell root) , start shell
- mount original root (sdb2) , new root (md1) *it wasn't md1 @ point. had find using ls -l /dev/disk/by-uuid/
- copy old root new root using
code:cp -a /media/sdb2/* /media/md1/- mount home partition should using
code:mount /dev/md3 /media/md1/home- chroot *new* filesystem using
code:mount -o bind /proc /mount/point/proc mount -o bind /dev /media/md1/dev mount -o bind /dev/pts /media/md1/dev/pts mount -o bind /sys /media/md1/sys cp /etc/resolv.conf /media/md1/etc/resolv.conf chroot /media/md1- update grub on *new* disks using
code:mv /boot/grub/device.map /boot/grub/device.map.old grub-mkdevicemap update-grub2 grub-install /dev/sdc grub-install /dev/sdd grub-install /dev/sde- shutdown , remove old primary disk system
- boot new system
- mount old "extra data" partition
- copy data old "extra data" partition, since wasn't copied on in rsync of /home using
code:sudo rsync -avxhaxs --delete --progress /media/oldxtrapart/ /home/me/xtradata/- test system functions thoroughly
- partition primary disk same other 3 (i copied mbr using "dd if=/dev/sdb of=/dev/sda bs=512 count=1. requires reboot)
- add 4th disk partitions arrays (i did using webmin, can done using palimpsest or, of course, mdadm command line)
- wait until 4th disk starts rebuilsding , *reboot* (because grub needs system have been booted current disk configuration, wouldn't work before rebooting)
- repeat grub-install process above, using /dev/sda (or whatever now)
has system running nicely. read speeds on first partition on 400 mb/s , @ end of 4th partition, i'm getting 200 mb/s, @ beginning of partition @ 330 , has round downward slope.
woohoo!
--mobrien118
Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [ubuntu] Convert system to RAID5
Ubuntu
Comments
Post a Comment