免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 9590 | 回复: 3
打印 上一主题 下一主题

[新手入门] 逻辑管理详细分析 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2015-09-18 16:49 |只看该作者 |倒序浏览
一个普通VG最多有1016块是固定的

一个VG下的一个PV 只能分配给1016个PPs
加一个新的VG






chvg -t 2 rootvg



原有ROOTVG542块  后加磁盘(150G) 变成1787块   去掉原来的542   加入的磁盘快熟1245块
不会在原来的hdisk1磁盘新加块,会在新磁盘创建块,目前块大小2032

实际分配第一个磁盘542 第二个磁盘分配了1245

创建VG测试


# 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

支持了5个磁盘  自定义数量大小
如果建立的VG PPSIZE过小  磁盘过大 超过32512大小 只能设置factor值

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.



# bootinfo -s hdisk4
159432
http://www.360doc.com/content/11/0623/13/1429472_129016777.shtml



AIXchina 修改VG属性

AIX中的VG类型,以及如何改变VG

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





















论坛徽章:
12
CU大牛徽章
日期:2013-09-18 15:20:4815-16赛季CBA联赛之同曦
日期:2016-02-01 20:28:25IT运维版块每日发帖之星
日期:2015-11-10 06:20:00操作系统版块每日发帖之星
日期:2015-10-28 06:20:002015亚冠之塔什干棉农
日期:2015-06-04 11:41:56丑牛
日期:2014-05-10 16:11:33技术图书徽章
日期:2013-09-23 13:25:58CU大牛徽章
日期:2013-09-18 15:21:17CU大牛徽章
日期:2013-09-18 15:21:12CU大牛徽章
日期:2013-09-18 15:21:06CU大牛徽章
日期:2013-09-18 15:20:58数据库技术版块每日发帖之星
日期:2016-02-08 06:20:00
2 [报告]
发表于 2015-09-18 23:19 |只看该作者
1016限制这是什么时候的事情了?

论坛徽章:
0
3 [报告]
发表于 2015-09-21 11:38 |只看该作者
这个默认限制一直都有,可以修改之

论坛徽章:
12
数据库技术版块每日发帖之星
日期:2015-07-08 22:20:00IT运维版块每日发帖之星
日期:2016-05-01 06:20:00IT运维版块每周发帖之星
日期:2016-03-07 16:27:44IT运维版块每月发帖之星
日期:2016-03-07 16:25:25IT运维版块每日发帖之星
日期:2016-02-21 06:20:00IT运维版块每日发帖之星
日期:2016-02-20 06:20:00数据库技术版块每日发帖之星
日期:2016-02-06 06:20:00IT运维版块每日发帖之星
日期:2016-01-30 06:20:00IT运维版块每日发帖之星
日期:2016-01-03 06:20:00IT运维版块每日发帖之星
日期:2015-11-29 06:20:00IT运维版块每日发帖之星
日期:2015-08-10 06:20:00数据库技术版块每日发帖之星
日期:2016-06-16 06:20:00
4 [报告]
发表于 2015-09-24 14:32 |只看该作者
膜拜牛人 一直没搞懂磁盘这块 都是默认lvm用的 懒得去算了 数学不好
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP