今天,在客户的公司遇到了关于AIX上部署11gRAC的需求,其中关于IBM AIX的操作系统的使用成了问题,其中很多的命令与操作方式是和自己之前接触到的Linux(以RHEL为主)是完全不相同的,比如,逻辑卷就有非常大的差异。
在Linux中,对于逻辑卷的管理与配置是通过以“lv”打头的一系列命令来实现的,比如:lvcreate/lvdisplay/lvremove…etc
Eg:

[root@datalogic ~]# lvdisplay
— Logical volume —
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID iIbxKT-Yv0e-blqz-dJKB-Su3j-01Ka-HHz8N1
LV Write Access read/write
LV Status available
# open 1
LV Size 17.88 GB
Current LE 572
Segments 1
Allocation inherit
Read ahead sectors auto
– currently set to 256
Block device 253:0

— Logical volume —
LV Name /dev/VolGroup00/LogVol01
VG Name VolGroup00
LV UUID fkvcF2-iAuP-pPSt-W1tD-CoSX-GwFd-kJuFH2
LV Write Access read/write
LV Status available
# open 1
LV Size 2.00 GB
Current LE 64
Segments 1
Allocation inherit
Read ahead sectors auto
– currently set to 256
Block device 253:1

[root@datalogic ~]#
这些以“lv”起始的命令包括:

[root@datalogic ~]# lv
lv lvconvert lvdisplay lvm lvmdiskscan lvmsadc lvm.static lvremove lvresize lvscan
lvchange lvcreate lvextend lvmchange lvmdump lvmsar lvreduce lvrename lvs
[root@datalogic ~]#
但是,在AIX的环境里是没有这些命令的。
在AIX环境里的基本操作是通过诸如“lslv”/“lsvg”/“lspv”等命令实现的。

查看某个逻辑卷的信息:

AIX:/# lslv oracleapp
LOGICAL VOLUME: oracleapp VOLUME GROUP: rootvg
LV IDENTIFIER: 00ce208400004c0000000125902943bc.11 PERMISSION: read/write
VG STATE: active/complete LV STATE: opened/syncd
TYPE: jfs2 WRITE VERIFY: off
MAX LPs: 512 PP SIZE: 256 megabyte(s)
COPIES: 1 SCHED POLICY: parallel
LPs: 300 PPs: 300
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: minimum RELOCATABLE: yes
INTRA-POLICY: middle UPPER BOUND: 32
MOUNT POINT: /oracle LABEL: /oracle
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?: NO
AIX:/#
查看某个卷组的信息:

AIX:/# lsvg rootvg
VOLUME GROUP: rootvg VG IDENTIFIER: 00ce208400004c0000000125902943bc
VG STATE: active PP SIZE: 256 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 1092 (279552 megabytes)
MAX LVs: 256 FREE PPs: 312 (79872 megabytes)
LVs: 12 USED PPs: 780 (199680 megabytes)
OPEN LVs: 11 QUORUM: 1 (Disabled)
TOTAL PVs: 2 VG DESCRIPTORS: 3
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 2 AUTO ON: no
MAX PPs per VG: 32512
MAX PPs per PV: 1016 MAX PVs: 32
LTG size (Dynamic): 1024 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
AIX:/#
查看某个卷组包含有哪些逻辑卷:

AIX:/# lsvg -l rootvg
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 2 2 closed/syncd N/A
hd6 paging 126 252 2 open/syncd N/A
hd8 jfs2log 1 2 2 open/syncd N/A
hd4 jfs2 4 8 2 open/syncd /
hd2 jfs2 16 32 2 open/syncd /usr
hd9var jfs2 24 48 2 open/syncd /var
hd3 jfs2 40 80 2 open/syncd /tmp
hd1 jfs2 4 8 2 open/syncd /home
hd10opt jfs2 4 8 2 open/syncd /opt
lg_dumplv sysdump 8 8 1 open/syncd N/A
oracleapp jfs2 300 300 1 open/syncd /oracle
lvbmc jfs2 16 32 2 open/syncd /bmc
AIX:/#
查看某个卷组是由哪些PV组成的:

