LVM

From Define Wiki
Revision as of 15:30, 9 January 2018 by Mike (talk | contribs) (LVM2 expanding of xfs file system.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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_scalable

Expanding

vgextend vol_home /dev/sdY1

lvextend -l 100%VG /dev/vol_home/lv_home

xfs_growfs /dev/vol_home/lv_home