1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[AIX] rootvg ミラーリングされたAIXを異なるディスクにリストアする際に一次、二次ダンプ・デバイスを別々のディスクに設定する方法

Last updated at Posted at 2022-07-22

はじめに

AIXで rootvg を hdisk0,hdisk1 でミラーリングした構成で、hdisk0 に一次ダンプデバイスを、hdisk1 に二次ダンプデバイスを設定してmksysb を取得し、ディスクの指定をhdisk1、hdisk2 に変更して何も設定せずにリストアすると、確認した環境では一次・二次ダンプ・デバイスが hdisk1 に偏って作成されました。

二次ダンプデバイスの削除と再設定でも問題ないと思いますが、hdisk1 に一次ダンプ・デバイスを、hdisk2 に二次ダンプ・デバイスをリストアする方法を確認しました。

結論は、/image.dataを編集、もしくは NIM (Network Install Manager) の image_data リソースの設定)で回避できることを確認しています。

[検証1]、[検証2]にログを記載します。


環境

AIX 7.2 TL3 SP1

# oslevel -s
7200-03-01-1838

[検証1] /image.data を使用して、hdisk0,1の rootvg 構成を hdisk1,2にリストアする。

① /image.data を作成し、編集します。

mkszfile コマンド を使用して、/image.data を作成します。

# mkszfile -m -X
# echo $?
0
# ls -l /image.data
-rw-r--r--    1 root     system        12077 Jul 22 14:56 /image.data

作成された /image.data は既存のディスク情報に基づくので、hdisk1,hdis2 を使用する内容に編集します。

行った修正は2点です

(1) /image.data 内箇所の hdisk1hdisk2 に、 hdisk0hdisk1 に置き換える。

(2) source_disk_data: スタンザ 内の設定を にする。

下記のようにsource_disk_data で値をブランクにします。

source_disk_data:
        PVID=
        PHYSICAL_LOCATION=
        CONNECTION=
        LOCATION=
        SIZE_MB=
        HDISKNAME=

source_disk_data:
        PVID=
        PHYSICAL_LOCATION=
        CONNECTION=
        LOCATION=
        SIZE_MB=
        HDISKNAME=

② mksysb を取得する

①で修正した /image.data がある状態で、mksysb コマンドや NIM で取得します。(手順、ログは省略)

mksysb取得の際に /image.data や map ファイルのオプションが存在しますが、こちらを指定すると①で修正した内容が上書きされるので指定しません。

③ mksysbのリストア

ブート中、ディスクが違うという Error Warning が出ていますが、続行します。

                                Error Warning

The data file indicated that all logical volumes should
be created exactly as they were before, but the disks
are not the same as they were on the source system.

To reboot the system, press reset.

>>> 1 Continue with Install

    88  Help ?

>>> Choice [1]:

"System Backup Installation and Settings" で Disks where you want to install で対象ディスクを変更します。

                           System Backup Installation and Settings

Either type 0 and press Enter to install with the current settings, or type the
number of the setting you want to change and press Enter.

      Setting:                                 Current Choice(s):

    1 Disk(s) where you want to install ...... hdisk0...
         Use Maps............................. No
    2 Shrink File Systems..................... No
    3 Import User Volume Groups............... Yes
    4 Recover Devices......................... Yes

>>> 0 Install with the settings listed above.

1.を選択


                          Change Disk(s) Where You Want to Install

Type one or more numbers for the disk(s) to be used for installation and press
Enter. To cancel a choice, type the corresponding number and Press Enter.
At least one bootable disk must be selected. The current choice is indicated
by >>>.

        Name      Location Code   Size(MB)  VG Status   Bootable   Maps

     1  hdisk0    C3-T1-01         20480   rootvg          Yes    Yes
>>>  2  hdisk1    C3-T1-01         20480   rootvg          Yes    Yes
>>>  3  hdisk2    C3-T1-01         20480   none            Yes    No

hdisk0の選択を解除し、hdisk1, hdisk2 を指定します。

Use Maps は No で実行します。

                              Use Maps

 Type the number of your choice and press Enter.

       1  Use maps for installation
>>>    2  Do not use maps for installation

確認し、"0. Install with the setting listed above."を実行します。

                           System Backup Installation and Settings

Either type 0 and press Enter to install with the current settings, or type the
number of the setting you want to change and press Enter.

      Setting:                                 Current Choice(s):

    1 Disk(s) where you want to install ...... hdisk1...
         Use Maps............................. No
    2 Shrink File Systems..................... No
    3 Import User Volume Groups............... Yes
    4 Recover Devices......................... Yes

>>> 0 Install with the settings listed above.
④ リストア後

システム・ダンプの lv_dumplv、lg_dumplv2 がどのディスクで設定されたか確認します。

まずは rootvg の LV を確認。
ダンプ・デバイス以外はミラーリング状態(PPs がLPs の2倍、PVs が 2)でリストアされています。

# 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     16      32      2    open/syncd    N/A
hd8                 jfs2log    1       2       2    open/syncd    N/A
hd4                 jfs2       11      22      2    open/syncd    /
hd2                 jfs2       76      152     2    open/syncd    /usr
hd9var              jfs2       6       12      2    open/syncd    /var
hd3                 jfs2       4       8       2    open/syncd    /tmp
hd1                 jfs2       1       2       2    open/syncd    /home
hd10opt             jfs2       35      70      2    open/syncd    /opt
hd11admin           jfs2       4       8       2    open/syncd    /admin
lg_dumplv           sysdump    32      32      1    open/syncd    N/A
livedump            jfs2       8       16      2    open/syncd    /var/adm/ras/livedump
lg_dumplv2          sysdump    32      32      1    open/syncd    N/A

