18 lines
403 B
Bash
18 lines
403 B
Bash
#!/bin/bash
|
|
|
|
# Get variable from filesystem.
|
|
disk=$(</tmp/disk)2
|
|
|
|
# Encrypting partition.
|
|
echo "Encrypting system partition."
|
|
echo -e
|
|
|
|
cryptsetup -c aes-xts-plain -y -s 512 luksFormat /dev/$disk &&
|
|
echo "Partition successfully encrypted."
|
|
|
|
# Opening encrypted partition and mounting at /dev/mapper/lvm.
|
|
echo "Opening and mounting encrypted partition."
|
|
echo -e
|
|
cryptsetup luksOpen /dev/$disk lvm &&
|
|
echo
|