This commit is contained in:
Marc Beninca 2024-11-13 14:30:50 +01:00
parent 2722134a0f
commit 6603c88198
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
2 changed files with 20 additions and 32 deletions

View file

@ -56,6 +56,22 @@ fs_make_fat() {
fi
}
fs_raid_create() {
if [ -n "${4}" ]; then
local name="${1}"
local uuid="${2}"
shift 2
mdadm \
--create "/dev/md/${name}" \
--level 0 \
--metadata 1 \
--name "md:${name}" \
--raid-devices ${#} \
--uuid "${uuid}" \
"${@}"
fi
}
fs_wipe() {
local device="${1}"
local buffer="${2}"
@ -103,19 +119,3 @@ luks_format() {
cryptsetup "${@}" luksFormat "${device}"
fi
}
raid_create() {
if [ -n "${4}" ]; then
local name="${1}"
local uuid="${2}"
shift 2
mdadm \
--create "/dev/md/${name}" \
--level 0 \
--metadata 1 \
--name "md:${name}" \
--raid-devices ${#} \
--uuid "${uuid}" \
"${@}"
fi
}

View file

@ -65,14 +65,8 @@ rescue_wipe_0_init_hetzner_8_8() {
for device in "${@}"; do
members+=("${device}2")
done
mdadm \
--create "/dev/md/boot" \
--level 0 \
--metadata 1 \
--name "md:boot" \
--raid-devices ${#} \
--uuid "00000000:00000000:00000000:00000002" \
"${members[@]}"
fs_raid_create \
"boot" "00000000:00000000:00000000:00000002" "${members[@]}"
#
fs_make_btrfs "/dev/md/boot" "boot" \
"00000000-0000-0000-0000-00000000000b"
@ -95,14 +89,8 @@ rescue_wipe_0_init_hetzner_8_8() {
for device in "${@}"; do
members+=("${device}1")
done
mdadm \
--create "/dev/md/crypt" \
--level 0 \
--metadata 1 \
--name "md:crypt" \
--raid-devices ${#} \
--uuid "00000000:00000000:00000000:00000001" \
"${members[@]}"
fs_raid_create \
"crypt" "00000000:00000000:00000000:00000001" "${members[@]}"
# encrypt
luks_format "${passphrase}" "/dev/md/crypt"
# open