システム・ダンプの一次、二次を確認します。

# sysdumpdev -l
primary              /dev/lg_dumplv
secondary            /dev/lg_dumplv2
copy directory       /var/adm/ras
forced copy flag     TRUE
always allow dump    FALSE
dump compression     ON
type of dump         fw-assisted
full memory dump     disallow

リストア前と変わりありませんでした。

さて、lg_dumplv, lg_dumplv2 はどの hdiskにされたかどうかを確認します。

# lslv -m lg_dumplv
lg_dumplv:N/A
LP    PP1  PV1               PP2  PV2               PP3  PV3
0001  0145 hdisk1
0002  0146 hdisk1
0003  0147 hdisk1

~ 省略 ~ 

0030  0174 hdisk1
0031  0175 hdisk1
0032  0176 hdisk1
# lslv -m lg_dumplv2
lg_dumplv2:N/A
LP    PP1  PV1               PP2  PV2               PP3  PV3
0001  0153 hdisk2
0002  0154 hdisk2
0003  0155 hdisk2

~ 省略 ~ 

0030  0182 hdisk2
0031  0183 hdisk2
0032  0184 hdisk2

目的通り、lg_dumplv が hdisk1 に、lg_dumplv2 が hdisk2 に作成されました!



[検証2] NIMの image_data リソースを使用する場合

① image_data リソースを設定

[検証1]の手順①で修正した /image.dataと同様に hdisk0,hdisk1 を hdisk1,hdisk2 に置き換え、source_disk_data: スタンザ内の設定を空にした image.data ファイルを準備します。

NIMサーバーにそのファイルを転送し、image_data リソースとして定義します。(手順は下記マニュアル参照)
=> 参考: image_data リソースの使用

② NIM の mksysb リストアで image_data リソースを指定してリストアを実行

NIM の image_data リソースを定義し、NIM の mksysb install の設定で指定します。

                      Install the Base Operating System on Standalone Clients

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

                                                        [Entry Fields]
* Installation Target                                 <対象サーバーのホスト名>
* Installation Type                                   mksysb
* SPOT                                                <対象のspotリソース>
  LPP_SOURCE                                         []                                          +
  MKSYSB                                              <対象のmksysbリソース>

  BOSINST_DATA to use during installation            []                                          +
  IMAGE_DATA to use during installation              [<対象のimage_dataリソース>]         +
  RESOLV_CONF to use for network configuration       []                                          +

~ 省略 ~ 

設定後、LPARをSMSブートでNIMのインストール設定を行い、リストアします。(ログは省略)
検証1 と同様に、リストア対象のディスクは、hdisk1, hdisk2 を使用し、"Use Maps" は "No" の指定です。

③ リストア後

システム・ダンプの lv_dumplv、lg_dumplv2 がどのディスクで設定されたか確認します。

まずは rootvg の LV を確認。
ダンプ・デバイス以外はミラーリング状態(PPs がLPs の2倍、PVs が 2)でリストアされています。

# 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     16      32      2    open/syncd    N/A
hd8                 jfs2log    1       2       2    open/syncd    N/A
hd4                 jfs2       11      22      2    open/syncd    /
hd2                 jfs2       76      152     2    open/syncd    /usr
hd9var              jfs2       6       12      2    open/syncd    /var
hd3                 jfs2       4       8       2    open/syncd    /tmp
hd1                 jfs2       1       2       2    open/syncd    /home
hd10opt             jfs2       35      70      2    open/syncd    /opt
hd11admin           jfs2       4       8       2    open/syncd    /admin
lg_dumplv           sysdump    32      32      1    open/syncd    N/A
livedump            jfs2       8       16      2    open/syncd    /var/adm/ras/livedump
lg_dumplv2          sysdump    32      32      1    open/syncd    N/A

システム・ダンプの一次、二次を確認します。

# sysdumpdev -l
primary              /dev/lg_dumplv
secondary            /dev/lg_dumplv2
copy directory       /var/adm/ras
forced copy flag     TRUE
always allow dump    FALSE
dump compression     ON
type of dump         fw-assisted
full memory dump     disallow

リストア前と変わりありませんでした。

lg_dumplv, lg_dumplv2 はどの hdiskにされたかを確認します。

# lslv -m lg_dumplv
lg_dumplv:N/A
LP    PP1  PV1               PP2  PV2               PP3  PV3
0001  0145 hdisk1
0002  0146 hdisk1
0003  0147 hdisk1

~ 省略 ~

0030  0174 hdisk1
0031  0175 hdisk1
0032  0176 hdisk1
# lslv -m lg_dumplv2
lg_dumplv2:N/A
LP    PP1  PV1               PP2  PV2               PP3  PV3
0001  0153 hdisk2
0002  0154 hdisk2
0003  0155 hdisk2

~ 省略 ~

0030  0182 hdisk2
0031  0183 hdisk2
0032  0184 hdisk2

検証2でも lg_dumplv が hdisk1 に、lg_dumplv2 が hdisk2 に作成されました!


参考文書

NIM環境の構築
NIMを利用したバックアップ/リストア
image_data リソースの使用
mkszfile コマンド

以上です。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?