Arch-Linux-Installer/encrypt.sh

24 lines
493 B
Bash
Raw Normal View History

2022-02-12 17:05:23 +01:00
#!/bin/bash
# Get variable from filesystem.
2022-02-12 17:07:49 +01:00
part=$(</tmp/disk)2
2022-02-12 17:05:23 +01:00
# Encrypting partition.
echo "Encrypting system partition."
echo -e
2022-02-12 17:07:49 +01:00
#cryptsetup -c aes-xts-plain -y -s 512 luksFormat /dev/$part &&
2022-02-12 17:05:23 +01:00
echo "Partition successfully encrypted."
2022-02-12 17:07:49 +01:00
echo -e
2022-02-12 17:05:23 +01:00
# Opening encrypted partition and mounting at /dev/mapper/lvm.
echo "Opening and mounting encrypted partition."
echo -e
2022-02-12 17:07:49 +01:00
#cryptsetup luksOpen /dev/$part lvm &&
echo "Partition opened and mounted:"
echo -e
disk="${part%?}"
lsblk | grep "$disk"