LVM
Jump to navigation
Jump to search
LVM (specifically LVM2) is well supported by Red Hat/CentOS and is documented at https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/logical_volume_manager_administration/index
Initial Setup
parted /dev/sdX print # delete partitions with "rm <number>" if needed
parted /dev/sdX mklabel gpt
parted /dev/sdX mkpart LVM xfs 0% 100%
parted /dev/sdX print
pvdisplay
pvcreate /dev/sdX1
pvdisplay
vgdisplay
vgcreate vol_home /dev/sdX1
vgdisplay
lvcreate -l 100%FREE -n lv_home vol_home
lvdisplay
mkfs.xfs /dev/vol_home/lv_home
mkdir /mnt/home_scalable
chmod 555 /mnt/home_scalable
mount /dev/vol_home/lv_home /mnt/home_scalableExpanding
vgextend vol_home /dev/sdY1
lvextend -l 100%VG /dev/vol_home/lv_home
xfs_growfs /dev/vol_home/lv_home