AIX常用操作卷组(VG)命令

AIX常用操作卷组(VG)命令
维护AIX系统经常要做的一个日常工作是监控存储空间的使用情况,除了日常检查文件系统以外,还要经常对卷组、逻辑卷和物理卷进行操作,这里列出一些常用的命令供参考。

列出所有的VG及LV:

p5b2@/#lsvg -o |lsvg -il
dev2vg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
loglv00 jfs2log 1 1 1 open/syncd N/A
fslv01 jfs2 1728 1728 3 open/syncd /u02
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 2 2 closed/syncd N/A
hd6 paging 4 8 2 open/syncd N/A
hd8 jfs2log 1 2 2 open/syncd N/A
hd4 jfs2 1 2 2 open/syncd /
hd2 jfs2 20 40 2 open/syncd /usr
hd9var jfs2 2 4 2 open/syncd /var
hd3 jfs2 4 8 2 open/syncd /tmp
hd1 jfs2 1 2 2 open/syncd /home
hd10opt jfs2 2 4 2 open/syncd /opt
paging00 paging 12 12 1 open/syncd N/A
u01lv jfs2 72 72 1 open/syncd /u01
softinstlv jfs2 40 40 1 closed/syncd /tmp/softinst
fslv00 jfs2 504 504 2 open/syncd /orabak

查看某个VG:


p5b2@/#lsvg dev2vg
VOLUME GROUP: dev2vg VG IDENTIFIER: 00c1e9ff00004c0000000116a31806e2
VG STATE: active PP SIZE: 128 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 1733 (221824 megabytes)
MAX LVs: 512 FREE PPs: 4 (512 megabytes)
LVs: 2 USED PPs: 1729 (221312 megabytes)
OPEN LVs: 2 QUORUM: 2
TOTAL PVs: 3 VG DESCRIPTORS: 3
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 3 AUTO ON: yes
MAX PPs per VG: 130048
MAX PPs per PV: 1016 MAX PVs: 128
LTG size (Dynamic): 1024 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable

查看某个VG由哪些PV组成:

p5b2@/#lsvg -p dev2vg
dev2vg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdiskpower0 active 583 0 00..00..00..00..00
hdiskpower1 active 583 0 00..00..00..00..00
hdiskpower2 active 567 4 00..00..00..00..04

查看某个PV:

p5b2@/#lspv hdiskpower1
PHYSICAL VOLUME: hdiskpower1 VOLUME GROUP: dev2vg
PV IDENTIFIER: 00c1e9ff5316cb73 VG IDENTIFIER 00c1e9ff00004c0000000116a31806e2
PV STATE: active
STALE PARTITIONS: 0 ALLOCATABLE: yes
PP SIZE: 128 megabyte(s) LOGICAL VOLUMES: 1
TOTAL PPs: 583 (74624 megabytes) VG DESCRIPTORS: 1
FREE PPs: 0 (0 megabytes) HOT SPARE: no
USED PPs: 583 (74624 megabytes) MAX REQUEST: 1 megabyte
FREE DISTRIBUTION: 00..00..00..00..00
USED DISTRIBUTION: 117..117..116..116..117

查看某个LV:

p5b2@/#lslv fslv00
LOGICAL VOLUME: fslv00 VOLUME GROUP: rootvg
LV IDENTIFIER: 00c1e9ff00004c00000001063a3ef3cc.13 PERMISSION: read/write
VG STATE: active/complete LV STATE: opened/syncd
TYPE: jfs2 WRITE VERIFY: off
MAX LPs: 800 PP SIZE: 128 megabyte(s)
COPIES: 1 SCHED POLICY: parallel
LPs: 504 PPs: 504
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: minimum RELOCATABLE: yes
INTRA-POLICY: middle UPPER BOUND: 32
MOUNT POINT: /orabak LABEL: /orabak
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?: NO

可以用

smit chfs

命令扩大或缩小文件系统,加文件系统会自动扩LV。

可以用

smit extendlv

扩充LV的大小,有时扩充后会报错如下:

0516-1734 extendlv: Warning, savebase failed.  Please manually run 'savebase' before rebooting.
Filesystem size changed to 67108864

这时已经扩充成功了,savebase 功能是将“设备配置”数据库中的基本定制设备信息保存到引导设备中,可能当时I/O繁忙,或者CPU繁忙或其它原因,没有执行,用root用户手动执行一下savebase即可。

有时候会遇到以下错误:

0516-787 extendlv: Maximum allocation for logical volume fslv01 is 1024.

这是因为LV已经设置了MAX LPs为1024,而要扩充的数额超过了这个数目,这时需要增大这个参数:

smit chlv
Change a logical Volume
Logical volume name F4(选择要修改的lvname)回车
MAXIMUM NUMBER of LOGICAL PARTITIONS [1024] 这里修改

然后保存再扩充LV即可成功。

你可能感兴趣的:(工作,AIX)