Oracle Solaris ZFS 管理ガイド

Oracle Solaris Live Upgrade を使用して ZFS ルートファイルシステムに移行する (ゾーンなし)

次の例では、UFS ルートファイルシステムを ZFS ルートファイルシステムに移行する方法を示します。

ゾーンが含まれているシステムを移行またはアップグレードする場合は、次の各節を参照してください。


例 5–3 Oracle Solaris Live Upgrade を使用して、UFS ルートファイルシステムを ZFS ルートファイルシステムに移行する

次の例では、ZFS ルートファイルシステムの BE を UFS ルートファイルシステムから作成する方法を示します。現在の BE ufsBE-c オプションで指定されています。この BE には UFS ルートファイルシステムが含まれています。-c オプション (省略可能) を指定しない場合、デフォルトではデバイス名が現在の BE の名前になります。新しい BE である zfsBE は、-n オプションによって識別されます。 lucreate 操作の前に ZFS ストレージプールが存在している必要があります。

ZFS ストレージプールは、アップグレード可能かつブート可能にするため、ディスク全体ではなくスライスを使って作成します。新しいプールを作成する前に、プールで使用するディスクに、EFI ラベルではなく SMI (VTOC) ラベルが付いていることを確認してください。ディスクに SMI ラベルを付け直した場合は、ラベル付け処理によってパーティション分割方式が変更されていないことを確認してください。ほとんどの場合、ルートプールに使用するスライスにディスク容量のすべてを割り当てるようにしてください。


# zpool create rpool mirror c1t2d0s0 c2t1d0s0
# lucreate -c ufsBE -n zfsBE -p rpool
Analyzing system configuration.
No name for current boot environment.
Current boot environment is named <ufsBE>.
Creating initial configuration for primary boot environment <ufsBE>.
The device </dev/dsk/c1t0d0s0> is not a root device for any boot environment; cannot get BE ID.
PBE configuration successful: PBE name <ufsBE> PBE Boot Device </dev/dsk/c1t0d0s0>.
Comparing source boot environment <ufsBE> 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.
The device </dev/dsk/c1t2d0s0> is not a root device for any boot environment; cannot get BE ID.
Creating configuration for boot environment <zfsBE>.
Source boot environment is <ufsBE>.
Creating boot environment <zfsBE>.
Creating file systems on boot environment <zfsBE>.
Creating <zfs> file system for </> in zone <global> on <rpool/ROOT/zfsBE>.
Populating file systems on boot environment <zfsBE>.
Checking selection integrity.
Integrity check OK.
Populating contents of mount point </>.
Copying.
Creating shared file system mount points.
Creating compare databases for boot environment <zfsBE>.
Creating compare database for file system </rpool/ROOT>.
Creating compare database for file system </>.
Updating compare databases on boot environment <zfsBE>.
Making boot environment <zfsBE> bootable.
Creating boot_archive for /.alt.tmp.b-qD.mnt
updating /.alt.tmp.b-qD.mnt/platform/sun4u/boot_archive
Population of boot environment <zfsBE> successful.
Creation of boot environment <zfsBE> successful.

lucreate 操作が完了したら、lustatus コマンドを使用して BE の状態を表示します。次に例を示します。


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

その後、ZFS コンポーネントのリストを確認します。次に例を示します。


# zfs list
NAME                   USED  AVAIL  REFER  MOUNTPOINT
rpool                 7.17G  59.8G  95.5K  /rpool
rpool/ROOT            4.66G  59.8G    21K  /rpool/ROOT
rpool/ROOT/zfsBE      4.66G  59.8G  4.66G  /
rpool/dump               2G  61.8G    16K  -
rpool/swap             517M  60.3G    16K  -

次に、luactivate コマンドを使用して、新しい ZFS BE をアクティブにします。次に例を示します。


# luactivate zfsBE
A Live Upgrade Sync operation will be performed on startup of boot environment <zfsBE>.

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

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.

**********************************************************************
.
.
.
Modifying boot archive service
Activation of boot environment <zfsBE> successful.

次に、システムを再起動して ZFS BE に切り替えます。


# init 6

ZFS BE がアクティブになっていることを確認します。


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

UFS BE に切り替えなおす場合は、ZFS BE が起動されていた間に作成された ZFS ストレージプールをすべて再インポートする必要があります。これらは UFS BE で自動的には使用可能になりません。

UFS BE が必要でなくなった場合は、ludelete コマンドで削除できます。



例 5–4 Oracle Solaris Live Upgrade を使用して ZFS BE を ZFS BE から作成する

同じプール内で ZFS BE から ZFS BE を作成する操作には ZFS のスナップショットとクローンの機能が使用されるため、この操作は非常に高速です。現在の BE が同じ ZFS プールにある場合、-p オプションは省略されます。

ZFS BE が複数存在する場合は、次のようにして起動元の BE を選択します。

詳細は、例 5–9 を参照してください。


# lucreate -n zfs2BE
Analyzing system configuration.
No name for current boot environment.
INFORMATION: The current boot environment is not named - assigning name <zfsBE>.
Current boot environment is named <zfsBE>.
Creating initial configuration for primary boot environment <zfsBE>.
The device </dev/dsk/c1t0d0s0> is not a root device for any boot environment; cannot get BE ID.
PBE configuration successful: PBE name <zfsBE> PBE Boot Device </dev/dsk/c1t0d0s0>.
Comparing source boot environment <zfsBE> 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 <zfs2BE>.
Source boot environment is <zfsBE>.
Creating boot environment <zfs2BE>.
Cloning file systems from boot environment <zfsBE> to create boot environment <zfs2BE>.
Creating snapshot for <rpool/ROOT/zfsBE> on <rpool/ROOT/zfsBE@zfs2BE>.
Creating clone for <rpool/ROOT/zfsBE@zfs2BE> on <rpool/ROOT/zfs2BE>.
Setting canmount=noauto for </> in zone <global> on <rpool/ROOT/zfs2BE>.
Population of boot environment <zfs2BE> successful.
Creation of boot environment <zfs2BE> successful.


例 5–5 ZFS BE をアップグレードする (luupgrade)

ZFS BE を追加のパッケージやパッチでアップグレードすることができます。

基本的な手順は次のとおりです。


# lustatus
Boot Environment           Is       Active Active    Can    Copy      
Name                       Complete Now    On Reboot Delete Status    
-------------------------- -------- ------ --------- ------ ----------
zfsBE                      yes      no     no        yes    -         
zfs2BE                     yes      yes    yes       no     -   
# luupgrade -p -n zfsBE -s /net/system/export/s10up/Solaris_10/Product SUNWchxge
Validating the contents of the media </net/install/export/s10up/Solaris_10/Product>.
Mounting the BE <zfsBE>.
Adding packages to the BE <zfsBE>.

Processing package instance <SUNWchxge> from </net/install/export/s10up/Solaris_10/Product>

Chelsio N110 10GE NIC Driver(sparc) 11.10.0,REV=2006.02.15.20.41
Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.

This appears to be an attempt to install the same architecture and
version of a package which is already installed.  This installation
will attempt to overwrite this package.

Using </a> as the package base directory.
## Processing package information.
## Processing system information.
   4 package pathnames are already properly installed.
## Verifying package dependencies.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

This package contains scripts which will be executed with super-user
permission during the process of installing this package.

Do you want to continue with the installation of <SUNWchxge> [y,n,?] y
Installing Chelsio N110 10GE NIC Driver as <SUNWchxge>

## Installing part 1 of 1.
## Executing postinstall script.

Installation of <SUNWchxge> was successful.
Unmounting the BE <zfsBE>.
The package add to the BE <zfsBE> completed.