This article demonstrates how to extent a LUKS encrypted volume. We’re using Ubuntu 22.04 and the volume is non-root. Although you could probably do the same on the root volume (partition). This is risky and you should not do this without a backup and understanding the likelihood of failure. This article is my notes only.
The disk is “/dev/sdb”. The partition is “/dev/sdb1”. The LUKS volume when decrypted is “/dev/mapper/secure”. We’re not using LVM.
Make sure the kernel knows about the larger disk (assuming you’ve in a VMWare or similar environment):
Delete and recreate the partition. This should result in the partition being the maximum size. When asked if you want to re-label the partition, say “no”. You want to keep it as a LUKS partition.
Now resize the LUKS volume. This only works when the LUKS volume is in an “open” state:
cryptsetup resize /dev/mapper/secure
Now extend the filesystem. We’re using EXT4. If you’re using XFS, use “xfs_growfs”:
Confirm the new disk space is available:
Now you’re done. The LUKS volume should be the maximum size.