1. 程式人生 > >AIX卷組下文件系統在線擴容

AIX卷組下文件系統在線擴容

AIX卷組下文件系統在線擴容

一臺AIX小機因生產需要對/sapdata目錄進行擴容,由原來的90G擴容到210G,增加120G的空間.AIX小機後端通過光纖交換機連的EMC存儲。首先在EMC存儲上把空閑的硬盤做RAID,劃分LUN,映射到生產AIX小機。

EMC
劃完LUN映射完後,在AIX小機上執行cfgmgr ,然後lspv看是否認到新擴容的硬盤.
# cfgmgr -i disk
# lspv
hdisk0 00c6abdfc094f4e8 rootvg active
hdisk1 00c6abcfc4edbd87 rootvg active
hdisk6 oravg active
hdisk7 oravg active

註意HDISK後的16位數字,如果沒有請執行
#chdev
l hdisk6 a pv=yes (以使物理卷為LVM所用)。
#chdev
l hdisk7 a pv=yes (以使物理卷為LVM所用)。

pv加入到vg

Extendvg datavg hiskpower60


#lspv
hdisk0 00c6abdfc094f4e8 rootvg active
hdisk1 00c6abcfc4edbd87 rootvg active
hdisk6 00c6abcf1d17f7bf oravg active
hdisk7 00c6abcf1d189c64 oravg active

