I have enabled full disk encryption on Ubuntu 16.04 by following this guide. But I have not yet created a swap partition for it. I would like to setup an encrypted swap partition, what I have found online is the following (Please correct me if I am wrong) -:
Steps taken from here.
First format the swap partition as an encrypted swap, but then here how do I link it to my original passphrase for booting the system ? I don't want to have a passphrase for unlocking the system and then one for the swap partition separately. Also I would like to use the same encryption key used for all the other LUKS partition.
sudo cryptsetup luksFormat --cipher aes-xts-plain64 --verify-passphrase --key-size 256 /dev/sdXN
Second I think is adding to the list of encrypted partitions (I am not sure what the function of luksOpen is yet,)
sudo cryptsetup luksOpen /dev/sdXN cryptswap1
Third is marking the partition as swap-:
sudo mkswap /dev/mapper/cryptswap1
And next steps are as in the tutorial.
Now before I try anything I want to know is this the correct way of setting up an encrypted swap for 16.04 ? Also I would like them all to be in the same setup if possible, like if I could configure the encrypted swap at install time, what would be great.
Also there is another set of instructions over here, but that brings up the same questions that how do I use the same passphrase and encryption scheme as the other partitions. Also as given in the comments the -v1
option is causing problems.
0 Answers