diff --git a/hardware/ovh/parted.sh b/hardware/ovh/parted.sh index e61fda1..7a768c4 100755 --- a/hardware/ovh/parted.sh +++ b/hardware/ovh/parted.sh @@ -1,6 +1,7 @@ #!/bin/bash set -e + # root 440GiB # boot 2GiB # free 5GiB @@ -14,5 +15,6 @@ parted /dev/sdb mkpart primary 440GiB 442GiB sleep 1 -echo 'yes' | mdadm -C /dev/md0 -l1 -n2 /dev/sd[ab]1 -echo 'yes' | mdadm -C /dev/md1 -l1 -n2 /dev/sd[ab]2 +# $1=hostname +echo 'yes' | mdadm -C /dev/md0 --homehost="$1" -l1 -n2 /dev/sd[ab]1 +echo 'yes' | mdadm -C /dev/md1 --homehost="$1" -l1 -n2 /dev/sd[ab]2 diff --git a/post-debootstrap-installer.sh b/post-debootstrap-installer.sh index 9306f4a..9311ce2 100755 --- a/post-debootstrap-installer.sh +++ b/post-debootstrap-installer.sh @@ -18,7 +18,7 @@ apt-get -y install locales apt-get -y install mdadm cryptsetup btrfs-tools # replace rescue system hostname with real hostname -mdadm --examine --scan | perl -pe 's/name\=.*?:/name='"$(cat /etc/hostname)"':/' > /etc/mdadm/mdadm.conf +mdadm --examine --scan | perl -pe 's/.*\/dev\/md\/?([0-9]+) .*UUID\=(.+?) .*/ARRAY \/dev\/md$1 UUID=$2/' > /etc/mdadm/mdadm.conf # after cryptsetup, mdadm, ... because of update-initramfs apt-get -y install linux-image-amd64 diff --git a/setup.sh b/setup.sh index a7a06e0..72e90a6 100755 --- a/setup.sh +++ b/setup.sh @@ -6,7 +6,7 @@ apt-get -y install mdadm btrfs-tools # returns /dev/md0 as root device # returns /dev/md1 as boot device -"./hardware/${1}/parted.sh" +"./hardware/${1}/parted.sh" "$2" # encrypt and unlock root device echo 'Enter luks password: '