luks_format
This commit is contained in:
parent
799732c8ef
commit
6be681d0fb
1 changed files with 20 additions and 0 deletions
20
bash/fs.sh
20
bash/fs.sh
|
@ -76,3 +76,23 @@ fs_wipe() {
|
|||
dd "${@}"
|
||||
fi
|
||||
}
|
||||
|
||||
luks_format() {
|
||||
local device="${1}"
|
||||
local passphrase="${2}"
|
||||
if [ -b "${device}" ]; then
|
||||
echo "${passphrase}" |
|
||||
cryptsetup \
|
||||
--verbose \
|
||||
--batch-mode \
|
||||
--type "luks2" \
|
||||
--pbkdf "argon2id" \
|
||||
--cipher "aes-xts-plain64" \
|
||||
--iter-time 4096 \
|
||||
--key-size 512 \
|
||||
--hash "sha512" \
|
||||
--use-random \
|
||||
luksFormat \
|
||||
"${device}"
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue