You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
686 B
Bash

#!/bin/bash
set -e
# / 440GB
# /boot 2GB
# /boot/efi 1GB
# free 7GB
parted /dev/nvme0n1 mklabel gpt
parted /dev/nvme0n1 mkpart primary 1 440GB
parted /dev/nvme0n1 mkpart primary 440GB 442GB
parted /dev/nvme0n1 mkpart primary 442GB 443GB
# set flag for ESP
parted /dev/nvme0n1 set 3 boot on
parted /dev/nvme1n1 mklabel gpt
parted /dev/nvme1n1 mkpart primary 1 440GB
parted /dev/nvme1n1 mkpart primary 440GB 442GB
parted /dev/nvme1n1 mkpart primary 442GB 443GB
# set flag for ESP
parted /dev/nvme1n1 set 3 boot on
sleep 1
# $1=hostname
echo 'yes' | mdadm -C /dev/md0 --homehost="$1" -l1 -n2 /dev/nvme[01]n1p1
echo 'yes' | mdadm -C /dev/md1 --homehost="$1" -l1 -n2 /dev/nvme[01]n1p2