AIX:/# lsvg -p rootvg
rootvg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdisk1 active 546 302 93..08..00..92..109
hdisk0 active 546 10 00..00..00..00..10
AIX:/#
在AIX中,对lv的删除不是通过“lvremove”实现的,而是“smitty rmlv”。
具体操作如下:
aix_lvm_1
若要退出Smitty,F10即可。

然后,再次查看相关vg中的lv定义,将会发现,oracleapp已经被移除成功了:

AIX:/# lsvg -l rootvg
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 2 2 closed/syncd N/A
hd6 paging 126 252 2 open/syncd N/A
hd8 jfs2log 1 2 2 open/syncd N/A
hd4 jfs2 4 8 2 open/syncd /
hd2 jfs2 16 32 2 open/syncd /usr
hd9var jfs2 24 48 2 open/syncd /var
hd3 jfs2 40 80 2 open/syncd /tmp
hd1 jfs2 4 8 2 open/syncd /home
hd10opt jfs2 4 8 2 open/syncd /opt
lg_dumplv sysdump 8 8 1 open/syncd N/A
lvbmc jfs2 16 32 2 open/syncd /bmc
AIX:/#
——
To be continue.
2013年3月18日

创建LV。
在创建一个新的LV之前,首先查看当前系统中LV的状态:

# lsvg -l rootvg
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 2 2 closed/syncd N/A
hd6 paging 126 252 2 open/syncd N/A
hd8 jfs2log 1 2 2 open/syncd N/A
hd4 jfs2 4 8 2 open/syncd /
hd2 jfs2 16 32 2 open/syncd /usr
hd9var jfs2 24 48 2 open/syncd /var
hd3 jfs2 40 80 2 open/syncd /tmp
hd1 jfs2 4 8 2 open/syncd /home
hd10opt jfs2 4 8 2 open/syncd /opt
lg_dumplv sysdump 8 8 1 open/syncd N/A
#
需要在卷组“rootvg”中创建新的LV,所以需要查看下它的详细信息:

# lsvg rootvg
VOLUME GROUP: rootvg VG IDENTIFIER: 00ce1c2400004c00000001258ffca4be
VG STATE: active PP SIZE: 256 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 1092 (279552 megabytes)
MAX LVs: 256 FREE PPs: 644 (164864 megabytes)
LVs: 10 USED PPs: 448 (114688 megabytes)
OPEN LVs: 9 QUORUM: 1 (Disabled)
TOTAL PVs: 2 VG DESCRIPTORS: 3
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 2 AUTO ON: no
MAX PPs per VG: 32512
MAX PPs per PV: 1016 MAX PVs: 32
LTG size (Dynamic): 1024 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
#
需要关注的是:

PP SIZE
Total PPs
Free PPs
创建LV:

# mklv -y lv_oracle -t jfs2 -u 1 -e x -x 2048 rootvg 320
lv_oracle
#
创建后的状态:

# lsvg -l rootvg
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 2 2 closed/syncd N/A
hd6 paging 126 252 2 open/syncd N/A
hd8 jfs2log 1 2 2 open/syncd N/A
hd4 jfs2 4 8 2 open/syncd /
hd2 jfs2 16 32 2 open/syncd /usr
hd9var jfs2 24 48 2 open/syncd /var
hd3 jfs2 40 80 2 open/syncd /tmp
hd1 jfs2 4 8 2 open/syncd /home
hd10opt jfs2 4 8 2 open/syncd /opt
lg_dumplv sysdump 8 8 1 open/syncd N/A
lv_oracle jfs2 320 320 1 closed/syncd N/A
#
这里可以看到“lv_oracle”的“LV STATE”是:closed/syncd,这个会在稍后做出更正。
# lsvg rootvg
VOLUME GROUP: rootvg VG IDENTIFIER: 00ce1c2400004c00000001258ffca4be
VG STATE: active PP SIZE: 256 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 1092 (279552 megabytes)
MAX LVs: 256 FREE PPs: 324 (82944 megabytes)
LVs: 11 USED PPs: 768 (196608 megabytes)
OPEN LVs: 9 QUORUM: 1 (Disabled)
TOTAL PVs: 2 VG DESCRIPTORS: 3
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 2 AUTO ON: no
MAX PPs per VG: 32512
MAX PPs per PV: 1016 MAX PVs: 32
LTG size (Dynamic): 1024 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
#
挂载lv_oracle到/oracle。

