背景介绍:
在HPUX 11.31环境下,VG扩容大容量磁盘的时候,由于Max PE per PV 只有4039个,而添加2T的磁盘,Max PE per PV需要达到16636才行。查了官网后,可通过vgmodify在线修改Max PE per PV。
1、通过vgmodify修改Max PE per PV报错:
#vgmodify -e 16636 -n -r odsvg03
Current Volume Group settings:
Max LV 255
Max PV 255
Max PE per PV 4039
PE Size (Mbytes) 128
VGRA Size (Kbytes) 8448
vgmodify: This operation can only be completed if PE number zero on "/dev/rdisk/disk79" is freed
vgmodify: This operation can only be completed if PE number zero on "/dev/rdisk/disk116" is freed
...
2、查询disk169还有空余的PE没有使用。通过pvmove将disk79的0号PE在线迁移到disk169。
#pvmove /dev/disk/disk79:0 /dev/disk/disk169
Transferring logical extents of logical volume "/dev/odsvg03/odsv03l31100"...
Physical volume "/dev/disk/disk79" has been successfully moved.
Volume Group configuration for /dev/odsvg03 has been saved in /etc/lvmconf/odsvg03.conf
3、再次执行vgmodify预览修改,报错消失
vgmodify -e 16636 -n -r odsvg03
Current Volume Group settings:
Max LV 255
Max PV 255
Max PE per PV 4039
PE Size (Mbytes) 128
VGRA Size (Kbytes) 8448
The current and new Volume Group parameters differ.
An update to the Volume Group IS required
New Volume Group settings:
Max LV 255
Max PV 255
Max PE per PV 16636
PE Size (Mbytes) 128
VGRA Size (Kbytes) 34224
Review complete. Volume group not modified
4、vgmodify 带-a选项在线修改成功。
#vgmodify -a -e 16636 -n odsvg03
Current Volume Group settings:
Max LV 255
Max PV 255
Max PE per PV 4039
PE Size (Mbytes) 128
VGRA Size (Kbytes) 8448
The current and new Volume Group parameters differ.
An update to the Volume Group IS required
New Volume Group settings:
Max LV 255
Max PV 255
Max PE per PV 16636
PE Size (Mbytes) 128
VGRA Size (Kbytes) 34224
New Volume Group configuration for "odsvg03" has been saved in "/etc/lvmconf/odsvg03.conf"
Old Volume Group configuration for "odsvg03" has been saved in "/etc/lvmconf/odsvg03.conf.old"
Starting the modification by writing to all Physical Volumes
Applying the configuration to all Physical Volumes from "/etc/lvmconf/odsvg03.conf"
Completed the modification process.
New Volume Group configuration for "odsvg03" has been saved in "/etc/lvmconf/odsvg03.conf.old"
Volume group "odsvg03" has been successfully changed.