Last active
August 14, 2021 07:27
-
-
Save xanoni/c6821c0d78fc957e0d47a8d865d3330a to your computer and use it in GitHub Desktop.
Revisions
-
xanoni revised this gist
Aug 14, 2021 . 1 changed file with 1 addition and 48 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,48 +1 @@ Moved here: https://github.com/xanoni/RaspberryPi-4B-LUKS-Scripts/blob/main/scripts/luks-create-4k-drive.sh -
xanoni created this gist
Aug 10, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,48 @@ #! /usr/bin/env -S bash -ex #DRIVE="/dev/sdd2" #LABEL="croot" #OFFSET=65528 # 2nd partition DRIVE="/dev/sdd3" LABEL="cblocks" #OFFSET=64256 # 3rd partition OFFSET=$((1024*8)) BS=4096 #BS=512 CIPHER="xchacha12,aes-adiantum-plain64" #CIPHER="xchacha20,aes-adiantum-plain64" KEY_SIZE=256 #CIPHER="aes-xts-plain64" #KEY_SIZE=512 HASH="sha512" ITER_TIME=4000 umount "/mnt/${LABEL}" || true cryptdisks_stop "${LABEL}" cryptsetup \ --cipher="${CIPHER}" --label="${LABEL}" --key-size="${KEY_SIZE}" \ --hash="${HASH}" --sector-size="${BS}" --offset="${OFFSET}" \ --iter-time="${ITER_TIME}" --debug \ luksFormat "${DRIVE}" cryptsetup \ --persistent --allow-discards --debug \ luksOpen "${DRIVE}" "${LABEL}" #mkfs.ext4 "/dev/mapper/${LABEL}" mkfs.ext4 -b "${BS}" "/dev/mapper/${LABEL}" mkdir "/mnt/${LABEL}" || true mount "/dev/mapper/${LABEL}" "/mnt/${LABEL}" # Nocrypt #mkfs.ext4 -b "${BS}" "${DRIVE}" #mkdir "/mnt/${LABEL}" || true #mount "${DRIVE}" "/mnt/${LABEL}"