After setting up a Debian system which did not choose to use encryption during the installer, do these steps to encrypt sda3 partition so we have encrypted rootfs. Follow these steps when booted from another disk so we can off-line encrypt the rootfs:
- Mount the btrfs rootfs to /mnt:
mount /dev/sda3 /mnt
- See the current size and devid of the btrfs filesystem (likely your filesystem will be devid 1):
btrfs filesystem show --mbytes /mnt
- Resize the filesystem to be 32MiB smaller so we can fit a LUKS header at the end of the partition:
btrfs filesystem resize 1:-32M /mnt
- Verify that the filesystem is actually smaller now:
btrfs filesystem show --mbytes /mnt
- Unmount the filesystem:
umount /mnt
- Check the filesystem to ensure no errors:
btrfs check /dev/sda3
- Encrypt the filesystem in-place (this will take a while):
cryptsetup reencrypt --encrypt --verify-passphrase --reduce-device-size 32M /dev/sda3
- Unlock the partition and name it "ssd" so we can mount it: `cryptsetup open /de