Linux: Resize Encrypted LVM Partition Size
Shrink, Grow your Encrypted Harddrive, using Cryptsetup, LUKS, LVM and PartedMagic.
Useful for Kali Linux

If you’ve ever installed a version of Linux (Such as Kali Linux) which automagically encrypts your harddrives, with a pre-defined harddrive layout, then you know that sometimes you’re going to need extra space on one of your volumes, such as when /home is only partially used, and /root needs much more space.

In this case, I’d suggest using the following technique to reduce the size of your /home LVM partition, and increase the size of your / (root) partition.

Please use a recovery software OS, such that you’re not logged in to the live system which you wish to modify. I prefer Parted Magic.


root@partedmagic:/# cryptsetup luksOpen /dev/sda5 enc-pv

root@partedmagic:/# vgscan --mknodes

root@partedmagic:/# vgchange -ay

root@partedmagic:/# e2fsck -f /dev/mapper/dora-home

root@partedmagic:/# resize2fs /dev/mapper/dora-home 225G

root@partedmagic:/# lvresize -L 225G /dev/mapper/dora-home

root@partedmagic:/# lvdisplay /dev/mapper/dora-home

root@partedmagic:/# vgdisplay dora

root@partedmagic:/# lvresize -L +55.67GB /dev/mapper/enc-pv

root@partedmagic:/# e2fsck -f /dev/mapper/dora-root

root@partedmagic:/# resize2fs -p /dev/mapper/dora-root

Thanks to:

http://www.tcpdump.com/kb/os/linux/lvm-resizing-guide/all-pages.html

http://jootamam.net/howto-basic-cryptsetup.htm

Leave a Reply