トップページ > インストール関連 > Solaris Live Upgrade で新しいブート環境をミラー構成にする
カテゴリー
オラクルエンジニア通信
サポートページ
マニュアルページ
ソフトウェアダウンロード
中古UNIXマシン購入
blogs.sun.com
お勧めサイト
プライベートリンク

Solaris Live Upgrade で新しいブート環境をミラー構成にする

【検証環境】
# more /etc/release
                         Solaris 10 3/05 s10_74L2a SPARC
           Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                            Assembled 22 January 2005

【ミラー構成で新しいブート環境を作成する】

まずは状態データベースとレプリカの作成をする。
場所や数は適当で構わないが、下の例は各スライスに3つずつ作成している。

# metadb -a -f -c 3 c0t1d0s3 c0t1d1s3
# metadb
        flags           first blk       block count
     a        u         16              8192            /dev/dsk/c0t1d0s3
     a        u         8208            8192            /dev/dsk/c0t1d0s3
     a        u         16400           8192            /dev/dsk/c0t1d0s3
     a        u         16              8192            /dev/dsk/c0t1d1s3
     a        u         8208            8192            /dev/dsk/c0t1d1s3
     a        u         16400           8192            /dev/dsk/c0t1d1s3
# lucreate -n test -m /:/dev/md/dsk/d10:mirror,ufs -m /:c0t1d0s4,d11:attach -m /:c0t1d1s4,d12:attach
Discovering physical storage devices
Discovering logical storage devices
Cross referencing storage devices with boot environment configurations
Determining types of file systems supported
Validating file system requests
The device name <c0t1d0s4> expands to device path </dev/dsk/c0t1d0s4>
The device name <d11> expands to device path </dev/md/dsk/d11>
The device name <c0t1d1s4> expands to device path </dev/dsk/c0t1d1s4>
The device name <d12> expands to device path </dev/md/dsk/d12>
Preparing logical storage devices
Preparing physical storage devices
Configuring physical storage devices
Configuring logical storage devices
Analyzing system configuration.
No name for current boot environment.
INFORMATION: The current boot environment is not named - assigning name <c0t1d0s0>.
Current boot environment is named <c0t1d0s0>.
Creating initial configuration for primary boot environment <c0t1d0s0>.
PBE configuration successful: PBE name <c0t1d0s0> PBE Boot Device </dev/dsk/c0t1d0s0>.
Comparing source boot environment <c0t1d0s0> file systems with the file
system(s) you specified for the new boot environment. Determining which
file systems should be in the new boot environment.
Updating boot environment description database on all BEs.
Searching /dev for possible boot environment filesystem devices

Updating system configuration files.
Creating configuration for boot environment <test>.
Creating boot environment <test>.
Creating file systems on boot environment <test>.
Creating <ufs> file system for </> on </dev/md/dsk/d10>.
Mounting file systems for boot environment <test>.
Calculating required sizes of file systems for boot environment <test>.
Populating file systems on boot environment <test>.
Checking selection integrity.
Integrity check OK.
Populating contents of mount point </>.
Copying.
Creating shared file system mount points.
Creating compare databases for boot environment <test>.
Creating compare database for file system </>.
Updating compare databases on boot environment <test>.
Making boot environment <test> bootable.
Setting root slice to Solaris Volume Manager metadevice </dev/md/dsk/d10>.
Population of boot environment <test> successful.
Creation of boot environment <test> successful.
#
仕様なのかバグなのか不明だが、 指定したメタデバイスがinvalidだというエラーが出てうまくいかないことがあった。少々めんどくさいが以下のようにあらかじめミラー構成を作成し、 削除しておくと、上記コマンドが成功した。
# metainit -f d11 1 1 c1t0d0s4
# metainit -f d12 1 1 c1t1d0s4
# metainit d10 -m d11
# metattach d10 d12
上記コマンド実行後、再同期が終了するまでしばらく待つ。(metastatで確認)
# metadetach d10 d12
# metaclear d12
# metaclear -r d10


# lustatus
Boot Environment           Is       Active Active    Can    Copy
Name                       Complete Now    On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
c0t1d0s0                   yes      yes    yes       no     -
test                       yes      no     no        yes    -
# metastat
d10: ミラー
    サブミラー 0: d11
      状態: 正常
    サブミラー 1: d12
      状態: 正常
    パス: 1
    読み込みオプション: roundrobin (デフォルト)
    書き込みオプション: parallel (デフォルト)
    サイズ: 10242048 ブロック (4.9 GB)

d11: d10 のサブミラー
    状態: 正常
    サイズ: 10242048 ブロック (4.9 GB)
    ストライプ 0:
        デバイス   開始ブロック Dbase         状態 Reloc ホットスペア
        c0t1d0s4          0     No            正常   Yes


d12: d10 のサブミラー
    状態: 正常
    サイズ: 10242048 ブロック (4.9 GB)
    ストライプ 0:
        デバイス   開始ブロック Dbase         状態 Reloc ホットスペア
        c0t1d1s4          0     No            正常   Yes


Device Relocation Information:
Device   Reloc  Device ID
c0t1d1   はい   id1,ssd@n60020f20000053fa41a2b56b000064ab
c0t1d0   はい   id1,ssd@n60020f20000053fa41a2b55a00088865

【新しいブート環境にパッケージやパッチをインストールする】

