This commit is contained in:
Marc Beninca 2023-10-03 10:05:29 +02:00
parent 7cbe78dbc6
commit 3972d3ce39

View file

@ -129,7 +129,7 @@ else
fi fi
} }
function hetzner-rescue-wipe-12-10-10 { function hetzner-rescue-wipe-12-10-10-0 {
local device local device
local devices=( local devices=(
'/dev/sdc' '/dev/sdc'
@ -246,6 +246,33 @@ function hetzner-rescue-wipe-12-10-10 {
# open # open
echo "${passphrase}" \ echo "${passphrase}" \
| cryptsetup luksOpen '/dev/md/crypt' 'crypt' | cryptsetup luksOpen '/dev/md/crypt' 'crypt'
####
# close
cryptsetup luksClose 'crypt'
}
function hetzner-rescue-wipe-12-10-10-1 {
local passphrase
# read passphrase
echo -n 'PassPhrase: '
read -r -s passphrase
# encrypt
echo "${passphrase}" \
| cryptsetup \
--verbose \
--batch-mode \
--type 'luks2' \
--pbkdf 'argon2id' \
--cipher 'aes-xts-plain64' \
--iter-time 8192 \
--key-size 512 \
--hash 'sha512' \
--use-random \
luksFormat \
'/dev/md/crypt'
# open
echo "${passphrase}" \
| cryptsetup luksOpen '/dev/md/crypt' 'crypt'
# pv # pv
pvcreate '/dev/mapper/crypt' pvcreate '/dev/mapper/crypt'
# vg # vg