Extend LVM when all 4 primary partitions have been taken
Solution 1:
Took the afternoon to study up on LVM and found a solution. So, my initial solution turns out to be a working solution. Here's what I did.
- Use
fdisk
to make/dev/vda4
bigger. To do that delete partition 4, re-add it as a primary partition and let it make use of all available sectors. It'll ask you about deleting the LVM2_member signature, make sure to answer no. Set partition type to Linux LVM (8e). Write the new partition table. -
pvresize /dev/vda4
. -
lvextend -l +100%FREE /dev/vg_directadmin/lv_root
. - Finally you need to resize
/dev/vg_directadmin/lv_root
with resize2fs (or xfs_growfs on CentOS 7 if I'm not mistaken). I had to do a disk check as well withe2fsck -f /dev/vg_directadmin/lv_root
followed byresize2fs /dev/vg_directadmin/lv_root
. - Finally, remount.
Hope this helps someone else. Linux LVM on HowToForge is a helpful tutorial as well!