It much depends with the way your disk is partitioned, but it should be feasible if you can borrow a large enough disk to perform the migration (at least ≥170GB, ideally ≥250GB, possibly an external disk).
Things are much easier if you’re already using LVM which allows live migration.
I’d also suggest you use separate unencrypted /boot partition. (It seems that grub2 can handle encrypted /boot, but I never used it myself.)
Here are the steps I’d suggest:
- (assuming you don’t have a separate
/boot partition/volume) Use a live system to shrink your / partition/volume (or any other partition) and make enough room for a new /boot partition/volume (with resize2fs or an equivalent tool); create a new /boot partition/volume and some filesystem on it; mount your new partition somewhere and move the content of your old /boot to your new partition; update your /etc/fstab to mount the new partition at /boot; actually mount the new partition to /boot; update your ramdisk (with update-initramfs) and grub configuration (with update-grub).
- (assuming you’re not yet using LVM) On your second disk, create a physical volume, a volume group and as many logical volumes as partitions (except
/boot) on the first disk; use a live system to copy the content of each partition of the first disk to the corresponding logical volume on the second disk; (still using your live system) update your /etc/fstab to mount the new logical volumes instead of the old partitions; (still using your live system) update your /boot/grub/grub.cfg to tell the kernel where to find the new partition.
- Repartition your first disk with one small partition for /boot and a large one for the encryption. You may have to update your grub configuration if the UUID of your
/boot filesystem changed; if you’re not sure, update it with update-grub.
- Set up encryption on your new dedicated partition.
- Make your new encrypted volume a physical volume for LVM, make it part of your volume group, and move your logical volumes to the new physical volume (using
pvmove). Update your initrd and ensure it will support encryption.
- Remove the physical volume on the second disk from your volume group.
- Enjoy!
Beware, this is complex and there are many traps, probably a few ones I forgot. If you want to give it a try, I’d urge you to first give it a try with a fake system, possibly using qemu.