I need to resize LVM on LUKS on Debian to take space from home
and give it to var
.
└─sda5 8:5 0 931G 0 part
└─sda5_crypt 253:0 0 931G 0 crypt
├─my-vg-root 253:1 0 23.3G 0 lvm /
├─my-vg-var 253:2 0 9.3G 0 lvm /var
├─my-vg-swap_1 253:3 0 976M 0 lvm [SWAP]
├─my-vg-tmp 253:4 0 1.9G 0 lvm /tmp
└─my-vg-home 253:5 0 802.8G 0 lvm /home
I'm following the ResizeEncryptedPartitions tutorial:
- Boot the desktop, live CD. Install & configure the tools (lvm2 and cryptsetup).
- Reduce the (root) file system with resize2fs.
- Reduce the (root) (LVM) Logical Volume with lvreduce.
- Reduce the (LVM) Physical Volume with pvresize.
- Reduce the Crypt with cryptsetup.
- Reboot to reduce the Partition storing the crypt with fdisk.
The tutorial continues, instructing the reverse,
Detailed resizing ~ Enlarging an encrypted partition This section will be shorter, it is basically the reverse of the above.
My question. Do I need to reduce the (LVM) Physical Volume #4 and reduce the Crypt #5, if I'm giving this space over to another partition?
The tutorial gives a reason for resizing the LVM Physical Volume
Resize your (LVM) Physical Volume. The physical volume used by LVM can become "fragmented" in that the (LVM) Logical Volumes within the (LVM) Physical Volume are not always in order. There is no defragmentation tool, so if you may need to manually move the logical partitions (back up the data, delete the (LVM) Logical Volume, re-create a replacement (LVM) Logical Volume, restore data from backup).
I'm thinking of taking home
down, 800g-200g and var
up 9-200g, and leave 400g free to move later depending on how they both fill up.
I get the idea--delete my swap and tmp LVM partitions, then change the var size. I guess the article seems more generic, and so I'm asking here about my particular case.
Also on SE: Resize an existing LVM partition and add the space to another LVM partition