for i in /sys/class/scsi_host/*; do echo "- - -" > $i/scan; done #磁盘刷新
fdisk -l #查看磁盘信息
pvcreate /dev/sdb #将新添加的硬盘sdb加入pv卷组
pvs
vgs #查看vg卷信息
vgextend vg00 /dev/sdb #扩展vg卷
vgs #查看结果
lvs
lvextend -l +100%free /dev/vg00/lvroot #把vg卷全部扩展到lv卷组
df -Th #查看lv卷组文件系统信息
xfs_growfs /dev/vg00/lvroot # 同步xfs系统
df -Th #查看结果
#EXT4系统
[root@10_32_69_82 ~]# resize2fs /dev/vg00/lvdata #同步ext4系统
重新创建lv卷
[root@10_56_86_124 ~]# for i in /sys/class/scsi_host/*; do echo "- - -" > $i/scan; done
#创建pv
[root@10_56_86_124 ~]# pvcreate /dev/sdb
Physical volume "/dev/sdb" successfully created.
#创建vg
[root@10_56_86_124 ~]# vgcreate vg01 /dev/sdb
Volume group "vg01" successfully created
#要求加1T直接加报错,先加一部分,再扩展
[root@10_56_86_124 ~]# lvcreate -L 500g -n lvdata vg01
Logical volume "lvdata" created.
[root@10_56_86_124 ~]# lvextend -l +100%free /dev/vg01/lvdata
[root@10_56_86_124 ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Conver lvdata vg01 -wi-a----- <1024.00g
#格式化文件系统
[root@10_56_86_124 ~]# mkfs.xfs /dev/vg01/lvdata
#创建挂载目录
[root@10_56_86_124 ~]# mkdir /data
#永久挂载
[root@10_56_86_124 ~]# vim /etc/fstab
/dev/mapper/vg01-lvdata /data xfs defaults 0 0
[root@10_56_86_124 ~]# mount -a
标签:10,56,86,手动,扩展,dev,LV,124,root
From: https://www.cnblogs.com/Xkf-IE/p/18180057