Seen few questions on this, but the general answer was just reinstall. Although that is the best and easiest solution, this unfortunately is not possible in my situation.
I was thinking of the following solution.
current partition layout
/dev/vda1 linux/boot 250mb
/dev/vda2 extended 15GiB
|_/dev/vda5 Linux LVM 15GiB
LVM has 2 LVs 13GiB /root and 2GiB /swap
it's a clean minimum vps install with a <1gb footprint. So my idea is to
- remove the swap drive
- shrink LVM partition
- create a new temp 2gb partition
- move root to temp partition
- remove LVM, set up new LVM on LUKS partition.
- move temp root to the new LVM on LUKS
- remove temp root, Resize LUKS/LVM partition back to 15gb to set up 2GB swap again.
Any reason this would not work? and if not.. I'm stuck on step 2/3
after removing swap lv I resized PV /dev/vda5 to 13GiB pvdisplay shows 13GiB correctly.
However when I go to cfdisk to create a new temp root partition, it still shows /dev/vda5 as 15GiB
I have the feeling I'm missing a step here to get that 2GiB from the removed swap drive into unpartitioned space?