And this will hold through the next reboot after which the partition will be decrypted using the same passphrase as for sda3 (root), and the swap will work fine, but running blkid will show no UUID on the partition, only PARTUUID. So I'm guessing on successful decryption and enabling swap something happens and the partition metadata or something gets nuked.
$ cat /etc/fstab sda3_crypt / ext4 noatime, errors= remount- ro 0 1 893a-49f4- ac53-1e2fac299a 1e /boot ext4 defaults 0 2 sda2_crypt none swap sw 0 0
#
/dev/mapper/
UUID=518c26ce-
/dev/mapper/
$ cat /etc/crypttab febc-4549- b07b-a9c927db52 c9 none luks,swap,discard eb27-4100- b94a-f7bf868072 8b none luks,discard
sda2_crypt UUID=b2a2ed64-
sda3_crypt UUID=2a8c24b1-
$ sudo blkid
/dev/mapper/ sda3_crypt: UUID="73474220- 1b0e-46bc- bba1-73fbbbc0a6 f5" TYPE="ext4" 893a-49f4- ac53-1e2fac299a 1e" TYPE="ext4" PARTUUID= "dfa3c187- 01" "dfa3c187- 02" eb27-4100- b94a-f7bf868072 8b" TYPE="crypto_LUKS" PARTUUID= "dfa3c187- 03" "06ce4633- dc19-4578- a481-bcfe0f4401 42" PTTYPE="gpt" PARTUUID= "dfa3c187- 04" 24119A5" TYPE="ntfs" PARTUUID= "a15007e4- 01" 2447FE6" TYPE="ntfs" PARTUUID= "a15007e4- 02" 29D90E0" TYPE="ntfs" PARTUUID= "a15007e4- 03" "54295cf2- f319-49df- ac11-e0530fa17b cf" PTTYPE="gpt" PARTUUID= "a15007e4- 04"
/dev/sda1: UUID="518c26ce-
/dev/sda2: PARTUUID=
/dev/sda3: UUID="2a8c24b1-
/dev/sda4: PTUUID=
/dev/sdb1: LABEL="System Reserved" UUID="62D24140D
/dev/sdb2: UUID="CC52448F5
/dev/sdb3: LABEL="WinBackup" UUID="20429DB64
/dev/sdb4: PTUUID=
The fstab and crypttab do not get changed or corrupted somehow, I've checked. So now I manually format the partition and enable swap:
$ sudo cryptsetup luksFormat /dev/sda2
...
$ sudo cryptsetup luksOpen /dev/sda2 sda2_crypt
...
$ sudo mkswap /dev/mapper/ sda2_crypt e9c5-47a7- 9473-d59dde947d 12
Setting up swapspace version 1, size = 4,7 GiB (4997509120 bytes)
no label, UUID=d570d09e-
$ sudo blkid sda3_crypt: UUID="73474220- 1b0e-46bc- bba1-73fbbbc0a6 f5" TYPE="ext4" 893a-49f4- ac53-1e2fac299a 1e" TYPE="ext4" PARTUUID= "dfa3c187- 01" eb27-4100- b94a-f7bf868072 8b" TYPE="crypto_LUKS" PARTUUID= "dfa3c187- 03" 24119A5" TYPE="ntfs" PARTUUID= "a15007e4- 01" 2447FE6" TYPE="ntfs" PARTUUID= "a15007e4- 02" 29D90E0" TYPE="ntfs" PARTUUID= "a15007e4- 03" cbac-435c- b4e5-e70cd48196 c6" TYPE="crypto_LUKS" PARTUUID= "dfa3c187- 02" "06ce4633- dc19-4578- a481-bcfe0f4401 42" PTTYPE="gpt" PARTUUID= "dfa3c187- 04" "54295cf2- f319-49df- ac11-e0530fa17b cf" PTTYPE="gpt" PARTUUID= "a15007e4- 04" sda2_crypt: UUID="d570d09e- e9c5-47a7- 9473-d59dde947d 12" TYPE="swap"
/dev/mapper/
/dev/sda1: UUID="518c26ce-
/dev/sda3: UUID="2a8c24b1-
/dev/sdb1: LABEL="System Reserved" UUID="62D24140D
/dev/sdb2: UUID="CC52448F5
/dev/sdb3: LABEL="WinBackup" UUID="20429DB64
/dev/sda2: UUID="5e035ee2-
/dev/sda4: PTUUID=
/dev/sdb4: PTUUID=
/dev/mapper/
And replace the UUID for sda2 (5e03...) in crypttab, to this:
$ cat /etc/crypttab cbac-435c- b4e5-e70cd48196 c6 none luks,swap,discard eb27-4100- b94a-f7bf868072 8b none luks,discard
sda2_crypt UUID=5e035ee2-
sda3_crypt UUID=2a8c24b1-
And this will hold through the next reboot after which the partition will be decrypted using the same passphrase as for sda3 (root), and the swap will work fine, but running blkid will show no UUID on the partition, only PARTUUID. So I'm guessing on successful decryption and enabling swap something happens and the partition metadata or something gets nuked.