To set up cryptographic volumes, you need to back up the data first and restore data after the encryption is setup.rsync -Pav <source/> <backup_destination/>
Once the backup is completed, install cryptsetupsudo apt install cryptsetup
Create the encrypted partitionsudo cryptsetup --verbose --verify-passphrase luksFormat <device_name>
Provide passphrase once prompted, you could use fdisk -l to find the correct device.
Open the encrypted devicesudo cryptsetup luksOpen /dev/vdb1 vdb1
# the device name was vdb1 in my case
This will prompt the passphrase to open the device
Create the required file systemmkfs.ext4 /dev/mapper/vdb1
You could remove the ext4 reservation if not requiredtune2fs -m 0 /dev/mapper/vdb1
Create mount directorymkdir /mnt/secondary
Mount the devicemount /dev/mapper/vdb1 /mnt/secondary
Encrypt secondary disk – Linux
by
Leave a Reply