Re: Encrypted swap partition no longer encrypted

From: Ronald Klop <ronald-lists_at_klop.ws>
Date: Fri, 27 Aug 2021 09:10:26 UTC
Hi,

For encrypted swap you can put ".eli" behind the device name in fstab.

So change "/dev/ada0p2" to "/dev/ada0p2.eli" in the new fstab and reboot.
NB: after encryption is enabled the device is not available as dumpdev anymore.

I don't know what caused the change for you.

Regards,
Ronald.

 
Van: Graham Perrin <grahamperrin@gmail.com>
Datum: vrijdag, 27 augustus 2021 09:57
Aan: FreeBSD CURRENT <freebsd-current@freebsd.org>
Onderwerp: Encrypted swap partition no longer encrypted
> 
> Yesterday afternoon I installed FreeBSD-CURRENT to a hard disk drive, whilst it was in a dock on USB, and chose encrypted swap.
> 
> Then, ZFS send and receive to replicate data from a pool that was on the internal drive. Finally, I replaced the internal drive with the one from the dock.
> 
> Now: swap is not encrypted, this was not my intention.
> 
> Might the accident have resulted from an inappropriate change to /etc/fstab followed by a swapon command?
> 
> I did, at one point, activate and boot the wrong boot environment (because `bectl list -c creation` can no longer show the true (original) dates of creation of boot environments that were replicated).
> 
> ----
> 
> root@mowa219-gjp4-8570p-freebsd:~ # bectl mount default /tmp/huh
> Successfully mounted default at /tmp/huh
> root@mowa219-gjp4-8570p-freebsd:~ # cat /tmp/huh/etc/fstab
> # Device                Mountpoint      FStype  Options Dump    Pass#
> /dev/da0p1              /boot/efi       msdosfs rw 2       2
> /dev/da0p2.eli          none    swap    sw              0       0
> root@mowa219-gjp4-8570p-freebsd:~ # bectl umount default
> root@mowa219-gjp4-8570p-freebsd:~ # grep swap /etc/fstab | grep -v \#
> /dev/ada0p2     none                    swap sw,late                    0     0
> root@mowa219-gjp4-8570p-freebsd:~ # grep ada0 /etc/rc.conf
> dumpdev="/dev/ada0p2"
> root@mowa219-gjp4-8570p-freebsd:~ # bectl list -c creation
> BE                             Active Mountpoint Space Created
> default                        -      -          789M  2021-08-26 16:33
> n247565-b49ba74deeb-f          -      -          39.6G 2021-08-26 19:50
> n248685-c9f833abf1d-f          NR     /          49.3G 2021-08-26 21:13
> 14.0-CURRENT_2021-08-19_045942 -      -          1.09G 2021-08-26 22:41
> n248269-941650aae97-e          -      -          40.5M 2021-08-26 22:54
> n247798-f39dd6a9784-a          -      -          22.9M 2021-08-26 22:54
> n248139-3a57f08b504-b          -      -          1.21G 2021-08-26 22:54
> n248478-f3a3b061216-a          -      -          51.0M 2021-08-26 22:54
> 14.0-CURRENT_2021-08-08_145838 -      -          365M  2021-08-26 22:54
> n248269-941650aae97-b          -      -          524M  2021-08-26 22:54
> n248269-941650aae97-f          -      -          29.3M 2021-08-26 22:54
> n248478-f3a3b061216-e          -      -          579M  2021-08-26 22:54
> n248478-f3a3b061216-b          -      -          56.7M 2021-08-26 22:55
> n247798-f39dd6a9784-e          -      -          328M  2021-08-26 22:55
> n248269-941650aae97-d          -      -          260M  2021-08-26 22:55
> n248685-c9f833abf1d-e          -      -          216M  2021-08-26 22:55
> n247798-f39dd6a9784-j          -      -          4.98G 2021-08-26 22:55
> n248478-f3a3b061216-d          -      -          310M  2021-08-26 22:55
> n248478-f3a3b061216-c          -      -          101M  2021-08-26 22:55
> root@mowa219-gjp4-8570p-freebsd:~ # bectl list | sort
> 14.0-CURRENT_2021-08-08_145838 -      -          365M  2021-08-26 22:54
> 14.0-CURRENT_2021-08-19_045942 -      -          1.09G 2021-08-26 22:41
> BE                             Active Mountpoint Space Created
> default                        -      -          789M  2021-08-26 16:33
> n247565-b49ba74deeb-f          -      -          39.6G 2021-08-26 19:50
> n247798-f39dd6a9784-a          -      -          22.9M 2021-08-26 22:54
> n247798-f39dd6a9784-e          -      -          328M  2021-08-26 22:55
> n247798-f39dd6a9784-j          -      -          4.98G 2021-08-26 22:55
> n248139-3a57f08b504-b          -      -          1.21G 2021-08-26 22:54
> n248269-941650aae97-b          -      -          524M  2021-08-26 22:54
> n248269-941650aae97-d          -      -          260M  2021-08-26 22:55
> n248269-941650aae97-e          -      -          40.5M 2021-08-26 22:54
> n248269-941650aae97-f          -      -          29.3M 2021-08-26 22:54
> n248478-f3a3b061216-a          -      -          51.0M 2021-08-26 22:54
> n248478-f3a3b061216-b          -      -          56.7M 2021-08-26 22:55
> n248478-f3a3b061216-c          -      -          101M  2021-08-26 22:55
> n248478-f3a3b061216-d          -      -          310M  2021-08-26 22:55
> n248478-f3a3b061216-e          -      -          579M  2021-08-26 22:54
> n248685-c9f833abf1d-e          -      -          216M  2021-08-26 22:55
> n248685-c9f833abf1d-f          NR     /          49.3G 2021-08-26 21:13
> root@mowa219-gjp4-8570p-freebsd:~ # uname -KU
> 1400030 1400030
> root@mowa219-gjp4-8570p-freebsd:~ # uname -a
> FreeBSD mowa219-gjp4-8570p-freebsd 14.0-CURRENT FreeBSD 14.0-CURRENT #105 main-n248685-c9f833abf1d: Fri Aug 13 20:24:43 BST 2021 root@mowa219-gjp4-zbook-freebsd:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG amd64
> root@mowa219-gjp4-8570p-freebsd:~ #
> 
>  
> 
> 
>