Update encrypt.sh
This commit is contained in:
parent
e96494d411
commit
20ad1a26fe
14
encrypt.sh
14
encrypt.sh
|
@ -1,17 +1,23 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Get variable from filesystem.
|
# Get variable from filesystem.
|
||||||
disk=$(</tmp/disk)2
|
part=$(</tmp/disk)2
|
||||||
|
|
||||||
# Encrypting partition.
|
# Encrypting partition.
|
||||||
echo "Encrypting system partition."
|
echo "Encrypting system partition."
|
||||||
echo -e
|
echo -e
|
||||||
|
|
||||||
cryptsetup -c aes-xts-plain -y -s 512 luksFormat /dev/$disk &&
|
#cryptsetup -c aes-xts-plain -y -s 512 luksFormat /dev/$part &&
|
||||||
echo "Partition successfully encrypted."
|
echo "Partition successfully encrypted."
|
||||||
|
echo -e
|
||||||
|
|
||||||
# Opening encrypted partition and mounting at /dev/mapper/lvm.
|
# Opening encrypted partition and mounting at /dev/mapper/lvm.
|
||||||
echo "Opening and mounting encrypted partition."
|
echo "Opening and mounting encrypted partition."
|
||||||
echo -e
|
echo -e
|
||||||
cryptsetup luksOpen /dev/$disk lvm &&
|
|
||||||
echo
|
#cryptsetup luksOpen /dev/$part lvm &&
|
||||||
|
echo "Partition opened and mounted:"
|
||||||
|
echo -e
|
||||||
|
|
||||||
|
disk="${part%?}"
|
||||||
|
lsblk | grep "$disk"
|
||||||
|
|
Loading…
Reference in New Issue