1、查看VG属性
root@rzcs:/#vgdisplay -v /dev/vg02
--- Volume groups ---
VG Name /dev/vg02
VG Write Access read/write
VG Status available
Max LV 2047
Cur LV 2
Open LV 2
Cur Snapshot LV 0
Max PV 2048Cur PV 2
Act PV 2
Max PE per PV 4800
VGDA 4
PE Size (Mbytes) 64
Unshare unit size (Kbytes) 1024
Total PE 4800
Alloc PE 4799
Current pre-allocated PE 0
Free PE 1
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
VG Version 2.2
VG Max Size 300gVG Max Extents 4800
Cur Snapshot Capacity 0p
Max Snapshot Capacity 300g
可以看出,该VG最大只能300G,显然不能满足我们需求,此时即使使用vgextend扩展也无用,因此需要修改VG的最大大小“VG Max Size”
2、修改VG属性
命令和语法:
Usage:
For deactivated version 1.0 volume groups,
vgmodify
[-v]
[-n]
[-r]
[-e MaxPhysicalExtents]
[-p MaxPhysicalVolumes]
[-l MaxLogicalVolumes]
VolumeGroupName
vgmodify -B bootable
[-n]
[-r]
[-v]
[-e MaxPhysicalExtents]
[-p MaxPhysicalVolumes]
[-l MaxLogicalVolumes]
VolumeGroupName pv_path...
vgmodify -o
[-v]
[-r]
VolumeGroupName
vgmodify -o -B bootable
[-v]
[-r]
VolumeGroupName pv_path...
vgmodify -C DLC_Size
[-r]
VolumeGroupName pv_path
For activated version 1.0 volume groups,
vgmodify -a
[-v]
[-n]
[-r]
[-e MaxPhysicalExtents]
[-p MaxPhysicalVolumes]
[-l MaxLogicalVolumes]
VolumeGroupName
vgmodify -a -B bootable
[-n]
[-r]
[-v]
[-e MaxPhysicalExtents]
[-p MaxPhysicalVolumes]
[-l MaxLogicalVolumes]
VolumeGroupName pv_path...
vgmodify -a -o
[-v]
[-r]
VolumeGroupName
vgmodify -a -o -B bootable
[-v]
[-r]
VolumeGroupName pv_path...
vgmodify -a -E
[-o]
[-v]
[-r]
VolumeGroupName [pv_path...]
vgmodify -a -E
[-v]
[-r]
[-e MaxPhysicalExtents]
[-p MaxPhysicalVolumes]
[-l MaxLogicalVolumes]
VolumeGroupName [pv_path...]
vgmodify -a -C DLC_Size
[-r]
VolumeGroupName pv_path
To recover a physical volume from a previous online or offline vgmodify failure,
vgmodify -R conf_file VolumeGroupName pv_path ...
To display a table of optimized possible volume group settings for an activated or deactivated version 1.0 volume group,
vgmodify -t
[-v]
[-n]
VolumeGroupName
vgmodify -t -B bootable
[-v]
[-n]
VolumeGroupName pv_path...
For activated volume groups version 2.0 and higher,
vgmodify -a -E
[-r]
VolumeGroupName [pv_path ...]
vgmodify -a -C DLC_Size
[-r]
VolumeGroupName pv_path
vgmodify -a
[-E]
-S Max_VG_Size [-r] VolumeGroupName
我这里是2.2版本,因此使用如下命令:
root@rzcs:/#vgmodify -a -S 1024G /dev/vg02
再次查看,已经修改成功
root@rzcs:/#vgdisplay /dev/vg02
--- Volume groups ---
VG Name /dev/vg02
VG Write Access read/write
VG Status available
Max LV 2047
Cur LV 2
Open LV 2
Cur Snapshot LV 0
Max PV 2048
Cur PV 2
Act PV 2
Max PE per PV 16384
VGDA 4
PE Size (Mbytes) 64
Unshare unit size (Kbytes) 1024
Total PE 11998
Alloc PE 4799
Current pre-allocated PE 0
Free PE 7199
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
VG Version 2.2
VG Max Size 1t
VG Max Extents 16384
Cur Snapshot Capacity 0p
Max Snapshot Capacity 1t