查看是否有购买的磁盘sdc(视实际情况为准,可能为sdd),如lsblk查看不到,需执行 rescan-scsi-bus.sh,进行扫描
[root@SZC-L0050177 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 60G 0 disk
|-sda1 8:1 0 200M 0 part /boot
-sda2 8:2 0 59.8G 0 part |-VolGroup00-LVroot (dm-0) 253:0 0 17.3 / |-VolGroup00-LVswap (dm-1) 253:1 0 6G 0 lvm [SWAP] |-VolGroup00-LVcloud (dm-2) 253:2 0 3G 0 lvm /opt/cloud |-VolGroup00-LVvar (dm-3) 253:3 0 25G 0 lvm /var |-VolGroup00-LVhome (dm-4) 253:4 0 500M 0 lvm /home
-VolGroup00-LVtmp (dm-5) 253:5 0 8G 0 lvm /tmp
sr0 11:0 1 1024M 0 rom
sdb 8:16 0 40G 0 disk
`-VolGroup1-LVdata1 (dm-6) 253:6 0 40G 0 lvm /wls/applogs
sdc 8:32 0 60G 0 disk
创建pv
[root@SZC-L0050177 ~]# pvcreate /dev/sdc
Physical volume “/dev/sdc” successfully created
查看vg信息,如/wls/applogs的LV卷LVdata1所在的vg为VolGroup1
[root@SZC-L0050177 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
VolGroup00 1 6 0 wz–n- 59.80g 0
VolGroup1 1 1 0 wz–n- 40.00g 0
扩容vg
[root@SZC-L0050177 ~]# vgextend VolGroup1 /dev/sdc
Volume group “VolGroup1” successfully extended
扩容LV
[root@SZC-L0050177 ~]# lvextend -l +100%FREE /dev/VolGroup1/LVdata1
Size of logical volume VolGroup1/LVdata1 changed from 40.00 GiB (10239 extents) to 99.99 GiB (25598 extents).
Logical volume LVdata1 successfully resized
查看vg、lvs
[root@SZC-L0050177 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
VolGroup00 1 6 0 wz–n- 59.80g 0
VolGroup1 2 1 0 wz–n- 99.99g 0
[root@SZC-L0050177 ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
LVcloud VolGroup00 -wi-ao---- 3.00g
LVhome VolGroup00 -wi-ao---- 500.00m
LVroot VolGroup00 -wi-ao---- 17.31g
LVswap VolGroup00 -wi-ao---- 6.00g
LVtmp VolGroup00 -wi-ao---- 8.00g
LVvar VolGroup00 -wi-ao---- 25.00g
LVdata1 VolGroup1 -wi-ao---- 99.99g
扩容文件系统(此步骤存在小概率的风险,重要数据请备份)
[root@SZC-L0050177 ~]# resize2fs /dev/mapper/VolGroup1-LVdata1
resize2fs 1.43-WIP (20-Jun-2013)
Filesystem at /dev/mapper/VolGroup1-LVdata1 is mounted on /wls/applogs; on-line resizing required
old_desc_blocks = 3, new_desc_blocks = 7
Performing an on-line resize of /dev/mapper/VolGroup1-LVdata1 to 26212352 (4k) blocks.
The filesystem on /dev/mapper/VolGroup1-LVdata1 is now 26212352 blocks long.
如果xfs,那采用xfs_growfs /dev/mapper/VolGroup1-LVdata1
pvcreate /dev/vdc
vgextend VolGroup1 /dev/vdc
lvextend -l +100%FREE /dev/VolGroup1/LVdata1
xfs_growfs /dev/mapper/VolGroup1-LVdata1
xfs类型文件系统 【lvm卷扩容案例】仅参考
最新推荐文章于 2024-01-23 20:16:16 发布