Resize a LUKS volume

From Wiki
Jump to: navigation, search
cryptsetup luksOpen /dev/sda2 crypt-volume to open the encrypted volume.
parted /dev/sda to extend the partition. resizepart NUMBER END.
vgchange -a n fedora_chocbar. Stop using the VG so you can do the next step.
cryptsetup luksClose crypt-volume. Close the encrypted volume for the next steps.
cryptsetup luksOpen /dev/sda2 crypt-volume. Open it again.
cryptsetup resize crypt-volume. Will automatically resize the LUKS volume to the available space.
vgchange -a y fedora_chocbar. Activate the VG.
pvresize /dev/mapper/crypt-volume. Resize the PV.
lvresize -l+100%FREE /dev/fedora_chocbar/home. Resize the LV for /home to 100% of the free space.
e2fsck -f /dev/mapper/fedora_chocbar-home. Throw some fsck magic at the resized fs.
resize2fs /dev/mapper/fedora_chocbar-home. Resize the filesystem in /home (automatically uses 100% free space)