Contents
How do I shrink encrypted LVM?
Reduce an encrypted partition
- Boot the desktop, live CD.
- 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.
How do I increase Luks partition?
- with LUKS encrypted volume opened and the opened volume mapped as opened-volume , execute sudo cryptsetup resize /dev/mapper/opened-volume.
- then resize the file system. If it is Ext4, you can resize a mounted file system sudo resize2fs /dev/mapper/opened-volume.
When do you need to shrink a LVM partition?
Situation where you need to shrink lvm partition or file system are rare due to the plenty of storage space we have nowadays, but first let’s clarify one thing, the correct term is this : some time we need to shrink, reduce or resize an LV (logical volume) file system, which can be an ext3, ext4 or other.
Is there a way to shrink a root volume?
Root volumes can only be shrunk by unmounting the file system which requires booting into a Live CD to complete the work. For non-root volumes the file system must first be unmounted so that you can shrink the volume. First the file system was checked, then reduced.
How can I shrink the size of my file system?
The command below will shrink the file system so that it is only 4G in size total, note that what ever size you specify to shrink to you must have in free space within the file system otherwise you must first delete data. Once the file system has been reduced, we can shrink the size of the logical volume with the lvreduce command.
Can You unmount a non root volume in LVM?
Alternatively if the volume you are shrinking is a non-root volume, that is any other volume not mounted to the root of the file system, you can unmount the volume as shown below to proceed.