diff --git a/misc/luks-mirror.sh b/misc/luks-mirror.sh index 3705da0..8685efc 100755 --- a/misc/luks-mirror.sh +++ b/misc/luks-mirror.sh @@ -1,14 +1,11 @@ #!/usr/bin/env bash -set -e -read -p "Path to new LUKS device 1: " blkdevA -read -p "Path to new LUKS device 2: " blkdevB -set -x +set -ex -cryptsetup -y -v luksFormat "$blkdevA" -cryptsetup -y -v luksFormat "$blkdevB" -cryptsetup --allow-discards open "$blkdevA" cryptroot1 -cryptsetup --allow-discards open "$blkdevB" cryptroot2 +cryptsetup -y -v luksFormat "/dev/disk/by-partlabel/_root1" +cryptsetup -y -v luksFormat "/dev/disk/by-partlabel/_root2" +cryptsetup --allow-discards open "/dev/disk/by-partlabel/_root1" cryptroot1 +cryptsetup --allow-discards open "/dev/disk/by-partlabel/_root2" cryptroot2 mkfs.btrfs -f -L_root -mraid1 -draid1 /dev/mapper/cryptroot1 /dev/mapper/cryptroot2 mount /dev/disk/by-label/_root /mnt -o discard,compress=zstd:1 diff --git a/misc/luks-single.sh b/misc/luks-single.sh index b7e7014..b6e6c17 100755 --- a/misc/luks-single.sh +++ b/misc/luks-single.sh @@ -1,11 +1,9 @@ #!/usr/bin/env bash -set -e -read -p "Path to new LUKS device: " blkdev -set -x +set -ex -cryptsetup -y -v luksFormat "$blkdev" -cryptsetup --allow-discards open "$blkdev" cryptroot +cryptsetup -y -v luksFormat "/dev/disk/by-partlabel/_root" +cryptsetup --allow-discards open "/dev/disk/by-partlabel/_root" cryptroot mkfs.btrfs -f -L_root /dev/mapper/cryptroot mount /dev/disk/by-label/_root /mnt -o discard,compress=zstd:1