Mercurial > hg > Blog
diff content/Linux/software-raid-setup.md @ 98:1d9382b0329b
Specify the syntax on markdown blocks to avoid broken output that has class=err
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Thu, 19 Dec 2019 10:04:33 +0100 |
parents | abc2401e9958 |
children |
line wrap: on
line diff
--- a/content/Linux/software-raid-setup.md Thu Dec 19 09:31:57 2019 +0100 +++ b/content/Linux/software-raid-setup.md Thu Dec 19 10:04:33 2019 +0100 @@ -9,6 +9,7 @@ The first step of the setup is partitioning the drives. The [handbook](https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks) suggests adding a small partition at the beginning of the drive to enable booting from a gpt partitioned drive. The `/boot` partition will be formatted using [ext4](https://en.wikipedia.org/wiki/Ext4) because the filesystem will remain bootable even if one of the drives is missing. The rest of the disk will be formatted using [xfs](https://en.wikipedia.org/wiki/XFS). To recap the layout: + :::shell Number Start End Size File system Name Flags 1 1.00MiB 3.00MiB 2.00MiB grub bios_grub 2 3.00MiB 95.0MiB 92.0MiB boot @@ -18,14 +19,17 @@ Now let's create a RAID 1 for the boot partition: + :::shell mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb2 /dev/sdc2 and for the rootfs: + :::shell mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sdb3 /dev/sdc3 To maintain the RAID device numbering even after reboot, the RAID config has to be saved. This will be done by - + + :::shell mdadm --detail --scan >> /etc/mdadm.conf Then create an ext4 filesystem on `/dev/md0` and an xfs filesystem on `/dev/md1`. Nothing noteworthy here. @@ -34,6 +38,7 @@ After chrooting into the new system some changes have to be made to the [genkernel](https://wiki.gentoo.org/wiki/Genkernel) config in order to produce a RAID enabled initramfs. In `/etc/genkernel.conf` set + :::shell MDADM="yes" MDADM_CONFIG="/etc/mdadm.conf" @@ -41,6 +46,7 @@ While it's compiling, edit `/etc/default/grub` (I'm of course using [grub2](https://www.gnu.org/software/grub/manual/grub.html) for booting) and add + :::shell GRUB_CMDLINE_LINUX="domdadm" Setup grub on both devices individually using `grub-install /dev/sdb` and `grub-install /dev/sdc`.