# lsvg testvg
VOLUME GROUP: testvg VG IDENTIFIER: 00c597ef00004c000000000539c15ff6
VG STATE: active PP SIZE: 16 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 9964 (159424 megabytes)
MAX LVs: 256 FREE PPs: 9964 (159424 megabytes)
LVs: 0 USED PPs: 0 (0 megabytes)
OPEN LVs: 0 QUORUM: 2 (Enabled)
TOTAL PVs: 1 VG DESCRIPTORS: 2
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 1 AUTO ON: yes
MAX PPs per VG: 30480
MAX PPs per PV: 10160 MAX PVs: 3
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
PV RESTRICTION: none INFINITE RETRY: no
创建后的结果 不是支持32个PV 而且是3个PV 因为一个PV占用了10160 总数32512 总数不会变
创建VG PPSIZE指定了大小 磁盘数量比较大 系统自动分配一个PV支持比较多PPSIZE的VG PV数量减少
小磁盘测试
Add an Original Volume Group
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
VOLUME GROUP name [testvg]
Physical partition SIZE in megabytes 16 +
* PHYSICAL VOLUME names [hdisk3] +
Force the creation of a volume group? no +
Activate volume group AUTOMATICALLY yes +
at system restart?
Volume Group MAJOR NUMBER [] +#
Create VG Concurrent Capable? no +
Infinite Retry Option no +
# lsvg testvg
VOLUME GROUP: testvg VG IDENTIFIER: 00c597ef00004c000000000539c91c8b
VG STATE: active PP SIZE: 16 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 5311 (84976 megabytes)
MAX LVs: 256 FREE PPs: 5311 (84976 megabytes)
LVs: 0 USED PPs: 0 (0 megabytes)
OPEN LVs: 0 QUORUM: 2 (Enabled)
TOTAL PVs: 1 VG DESCRIPTORS: 2
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 1 AUTO ON: yes
MAX PPs per VG: 30480
MAX PPs per PV: 6096 MAX PVs: 5
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
PV RESTRICTION: none INFINITE RETRY: no
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
VOLUME GROUP name [testvg]
Physical partition SIZE in megabytes 4 +
* PHYSICAL VOLUME names [hdisk4] +
Force the creation of a volume group? no +
Activate volume group AUTOMATICALLY yes +
at system restart?
Volume Group MAJOR NUMBER [] +#
Create VG Concurrent Capable? no +
Infinite Retry Option no +
Command: failed stdout: yes stderr: no
Before command completion, additional instructions may appear below.
0516-1208 /usr/sbin/mkvg: Warning, The Physical Partition Size of 4 requires the
creation of 39858 partitions for hdisk4. The system limitation is 16256
physical partitions per disk at a factor value of 16. Specify a larger
Physical Partition Size or a larger factor value in order create a
volume group on this disk.
0516-862 /usr/sbin/mkvg: Unable to create volume group.
AIX中的VG类型
AIX中的VG有三种类型,如下:
VG type
Maximum PVs
Maximum LVs
Maximum PPs per VG
Maximum PP size
Normal VG
32
256
32,512 (1016 * 32)
1 GB
Big VG
128
512
130,048 (1016 * 12
1 GB
Scalable VG
1024
4096
2,097,152
128 GB
首先如何查看VG是什么类型呢?
通过如下方法
例如:hdisk2 属于 datavg
那么执行#readvgda hdisk2|grep type
..... readvgda_type: smallvg
vgtype: 0
可以发现datavg是normal VG。
维护过程中用的最多的是,如何平衡一个VG中的PP与PV,LV的数量。
如何在不改变VG类型的情况下,改变VG中的最大PP数量呢?
可以通过修改factor因子,来平衡PP和PV的数量
例如:
# lsvg datavg
VOLUME GROUP: datavg VG IDENTIFIER: 00f7433800004c000000013808c3ac8d
VG STATE: active PP SIZE: 4 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 48 (192 megabytes)
MAX LVs: 256 FREE PPs: 10 (40 megabytes)
LVs: 3 USED PPs: 38 (152 megabytes)
OPEN LVs: 2 QUORUM: 1 (Disabled)
TOTAL PVs: 2 VG DESCRIPTORS: 3
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 2 AUTO ON: no
Concurrent: Enhanced-Capable Auto-Concurrent: Disabled
VG Mode: Non-Concurrent
MAX PPs per VG: 32512
MAX PPs per PV: 1016 MAX PVs: 32
LTG size (Dynamic): 128 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
PV RESTRICTION: none INFINITE RETRY: no
# lsvg -p datavg
datavg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdisk2 active 24 5 04..00..00..00..01
hdisk5 active 24 5 04..00..00..00..01
# readvgda hdisk2|grep type
..... readvgda_type: smallvg
vgtype: 0
# set -o vi
# readvgda hdisk2|grep factor
factor: 1
# chvg -t 2 datavg 更改factor 为2
0516-1164 chvg: Volume group datavg changed. With given characteristics datavg
can include up to 16 physical volumes with 2032 physical partitions each.
# lsvg datavg
VOLUME GROUP: datavg VG IDENTIFIER: 00f7433800004c000000013808c3ac8d
VG STATE: active PP SIZE: 4 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 48 (192 megabytes)
MAX LVs: 256 FREE PPs: 10 (40 megabytes)
LVs: 3 USED PPs: 38 (152 megabytes)
OPEN LVs: 2 QUORUM: 1 (Disabled)
TOTAL PVs: 2 VG DESCRIPTORS: 3
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 2 AUTO ON: no
Concurrent: Enhanced-Capable Auto-Concurrent: Disabled
VG Mode: Non-Concurrent
MAX PPs per VG: 32512
MAX PPs per PV: 2032 MAX PVs: 16
LTG size (Dynamic): 128 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
PV RESTRICTION: none INFINITE RETRY: no
#
# readvgda hdisk2|grep factor
factor: 2
还有一种方法就是改变VG类型,来增大PP,PV,LV的最大数量
# chvg -B mndhb_vg_01 改变VG为Big VG类型
0516-1164 chvg: Volume group mndhb_vg_01 changed. With given characteristics mndhb_vg_01
can include up to 64 physical volumes with 2032 physical partitions each.
# lsvg mndhb_vg_01
VOLUME GROUP: mndhb_vg_01 VG IDENTIFIER: 00f7433800004c000000013808c3ac8d
VG STATE: active PP SIZE: 4 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 44 (176 megabytes)
MAX LVs: 512 FREE PPs: 6 (24 megabytes)
LVs: 3 USED PPs: 38 (152 megabytes)
OPEN LVs: 2 QUORUM: 1 (Disabled)
TOTAL PVs: 2 VG DESCRIPTORS: 3
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 2 AUTO ON: no
Concurrent: Enhanced-Capable Auto-Concurrent: Disabled
VG Mode: Non-Concurrent
MAX PPs per VG: 130048
MAX PPs per PV: 2032 MAX PVs: 64
LTG size (Dynamic): 128 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
PV RESTRICTION: none INFINITE RETRY: no
# readvgda hdisk2|grep type
..... readvgda_type: bigvg
vgtype: 1
注意如果将VG类型改为Scalable VG时,需要首先varyoffvg
#varyoffvg datavg
#chvg -G datavg
#varyonvg datavg
建议在新部署系统的时候,建立VG时,选择Scalable VG,这样可以消除512 byte logical volume control block (LVCB) offset to affect aligned writes (often found on systems using raw LVs with Oracle databases)的限制
特别提示:进行chvg -B和chvg -G的操作的时候,vg中每个pv必须有足够的空余free空间,来存放vgda的变更。
# lslv fslv00
LOGICAL VOLUME: fslv00 VOLUME GROUP: Destvg
LV IDENTIFIER: 00c597ef00004c000000000539d47ad6.2 PERMISSION: read/write
VG STATE: active/complete LV STATE: closed/syncd
TYPE: jfs2 WRITE VERIFY: off
MAX LPs: 2048 PP SIZE: 256 megabyte(s)
COPIES: 1 SCHED POLICY: parallel
LPs: 140 PPs: 140
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: minimum RELOCATABLE: yes
INTRA-POLICY: middle UPPER BOUND: 32
MOUNT POINT: /app LABEL: /app
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?: NO
INFINITE RETRY: no
创建LV
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
Logical volume NAME [ceshilv]
* VOLUME GROUP name Destvg
* Number of LOGICAL PARTITIONS [50] #
PHYSICAL VOLUME names [hdisk4] +
Logical volume TYPE [jfs2] +
POSITION on physical volume middle +
RANGE of physical volumes minimum +
MAXIMUM NUMBER of PHYSICAL VOLUMES [] #
to use for allocation
Number of COPIES of each logical 1 +
partition
Mirror Write Consistency? active +
Allocate each logical partition copy yes +
on a SEPARATE physical volume?
RELOCATE the logical volume during yes +
reorganization?
Logical volume LABEL []
MAXIMUM NUMBER of LOGICAL PARTITIONS [2048] #
Enable BAD BLOCK relocation? yes +
SCHEDULING POLICY for writing/reading parallel +
logical partition copies
Enable WRITE VERIFY? no +
File containing ALLOCATION MAP []
Stripe Size? [Not Striped] +
Serialize IO? no +
Mirror Pool for First Copy +
Mirror Pool for Second Copy +
Mirror Pool for Third Copy +
Infinite Retry Option no +
/dev/livedump 524288 523552 1% 4 1% /var/adm/ras/livedump
# mount /ap
# lsvg Destvg
VOLUME GROUP: Destvg VG IDENTIFIER: 00c597ef00004c000000000539d47ad6
VG STATE: active PP SIZE: 256 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 621 (158976 megabytes)
MAX LVs: 256 FREE PPs: 570 (145920 megabytes)
LVs: 2 USED PPs: 51 (13056 megabytes)
OPEN LVs: 2 QUORUM: 2 (Enabled)
TOTAL PVs: 1 VG DESCRIPTORS: 2
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 1 AUTO ON: yes
MAX PPs per VG: 32768 MAX PVs: 1024
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
MIRROR POOL STRICT: off
PV RESTRICTION: none INFINITE RETRY: no
LOGICAL VOLUME: ceshilv VOLUME GROUP: Destvg
LV IDENTIFIER: 00c597ef00004c000000000539d47ad6.2 PERMISSION: read/write
VG STATE: active/complete LV STATE: opened/syncd
TYPE: jfs2 WRITE VERIFY: off
MAX LPs: 2048 PP SIZE: 256 megabyte(s)
COPIES: 1 SCHED POLICY: parallel
LPs: 50 PPs: 50
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: minimum RELOCATABLE: yes
INTRA-POLICY: middle UPPER BOUND: 1024
MOUNT POINT: /ap LABEL: /ap
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?: NO
INFINITE RETRY: no
DEVICESUBTYPE: DS_LVZ
COPY 1 MIRROR POOL: None
COPY 2 MIRROR POOL: None
COPY 3 MIRROR POOL: None
#
# lsvg rootvg
VOLUME GROUP: rootvg VG IDENTIFIER: 00c597ef00004c000000014ed6a301e6
VG STATE: active PP SIZE: 128 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 542 (69376 megabytes)
MAX LVs: 256 FREE PPs: 462 (59136 megabytes)
LVs: 11 USED PPs: 80 (10240 megabytes)
OPEN LVs: 10 QUORUM: 2 (Enabled)
TOTAL PVs: 1 VG DESCRIPTORS: 2
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 1 AUTO ON: no
MAX PPs per VG: 32512
MAX PPs per PV: 1016 MAX PVs: 32
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
PV RESTRICTION: none INFINITE RETRY: no