How to resize logical volume(LVM) in arch
1 min readJun 3, 2024
Suppose you want to resize your root by 20G, and reduce home by 20G, here is how you go about it.
Steps
- Boot on a USB live key
- Decrypt the luks volume
cryptsetup open /dev/nvme0n1p3 luks_lvm
3. Mount partitions (i just mounted everything incase you also wanted to
swapswapon /dev/mappper/arch-swap
swapon -a
mount /dev/mapper/arch-root /mnt
mkdir -p /mnt/{home,boot}
mount /dev/nvme0n1p2 /mnt/boot
mount /dev/mapper/arch-home /mnt/home
mount /dev/nvme0n1p1 /mnt/boot/efi
arch-chroot /mnt /bin/bash
Detect volume group
vgscan
Activate volume group “arch”
vgchange -a y arch
Shrink arch-home filesystem
incase you dont have btrfs installed
pacman -S btrfsutils
btrfs filesystem resize -20g /home
Do the same to the logical volume
lvresize -L -20g arch/home
Check to see free volume , as you can see its 20G. Now we will need to add it into root volume logical volumes and filesystem respectively
lvresize -L +20g arch/root
btrfs filesystem resize +20g /
Done. xD