(如果是HA架構,在

A節點上識別到後執行#rmdev Rd1 hdisk6然後在B節點上cfgmgr掃再認)--檢查兩節點LSPV是否一致和HDISK是否一致。

原文件目錄大小
#df -g
/dev/sapdata 90.00 84.80 94% 26 1% /oracle/sapdata

然後執行smitty hacmp--- System Management (C-SPOC)-- HACMP Logical Volume Management--- Shared Volume Groups-- Set Characteristics of a Shared Volume Group-- Add a Volume to a Shared Volume Group--選擇需要擴容的VG--回車,然後選擇添加的硬盤---確定。然後進行擴容文件系統。#smitty chfschange/show charactertistics of an enhanced journaled file system—選擇要擴的文件系統—然後回車繼續.

如果文件系統擴容出錯,一般是文件系統的Block size或卷的LV原大小限制了最大擴容空間,可以# smitty hacmp--- System Management (C-SPOC)-- HACMP Logical Volume Management--- Shared file systems---enhanced journaled file systems---change/show characteristics of a shared enhanced journaled file system—選擇文件系統來修改塊大小,之後就可以成功擴文件系統。註:修改LV的大小,可以通過#smitty chlv來進行。

原參數:
Type or select values in entry fields.
Press Enter AFTER making all desired changes.

[Entry Fields]
File system name /oracle/sapdata
NEW mount point [/oracle/sapdata]
SIZE of file system
Unit Size 512bytes +
Number of units [188743680] #
Mount GROUP []
Mount AUTOMATICALLY at system restart? no +
PERMISSIONS read/write +
Mount OPTIONS [] +
Start Disk Accounting? no +
Block Size (bytes) 256
Inline Log? no
Inline Log size (MBytes) [0] #
Extended Attribute Format [v1]
Enable Quota Management? no +
Allow Small Inode Extents? no +

現參數:
Type or select values in entry fields.
Press Enter AFTER making all desired changes.

[Entry Fields]
File system name /oracle/sapdata
NEW mount point [/oracle/sapdata]
SIZE of file system
Unit Size 512bytes +
Number of units [440401920] #
Mount GROUP []
Mount AUTOMATICALLY at system restart? no +
PERMISSIONS read/write +
Mount OPTIONS [] +
Start Disk Accounting? no +
Block Size (bytes) 2048
Inline Log? no
Inline Log size (MBytes) [0] #
Extended Attribute Format [v1]
Enable Quota Management? no +
Allow Small Inode Extents? no +

然後再擴,就正常了出現如下提示Filesystem size changed to 440401920
註:擴容後包含已有空間的容量
驗證一下
#df -g
/dev/sapdata 210.00 84.80 40% 26 1% /oracle/sapdata

aix的文件系統擴容是非常靈活的,如果不涉及加硬盤的硬件操作,只要通過aix裏面的命令或者smitty菜單就行了,當然做好數據備份在任何情況下都是必要的。

1、因為數據庫歸檔日誌目錄空間較小,而日誌增長又比較快,因歸檔日誌滿很容易造成數據庫掛起,所以準備對文件系統進行擴容。
# df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 5.00 4.90 3% 7024 1% /
/dev/hd2 20.00 14.77 27% 57946 2% /usr
/dev/hd9var 10.00 9.37 7% 7454 1% /var
/dev/hd3 15.00 14.41 4% 3290 1% /tmp
/dev/hd1 6.00 5.01 17% 1873 1% /home
/proc - - - - - /proc
/dev/hd10opt 15.00 14.62 3% 10242 1% /opt
/dev/lv00 0.25 0.24 4% 18 1% /var/adm/csd
/dev/fslv00 10.00 9.20 8% 2876 1% /sapmnt/BWP
/dev/lv_oracle 0.50 0.50 1% 47 1% /oracle
/dev/BWP 5.00 4.55 9% 12334 2% /oracle/BWP
/dev/BWP_102_64 9.00 4.84 47% 22062 2% /oracle/BWP/102_64
/dev/BWP_mirrlogA 0.50 0.40 20% 6 1% /oracle/BWP/mirrlogA
/dev/BWP_mirrlogB 0.50 0.40 20% 6 1% /oracle/BWP/mirrlogB
/dev/BWP_oraarch 50.00 38.82 93% 279 1% /oracle/BWP/oraarch
/dev/BWP_origlogA 0.50 0.36 29% 9 1% /oracle/BWP/origlogA

2、查看當前活動的卷,只有兩個,經與工程師確認數據庫歸檔日誌目錄在ORAVG卷上。
# lsvg -o
oravg
rootvg
進一步詳細查看ORAVG卷的信息
# lsvg -l oravg
oravg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
lv_oracle jfs2 2 2 1 open/syncd /oracle
client jfs2 2 2 1 open/syncd /oracle/client
stage_102_64 jfs2 28 28 1 open/syncd /oracle/stage/102_64
BWP jfs2 20 20 1 open/syncd /oracle/BWP
BWP_102_64 jfs2 36 36 1 open/syncd /oracle/BWP/102_64
BWP_origlogA jfs2 2 2 1 open/syncd /oracle/BWP/origlogA
BWP_origlogB jfs2 2 2 1 open/syncd /oracle/BWP/origlogB
BWP_mirrlogA jfs2 2 2 1 open/syncd /oracle/BWP/mirrlogA
BWP_mirrlogB jfs2 2 2 1 open/syncd /oracle/BWP/mirrlogB
BWP_oraarch jfs2 200 200 1 open/syncd /oracle/BWP/oraarch
發現當前目錄的PPS大小為200
3
# lsvg oravg
VOLUME GROUP: oravg VG IDENTIFIER: 00c6abcf00004c000000012d038039cb
VG STATE: active PP SIZE: 256 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 7191 (1840896 megabytes)
MAX LVs: 512 FREE PPs: 2589 (582912 megabytes)
LVs: 18 USED PPs: 4602 (1257984 megabytes)
OPEN LVs: 18 QUORUM: 5 (Enabled)
TOTAL PVs: 9 VG DESCRIPTORS: 9
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 9 AUTO ON: no
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
查看oravg卷組信息可知每個PPS大小為256M,目前oravg還剩2589PPS,共計662784M

4
擴展文件系統的空間
擴大 pp extendlv lv_appdata1 200

smit chlv==>Change a logical Volume==>Logical volume name==>F4(選擇你要修改的lvname)回車
MAXIMUM NUMBER of LOGICAL PARTITIONS [1024] 把數值一改,回車後,見到左上角“OK


使用命令 # chfs -a size=+78G /oracle/BWP/oraarch #意思是給/oracle/BWP/oraarch增加78G的空間(註意G是大寫)
執行完再lsvg 發現free pp size 沒有增加,但是用smitty chfs 來做的時候
發現,增加的 size /oracle/BWP/oraarch上已經體現了。

使用smitty chfs來擴容的過程:

#smitty chfs回車後選擇這一項Change/Show Characteristics of an Enhanced Journaled File System,然後在目錄列表裏找到需要擴容的目錄按回車。

Type or select values in entry fields.
Press Enter AFTER making all desired changes.

[Entry Fields]
File system name /oracle/BWP/oraarch
NEW mount point [/oracle/BWP/oraarch]
SIZE of file system
Unit Size Megabytes +
Number of units [79872] #
Mount GROUP []
Mount AUTOMATICALLY at system restart? no +
PERMISSIONS read/write +
Mount OPTIONS [] +
Start Disk Accounting? no +
Block Size (bytes) 4096
Inline Log? no
Inline Log size (MBytes) [0] #
Extended Attribute Format [v1]
Enable Quota Management? no +
Allow Small Inode Extents? no +


we will see result:

COMMAND STATUS

Command: OK stdout: yes stderr: no

Before command completion, additional instructions may appear below.

Filesystem size changed to 131072 #擴容後包含已有空間的容量

5、再檢查一下看新增上沒有

# df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 5.00 4.90 3% 7024 1% /
/dev/hd2 20.00 14.77 27% 57935 2% /usr
/dev/hd9var 10.00 9.37 7% 7454 1% /var
/dev/hd3 15.00 14.41 4% 3381 1% /tmp
/dev/hd1 6.00 5.01 17% 1873 1% /home
/proc - - - - - /proc
/dev/hd10opt 15.00 14.62 3% 10242 1% /opt
/dev/lv00 0.25 0.24 4% 18 1% /var/adm/csd
/dev/fslv00 10.00 9.20 8% 2876 1% /sapmnt/BWP
/dev/lv_oracle 0.50 0.50 1% 47 1% /oracle
/dev/BWP 5.00 4.55 10% 12348 2% /oracle/BWP
/dev/BWP_102_64 9.00 4.84 47% 22069 2% /oracle/BWP/102_64
/dev/BWP_mirrlogA 0.50 0.40 20% 6 1% /oracle/BWP/mirrlogA
/dev/BWP_mirrlogB 0.50 0.40 20% 6 1% /oracle/BWP/mirrlogB
/dev/BWP_oraarch 128.00 99.82 23% 663 1% /oracle/BWP/oraarch

好了,一切正常,擴容成功。

總結

chfs -a size=+xxG /文件系統


extendlv lv00 xx--->
指擴展的PP
chfs -a size=+xxG /
文件系統

l #lspv 找到新增加的物理卷(邏輯驅動器,以hdisk8為例)。

l #chdev –l hdisk8 –a pv=yes寫入新的物理卷的pvid

l #extendvg cwdatavg hdisk8,擴展卷組的空間,將新的物理卷添加到卷組中。

l #lslv fslv02檢查文件系統所在的邏輯卷fslv02,查看是否已經達到最大的pp擴展

數,如果達到則需執行smit chlvMAXIMUM NUMBER of LOGICAL PARTITIONS的數值進行修改。

l #chfs –a size=+50G/cwdatacwdata文件系統增加50G的空間,註意“G”要大寫。

l #df –g查看文件系統cwdata的空間已經增加


AIX卷組下文件系統在線擴容