Burocrati, Amministratori, wegan
111
contributi
(Final edit, everything should be there) |
m (Typos and fixes) |
||
Riga 24: | Riga 24: | ||
First a layout of the partition befor the RAID | First a layout of the partition befor the RAID | ||
sda | sda 8:0 0 114.5G 0 disk | ||
├─sda1 | ├─sda1 8:1 0 243M 0 part /boot | ||
├─sda2 | ├─sda2 8:2 0 1K 0 part | ||
└─sda5 | └─sda5 8:5 0 114.3G 0 part | ||
├─bitarno--system-root 253:0 0 30G 0 lvm / | |||
└─bitarno--system-swap 253:3 0 4G 0 lvm [SWAP] | |||
And after the switch | And after the switch | ||
Riga 49: | Riga 49: | ||
├─ba--system-root 253:0 0 30G 0 lvm / | ├─ba--system-root 253:0 0 30G 0 lvm / | ||
└─ba--system-swap 253:3 0 4G 0 lvm [SWAP] | └─ba--system-swap 253:3 0 4G 0 lvm [SWAP] | ||
The fifth partition is an extended one which contains the RAID one | |||
In this way we have two arrays, one for the boot and one for the LVM which contains the root and the swap | In this way we have two arrays, one for the boot and one for the LVM which contains the root and the swap | ||
Riga 71: | Riga 73: | ||
rsync -avPh /boot /mnt | rsync -avPh /boot /mnt | ||
sync && umount /mnt | sync && umount /mnt | ||
We were done with /boot, | We were done with /boot, and we needed to create the LVM volumes: | ||
First we marked /dev/md2 as LVM member then we told LVM /dev/md2 was a device it could use | First we marked /dev/md2 as LVM member with fdisk then we told LVM /dev/md2 was a device it could use | ||
pvcreate /dev/md2 | pvcreate /dev/md2 | ||
Riga 99: | Riga 101: | ||
mount /dev/md1 /mnt/new/boot | mount /dev/md1 /mnt/new/boot | ||
And arch-chroot'ed into it | And arch-chroot'ed into it. Arch-chroot is a wonderfull piece of software that saves you from bind mounting /dev /proc and /sys in the chroot | ||
arch-chroot /mnt/new | arch-chroot /mnt/new | ||
Riga 122: | Riga 124: | ||
We exited from the chroot, unmounted everything, rebooted and kept our finger crossed till the password prompt of the root-on-RAID booted system. | We exited from the chroot, unmounted everything, rebooted and kept our finger crossed till the password prompt of the root-on-RAID booted system. | ||
This last step I simplified, we made several errors and had to boot into live several times, | This last step I simplified it, we made several errors and had to boot into live several times, as we kept forgetting to add the needed modules and command lines arguments | ||
To be sure to boot from the raid root you can edit the grub entry before booting, make sure it's like the following | To be sure to boot from the raid root you can edit the grub entry before booting, make sure it's like the following | ||
Riga 147: | Riga 149: | ||
sfdisk /dev/sda < /tmp/savetablesde | sfdisk /dev/sda < /tmp/savetablesde | ||
We added the partitions to the array | |||
mdadm /dev/md1 --add /dev/sda1 | mdadm /dev/md1 --add /dev/sda1 | ||
mdadm /dev/md2 --add /dev/sda5 | mdadm /dev/md2 --add /dev/sda5 | ||
Riga 153: | Riga 155: | ||
DONE! | DONE! | ||
We then checked the status of the resync of mdadm with | |||
cat /proc/mdstat | cat /proc/mdstat | ||