以下のように共有されたディレクトリに置いてあるパッチを非アクティブなブート環境testにインストールする。
# ls /net/192.168.110.253/var/sadm/spool
117170-01
117463-02
117465-02
# luupgrade -t -n test -s /net/192.168.110.253/var/sadm/spool
Validating the contents of the media </net/192.168.110.253/var/sadm/spool>.
The media contains 3 software patches that can be added.
All 3 patches will be added because you did not specify any specific patches to
add.
Mounting the BE <test>.
Adding patches to the BE <test>.
Validating patches...

Loading patches installed on the system...

Done!

Loading patches requested to install.

Package FJSVhea from patch 117170-01 is not installed on the system.
Done!

Checking patches that you specified for installation.

Done!

Approved patches will be installed in this order:

117170-01 117463-02 117465-02
...
...
Patch 117465-02 has been successfully installed.
See /a/var/sadm/patch/117465-02/log for details

Patch packages installed:
  SUNWaccu

Unmounting the BE <test>.
The patch add to the BE <test> completed.

このような感じで指定したディレクトリに置かれたパッチが全てインストールされる。(パッチIDを指定すれば個別にインストールすることも可能)
ちなみにパッチを削除する場合は -T オプションを使用する。

また次のように -p オプションでパッケージのインストールもできる。

# luupgrade -p -n test -s /net/192.168.110.253/var/spool/pkg/ZFS  SUNWzfs

Validating the contents of the media </net/192.168.110.253/var/spool/pkg/ZFS>.
Mounting the BE <test>.
Adding packages to the BE <test>.

Processing package instance <SUNWzfs> from </net/192.168.110.253/var/spool/pkg/ZFS>

Zettabyte File System (ZFS)(sparc) 11.10.0,REV=2005.01.18.02.36
Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
Using </a> as the package base directory.
## Processing package information.
## Processing system information.
   25 package pathnames are already properly installed.
## Verifying package dependencies.
## Verifying disk space requirements.
...
...
Installation of <SUNWzfs> was successful.
Unmounting the BE <test>.
The package add to the BE <test> completed.

このようにパッケージもインストールできる。
ちなみにパッケージを削除する場合は -P オプションを使用する。

【新しいブート環境に切り替える】

以下のコマンドで次回の起動を新しいブート環境であるtestに切り替える。

# luactivate test

*****************************************************************

The target boot environment has been activated. It will be used when you
reboot. NOTE: You MUST NOT USE the reboot, halt, or uadmin commands. You
MUST USE either the init or the shutdown command when you reboot. If you
do not use either init or shutdown, the system will not boot using the
target BE.

*****************************************************************

In case of a failure while booting to the target BE, the following process
needs to be followed to fallback to the currently working boot environment:

1. Enter the PROM monitor (ok prompt).

2. Boot the machine to Single User mode using a different boot device
(like the Solaris Install CD or Network). Examples:

     At the PROM monitor (ok prompt):
     For boot to Solaris CD:  boot cdrom -s
     For boot to network:     boot net -s

3. Mount the Current boot environment root slice to some directory (like
/mnt). You can use the following command to mount:

     mount -Fufs /dev/dsk/c0t1d0s0 /mnt

4. Run <luactivate> utility with out any arguments from the current boot
environment root slice, as shown below:

     /mnt/sbin/luactivate

5. luactivate, activates the previous working boot environment and
indicates the result.

6. Exit Single User mode and reboot the machine.

*****************************************************************

Activation of boot environment <test> successful.
#

lustatusコマンドでアクティブなブート環境の確認をしてみる。

# lustatus
Boot Environment           Is       Active Active    Can    Copy
Name                       Complete Now    On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
c0t1d0s0                   yes      yes    no        no     -
test                       yes      no     yes       no     -

上記結果から次のリブート時にブート環境testが有効になることがわかる。

# init 6

【新しいブート環境の確認】

次のコマンドでパッチやパッケージが正しくインストールされていることがわかる。

# patchadd -p

Patch: 117463-02 Obsoletes: Requires: Incompatibles: Packages: SUNWcsl
Patch: 116298-08 Obsoletes: Requires: Incompatibles: Packages: SUNWxsrt SUNWxrgr
t SUNWxrpcrt SUNWjaxp
Patch: 116302-02 Obsoletes: Requires: Incompatibles: Packages: SUNWxrpcrt
Patch: 113886-27 Obsoletes: Requires: Incompatibles: Packages: SUNWglrt SUNWgldo
c SUNWglrtu SUNWglsrz SUNWgldp SUNWglh SUNWglsr
Patch: 117465-02 Obsoletes: Requires: Incompatibles: Packages: SUNWaccu
Patch: 117170-01 Obsoletes: Requires: Incompatibles: Packages: SUNWhea
Patch: 116352-01 Obsoletes: Requires: Incompatibles: Packages: SUNWjjaf SUNWjjma
il
Patch: 113887-27 Obsoletes: Requires: Incompatibles: Packages: SUNWglrtx SUNWgls
rx SUNWgldpx

# pkginfo | grep SUNWzfs
system      SUNWzfs                          Zettabyte File System (ZFS)

オラクルユニバーシティSolaris系技術トレーニング一覧

Solarisお勧め書籍

Solaris 11.2 システムハンドブック
Oracle Solaris 11 試験対策本(OCA)