AIX卷組下檔案系統線上擴容

darren__chan發表於2015-11-26

一臺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命令建立JFS2LVFS  

2011-09-19 11:31:34|  分類: IBM主機及AIX|舉報|字號 訂閱

    

下面命令是建立一個2g邏輯卷及在此捲上建立jfs2的檔案系統,並掛載,並配置

系統自動掛載

#mkdir /databack

#mklv -t jfs2 -y lv_databack datavg 2g

-t 為邏輯卷型別

-y為邏輯卷名字

datavg是指定卷組

2g是邏輯卷的大小


#crfs -v jfs2 -d lv_databack -A yes -m /databack

-v 為檔案系統的型別

-d為邏輯卷名字

-A 為系統重啟後自動掛載

-m為掛載的目錄


#mount /databack 
#df -g

 

使用smitty jfs2建立檔案系統時出現如下問題就需要手動建立邏輯捲來解決


Command: failed        stdout: yes           stderr: no

Before command completion, additional instructions may appear below.

The distribution of this command (20) failed on one or more passive nodes.
0516-020 lcreatelv: Logical volume name or minor number already
        in use.
0516-822 mklv: Unable to create logical volume.
crfs: 0506-972 Cannot create logical volume for file system.

 

來自於herod_xiao部落格http://blog.163.com/herod_xiao

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29863023/viewspace-1847301/,如需轉載,請註明出處,否則將追究法律責任。

相關文章