一、创建
pvcreate /dev/sdb4
pvs
vgcreate ubuntu-vg /dev/sdb4
vgs
lvcreate -l 100%FREE -n data_lv ubuntu-vg
lvcreate -L 200G -n data_lv ubuntu-vg
lvs
mkfs.xfs /dev/ubuntu-vg/data_lv
mkfs.ext4 /dev/ubuntu-vg/data_lv
二、扩展
pvcreate /dev/sda1
vgextend ubuntu-vg /dev/sda1
lvextend /dev/ubuntu-vg/data_lv /dev/sda1
mount /dev/ubuntu-vg/data_lv /data
xfs_growfs /dev/ubuntu-vg/data_lv
resize2fs /dev/ubuntu-vg/data_lv
df -h
三、缩小逻辑卷
umount /data
e2fsck -f /dev/ubuntu-vg/data_lv
resize2fs /dev/ubuntu-vg/data_lv 100G
lvreduce -L 100G /dev/ubuntu-vg/data_lv
mount /dev/ubuntu-vg/data_lv /data
df -h