# ls / | grep oracle
# mkdir /oracle
# crfs -v jfs2 -d lv_oracle -m /oracle -A yes
File system created successfully.
83883316 kilobytes total disk space.
New File System size is 167772160
#
开始挂接:“mount -a”命令。
# df -m
Filesystem MB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 1024.00 922.50 10% 6915 4% /
/dev/hd2 4096.00 1228.95 70% 55543 17% /usr
/dev/hd9var 6144.00 5764.22 7% 7158 1% /var
/dev/hd3 10240.00 7200.90 30% 3735 1% /tmp
/dev/hd1 1024.00 1023.47 1% 14 1% /home
/proc – – – – – /proc
/dev/hd10opt 1024.00 685.49 34% 11376 7% /opt
#
# lsvg -l rootvg
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 2 2 closed/syncd N/A
hd6 paging 126 252 2 open/syncd N/A
hd8 jfs2log 1 2 2 open/syncd N/A
hd4 jfs2 4 8 2 open/syncd /
hd2 jfs2 16 32 2 open/syncd /usr
hd9var jfs2 24 48 2 open/syncd /var
hd3 jfs2 40 80 2 open/syncd /tmp
hd1 jfs2 4 8 2 open/syncd /home
hd10opt jfs2 4 8 2 open/syncd /opt
lg_dumplv sysdump 8 8 1 open/syncd N/A
lv_oracle jfs2 320 320 1 closed/syncd /oracle
#
# mount -a
mount: 0506-324 Cannot mount /dev/hd1 on /home: The requested resource is busy.
mount: 0506-324 Cannot mount /proc on /proc: The requested resource is busy.
mount: 0506-324 Cannot mount /dev/hd10opt on /opt: The requested resource is busy.
mount: 0506-324 Cannot mount /dev/lvbmc on /bmc: A file or directory in the path name does not exist.
mount: 0506-324 Cannot mount /dev/lvapp on /app: A file or directory in the path name does not exist.
mount: 0506-324 Cannot mount /dev/lvultrapower on /ultrapower: A file or directory in the path name does not exist.
#
# df -m
Filesystem MB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 1024.00 922.50 10% 6915 4% /
/dev/hd2 4096.00 1228.95 70% 55543 17% /usr
/dev/hd9var 6144.00 5764.22 7% 7158 1% /var
/dev/hd3 10240.00 7200.90 30% 3735 1% /tmp
/dev/hd1 1024.00 1023.47 1% 14 1% /home
/proc – – – – – /proc
/dev/hd10opt 1024.00 685.49 34% 11376 7% /opt
/dev/lv_oracle 81920.00 81907.17 1% 4 1% /oracle
#
# lsvg -l rootvg
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 2 2 closed/syncd N/A
hd6 paging 126 252 2 open/syncd N/A
hd8 jfs2log 1 2 2 open/syncd N/A
hd4 jfs2 4 8 2 open/syncd /
hd2 jfs2 16 32 2 open/syncd /usr
hd9var jfs2 24 48 2 open/syncd /var
hd3 jfs2 40 80 2 open/syncd /tmp
hd1 jfs2 4 8 2 open/syncd /home
hd10opt jfs2 4 8 2 open/syncd /opt
lg_dumplv sysdump 8 8 1 open/syncd N/A
lv_oracle jfs2 320 320 1 open/syncd /oracle
#
这时候lv_oracle的“LV_STATE”就变成:open/syncd了。

不过在划分LV的时候,AIX中LV大小的计算和指定的部分还有很多不够清楚的地方,需要加深。
——
To be continue.
2013年3月19日

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

隐藏
变装