-
Notifications
You must be signed in to change notification settings - Fork 43
Bare Metal Raid 5
skyper edited this page Jun 16, 2023
·
8 revisions
Hetzner
Boot into rescue system and type installimage
. Select Ubuntu.
- change
HOSTNAME
- remove line
PART swap ...
(See swap-on-raid is bad) - change line
PART /
toPART / ext4 8G
REBOOT.
Continue reading Preparing the SSC.
fdisk /dev/nvme0n1
# n -> +64G
# t -> swap
# n -> +512M - new partition (for /sf/config)
# t -> 29 - type to 'Linux RAID'
# n
# t -> 29
repeat for /dev/nvme1n1
and /dev/nvme2n1
. Verify with fdisk -l
that all look the same.
addswap /dev/nvme0n1p4
addswap /dev/nvme1n1p4
addswap /dev/nvme2n1p4
swapon -a
swapon -s
mdadm --create /dev/md5 --level=5 --raid-devices=3 /dev/nvme0n1p5 /dev/nvme1n1p5 /dev/nvme2n1p5
mdadm --detail --scan --verbose /dev/md5 | head -n1 | tee -a /etc/mdadm/mdadm.conf
mdadm --create /dev/md6 --level=5 --raid-devices=3 /dev/nvme0n1p6 /dev/nvme1n1p6 /dev/nvme2n1p6
mdadm --detail --scan --verbose /dev/md6 | head -n1 | tee -a /etc/mdadm/mdadm.conf
# update-initramfs -u
addsf /dev/md6
echo LUKSPASSWORD=$(head -c 1024 /dev/urandom | tr -dc '[:alpha:]' | head -c 22)
cryptsetup luksFormat /dev/md5
cryptsetup luksOpen /dev/md5 sfluks
mkfs -t xfs /dev/mapper/sfluks
mount -o nofail,noatime /dev/mapper/sfluks /sec
mkdir /sec/config
rmdir /sf/config
ln -sf /sec/config /sf/config
After each reboot you need to:
cryptsetup luksOpen /dev/md5 sfluks
mount -o nofail,noatime /dev/mapper/sfluks /sec
Continue reading Installing the SSC.
Join us on Telegram if you have any questions or comments.