User Tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
install_gentoo_raid1 [2025/05/05 07:38] normaninstall_gentoo_raid1 [2025/06/22 09:35] (current) – [Install GRUB] norman
Line 1: Line 1:
-====== How to create Linux system disks with RAID1 hard drive setup ======+====== How to create Gentoo system disks with RAID1 hard drive setup ======
  
 Create partitions on both disks with same configuration. Create partitions on both disks with same configuration.
Line 5: Line 5:
 <code>parted -a opt /dev/sda <code>parted -a opt /dev/sda
 mklabel gpt mklabel gpt
-mkpart primary ext2 1 2mb +mkpart primary xfs 1 2mb 
-mkpart primary ext2 2mb 2000mb +mkpart primary xfs 2mb 2000mb 
-mkpart primary ext2 2000mb 10000mb +mkpart primary xfs 2000mb 12000mb 
-mkpart primary ext2 10000mb -1+mkpart primary xfs 12000mb -1
 name 1 grub name 1 grub
 name 2 boot name 2 boot
Line 25: Line 25:
  
 <code> <code>
-mdadm — create — name=server:boot — verbose /dev/md125 — level=1 — raid-devices=2 /dev/sda2 /dev/sdb2 +mdadm --create --verbose /dev/md11 --level=1 --raid-devices=2 /dev/sda2 /dev/sdb2 
-mdadm — create — name=server:swap — verbose /dev/md126 — level=1 — raid-devices=2 /dev/sda3 /dev/sdb3 +mdadm --create --verbose /dev/md12 --level=1 --raid-devices=2 /dev/sda3 /dev/sdb3 
-mdadm — create — name=server:root — verbose /dev/md127 — level=1 — raid-devices=2 /dev/sda4 /dev/sdb4+mdadm --create --verbose /dev/md13 --level=1 --raid-devices=2 /dev/sda4 /dev/sdb4
 </code> </code>
  
 <code> <code>
-mkswap /dev/md126 && swapon /dev/md126 +mkswap /dev/md12 && swapon /dev/md12 
-mkfs.xfs /dev/md125 +mkfs.xfs /dev/md11 
-mkfs.xfs /dev/md127+mkfs.xfs /dev/md13
 </code> </code>
 +##################################
 +
 +====== Enter Installed System From Install Cd ======
 +
 +1. Boot up with the Gentoo minimal cd.
 +
 +2. Mount your gentoo partitions...
 +
 +<code>mount /dev/sda3 /mnt/gentoo</code>
 +<code>mount /dev/sda1 /mnt/gentoo/boot</code>
 +<code>mount -t proc none /mnt/gentoo/proc</code>
 +<code>mount -o bind /dev /mnt/gentoo/dev</code>
 +<code>mount --rbind /sys /mnt/gentoo/sys</code>
 +<code>mount --rbind /dev /mnt/gentoo/dev</code>
 +
 +
 +3. chroot into the install gentoo environment...
 +
 +<code>cd /mnt/gentoo</code>
 +<code>chroot /mnt/gentoo /bin/bash</code>
 +<code>env-update</code>
 +<code>source /etc/profile</code>
 +
 +
 +====== Add LVM and RAID support at boot time ======
 +genkernel is** Deprecated**  Use sys-kernel/installkernel instead.
 +
 +<code>
 +<del>genkernel --lvm --mdadm --install initramfs</del>
 +</code>
 +
 +===== Install GRUB =====
 +
 +
 +If need To install GRUB, need to enter installed Gentoo system: 
 +[[gentoo_env|Enter Installed System From Install Cd]]
 +
 +
 +and install GRUB2 on both physical disks with RAID support
 +<code>emerge — ask sys-boot/grub:2
 +emerge mdadm
 +grub-install /dev/sda
 +grub-install /dev/sdb
 +grub-mkconfig -o /boot/grub/grub.cfg
 +</code>
 +
 +
 +add RAID support at initial boot sequence
 +add <code>GRUB_CMDLINE_LINUX_DEFAULT="domdadm dolvm" to /etc/default/grub</code>
 +(Gento):
 +<code>
 +GRUB_CMDLINE_LINUX_DEFAULT="domdadm dolvm"
 +</code>
 +
 +list HDD UUID’s
 +<code>blkid</code>
 +
 +add HDD UUID’s to fstab file
 +<code>nano -w /etc/fstab
 +UUID=cce19bb0–9ec1–4417-b18d-69b9b9eb610a /boot xfs defaults,noatime 0 2
 +UUID=eb55e616–2951–42db-be28–880f66f1d185 none swap sw 0 0
 +UUID=748ec6a3-be66–4b5b-a73b-da5f066baaf4 / xfs noatime 0 1</code>
  
 Source: [[https://medium.com/@ristic.sasa/how-to-install-gentoo-linux-with-raid1-hard-drive-setup-virtualbox-tested-208addd69a95|How to install Gentoo Linux with RAID1 hard drive setup (VirtualBox tested)]] Source: [[https://medium.com/@ristic.sasa/how-to-install-gentoo-linux-with-raid1-hard-drive-setup-virtualbox-tested-208addd69a95|How to install Gentoo Linux with RAID1 hard drive setup (VirtualBox tested)]]
 +
 + Add records to mdadm.conf file:
 +<code>
 +mdadm --detail --scan >> /etc/mdadm/mdadm.conf
 +</code>
 +