itjc.net

Archlinux - resize LUKS encrypted partitions

My linux distro of choice is Archlinux, for a number of reasons I won't repeat here. Security best practice requires using full disk encryption (in combination with other best practices of course).

Like most linux distros, Archlinux has a wealth of knowledge in their documentation. Even though the learning curve for Arch might be steeper than, say, Ubuntu Debian, in most case there are only two requirements to getting a particular goal accomplished.

  • Do you have an idea of what you're trying to do?
  • Do you know how to read?

If the answer to both those questions is yes, detailed step by step guide to just about anything Archlinux is just a few keystrokes away.

 

Here's an example. My Arch install is on a LUKS encrypted LVM partition. This means that there is a tiny boot partition, and the rest of the drive is supposed to look like random data. It should be impossible to tell the difference between the root partition, the home partition, and the swap partition, which are logical partitions within the LVM group.

When I set this up, I made a mistake in the partition sizes, which didn't become apparent until a few weeks later, when my home directory started running out of disk space.

The gnome GTK utilities for partition management are not encryption friendly.

 

# lvdisplay

This will tell you the names and sizes of your logical volumes, just in case you've forgotten.

# vgdisplay

This will tell you the names and stats of your volume groups.

# lvextend -L 20G VolGroup00/lvolhome (or lvresize -L +5G VolGroup00/lvolhome)

# resize2fs /dev/VolGroup00/lvolhome size

These two commands will let you extend first the logical volume, and then resize the filesystem to match. Simply replace the size with the size you want, within the limits of the freespace in your volume group. Replace the path with the path of your own volume group and logical volumes if they weren't setup with the default names.

I give all credit the the Archlinux wiki, https://wiki.archlinux.org/index.php/LVM, who have helped me out many many times. They not only tell you the commands, they also explain the why and how.


options

 

TeamViewer for Remote Support Remote Support