Solaris,ZFSでいろいろ試してます

Solaris には Live Upgrade という便利なシステムがあります。
CD/DVD から起動して、現状の設定のままシステムをアップグレードもできますが、
Live Upgrade の場合は、現状のシステムの稼動しながら、別パーティションに現状のシステムを
コピーして現状のシステムを残したまま、別パーティションでアップグレード版を用意します。
http://sdc.sun.co.jp/solaris/topics/install/lu/ind...

とはいえ、別パーティションを用意するのも何かと面倒です。
しかしZFSの場合はパーティション操作などが必要ないので便利そうです。

まず、lucreateで snv_94にアップグレードをするためのBE=boot enviromentを作成します。
現状のシステムのファイルシステムのコピーが作成されます。
UFSの場合は、コピーに非常に時間がかかりますが、ZFSの場合はあっという間です。
# lucreate -n snv_94
Checking GRUB menu...
Analyzing system configuration.
No name for current boot environment.
INFORMATION: The current boot environment is not named - assigning name <snv_91>.
Current boot environment is named <snv_91>.
Creating initial configuration for primary boot environment <snv_91>.
The device </dev/dsk/c1t0d0s0> is not a root device for any boot environment; cannot get BE ID.
PBE configuration successful: PBE name <snv_91> PBE Boot Device </dev/dsk/c1t0d0s0>.
Comparing source boot environment <snv_91> 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.
Updating system configuration files.
Creating configuration for boot environment <snv_94>.
Source boot environment is <snv_91>.
Creating boot environment <snv_94>.
Cloning file systems from boot environment <snv_91> to create boot environment <snv_94>.
Creating snapshot for <rpool/ROOT/snv_91> on <rpool/ROOT/snv_91@snv_94>.
Creating clone for <rpool/ROOT/snv_91@snv_94> on <rpool/ROOT/snv_94>.
Setting canmount=noauto for </> in zone <global> on <rpool/ROOT/snv_94>.
Creating snapshot for <rpool/ROOT/snv_91/var> on <rpool/ROOT/snv_91/var@snv_94>.
Creating clone for <rpool/ROOT/snv_91/var@snv_94> on <rpool/ROOT/snv_94/var>.
Setting canmount=noauto for </var> in zone <global> on <rpool/ROOT/snv_94/var>.
Saving existing file </boot/grub/menu.lst> in top level dataset for BE <snv_94>
as <mount-point>//boot/grub/menu.lst.prev.
File </boot/grub/menu.lst> propagation successful
Copied GRUB menu from PBE to ABE
No entry for BE <snv_94> in GRUB menu
Population of boot environment <snv_94> successful.
Creation of boot environment <snv_94> successful.

できたようなので、lustatusで確認します。
# lustatus
Boot Environment           Is       Active Active    Can    Copy
Name                       Complete Now    On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
snv_91                     yes      yes    yes       no     -
snv_94                     yes      no     no        yes    -
今アクティブになっているのは snv_91の方です。
パーティションはこのようになっています。
# zfs list -r rpool/ROOT
NAME                           USED  AVAIL  REFER  MOUNTPOINT
rpool/ROOT                    5.02G  9.10G    18K  legacy
rpool/ROOT/snv_91             5.02G  9.10G  4.87G  /
rpool/ROOT/snv_91@snv_94      87.5K      -  4.87G  -
rpool/ROOT/snv_91/var          160M  9.10G   160M  /var
rpool/ROOT/snv_91/var@snv_94      0      -   160M  -
rpool/ROOT/snv_94               73K  9.10G  4.87G  /tmp/.alt.luupdall.1580
rpool/ROOT/snv_94/var             0  9.10G   160M  /tmp/.alt.luupdall.1580/var
rpool/ROOT/snv_94 は、zfs clone なので、今のところはほとんどディスク容量は食ってません。
# zfs get all rpool/ROOT/snv_94
NAME               PROPERTY         VALUE                     SOURCE
rpool/ROOT/snv_94  type             filesystem                -
rpool/ROOT/snv_94  creation         Sun Jul 27 21:02 2008     -
rpool/ROOT/snv_94  used             73K                       -
rpool/ROOT/snv_94  available        9.10G                     -
rpool/ROOT/snv_94  referenced       4.87G                     -
rpool/ROOT/snv_94  compressratio    1.00x                     -
rpool/ROOT/snv_94  mounted          no                        -
rpool/ROOT/snv_94  origin           rpool/ROOT/snv_91@snv_94  -
:
:

snv_94のDVDを入れて、/media/SOL_11_X86 で参照できるようになったら、
luupgrade をします。これには相当の時間がかかります。
ただし、現状のシステムを停止する必要はありません。
# luupgrade -n snv_94 -u -s /media/SOL_11_X86

No entry for BE <snv_94> in GRUB menu
Copying failsafe kernel from media.
Uncompressing miniroot
Uncompressing miniroot archive (Part2)
13367 blocks
Creating miniroot device
miniroot filesystem is <ufs>
Mounting miniroot at </media/SOL_11_X86/Solaris_11/Tools/Boot>
Mounting miniroot Part 2 at </media/SOL_11_X86/Solaris_11/Tools/Boot>
Validating the contents of the media </media/SOL_11_X86>.
The media is a standard Solaris media.
The media contains an operating system upgrade image.
The media contains <Solaris> version <11>.
Constructing upgrade profile to use.
Locating the operating system upgrade program.
Checking for existence of previously scheduled Live Upgrade requests.
Creating upgrade profile for BE <snv_94>.
Checking for GRUB menu on ABE <snv_94>.
Saving GRUB menu on ABE <snv_94>.
Checking for x86 boot partition on ABE.
Determining packages to install or upgrade for BE <snv_94>.
Performing the operating system upgrade of the BE <snv_94>.
CAUTION: Interrupting this process may leave the boot environment unstableor unbootable.
Upgrading Solaris: 2% completed

しばらくして完了。
Upgrading Solaris: 100% completed
Installation of the packages from this media is complete.
Restoring GRUB menu on ABE <snv_94>.
Adding operating system patches to the BE <snv_94>.
The operating system patch installation is complete.
ABE boot partition backing deleted.
Configuring failsafe for system.
Failsafe configuration is complete.
INFORMATION: The file </var/sadm/system/logs/upgrade_log> on boot
environment <snv_94> contains a log of the upgrade operation.
INFORMATION: The file </var/sadm/system/data/upgrade_cleanup> on boot
environment <snv_94> contains a log of cleanup operations required.
INFORMATION: Review the files listed above. Remember that all of the files
are located on boot environment <snv_94>. Before you activate boot
environment <snv_94>, determine if any additional system maintenance is
required or if additional media of the software distribution must be
installed.
The Solaris upgrade of the boot environment <snv_94> is complete.
Installing failsafe
Failsafe install is complete.

ディスク使用量はこんなところで。
# zfs list -r rpool/ROOT
NAME                           USED  AVAIL  REFER  MOUNTPOINT
rpool/ROOT                    9.29G  4.82G    18K  legacy
rpool/ROOT/snv_91             5.03G  4.82G  4.87G  /
rpool/ROOT/snv_91@snv_94       480K      -  4.87G  -
rpool/ROOT/snv_91/var          163M  4.82G   160M  /var
rpool/ROOT/snv_91/var@snv_94  2.94M      -   160M  -
rpool/ROOT/snv_94             4.26G  4.82G  5.46G  /tmp/.luupgrade.inf.1792
rpool/ROOT/snv_94/var          130M  4.82G   168M  /tmp/.luupgrade.inf.1792/var

luactivate で snv_94 側を有効にします。
# luactivate snv_94
System has findroot enabled GRUB
Generating boot-sign, partition and slice information for PBE <snv_91>
Saving existing file </etc/bootsign> in top level dataset for BE <snv_91> as <mount-point>//etc/bootsign.prev.

Generating boot-sign for ABE <snv_94>
Saving existing file </etc/bootsign> in top level dataset for BE <snv_94> as <mount-point>//etc/bootsign.prev.
Generating partition and slice information for ABE <snv_94>
Copied boot menu from top level dataset.
:
:
:
Modifying boot archive service
Propagating findroot GRUB for menu conversion.
File </etc/lu/installgrub.findroot> propagation successful
File </etc/lu/stage1.findroot> propagation successful
File </etc/lu/stage2.findroot> propagation successful
Deleting stale GRUB loader from all BEs.
File </etc/lu/installgrub.latest> deletion successful
File </etc/lu/stage1.latest> deletion successful
File </etc/lu/stage2.latest> deletion successful
Activation of boot environment <snv_94> successful.

lustatusで確認すると、snv_94 が次回起動時にアクティブになっています。
# lustatus
Boot Environment           Is       Active Active    Can    Copy
Name                       Complete Now    On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
snv_91                     yes      yes    no        no     -
snv_94                     yes      no     yes       no     -

最後に "init 6" で再起動します。reboot ではダメなのが注意点です。
# init 6
propagating updated GRUB menu
Saving existing file </boot/grub/menu.lst> in top level dataset for BE <snv_94>
as <mount-point>//boot/grub/menu.lst.prev.
File </boot/grub/menu.lst> propagation successful
File </etc/lu/GRUB_backup_menu> propagation successful
File </etc/lu/menu.cksum> propagation successful
File </sbin/bootadm> propagation successful

これで完了です。GRUBメニューで snv_91 を選べば元のシステムで起動することもできます。
もちろん、luactivate で切り替えることもできます。
ZFSの方が便利になってると思います。
タグ

管理人/副管理人のみ編集できます