Solaris のシステム管理 (基本編)

x86: x86 システムで指定した ZFS ルートファイルシステムからブートする

x86 プラットフォームで Oracle Solaris ZFS ルートファイルシステムのブートをサポートするために、新しい GRUB キーワード $ZFS-BOOTFS が導入されました。ルートデバイスに ZFS プールが含まれている場合は、このキーワードに値が割り当てられ、その値が -B オプションを使ってカーネルに渡されます。このオプションにより、ブートするデータセットが識別されます。ZFS ブートローダーをサポートする Oracle Solaris リリースをシステムにインストールするか、そのリリースにアップグレードする場合は、GRUB menu.lst ファイルおよび GRUB ブートメニューにデフォルトでこの情報が含まれます。

Procedurex86: 使用可能な ZFS ブート環境のリストを表示する方法

  1. スーパーユーザーになるか、同等の役割を引き受けます。

    役割には、認証と特権コマンドが含まれます。役割の詳細については、『Solaris のシステム管理 (セキュリティサービス)』「RBAC の構成 (作業マップ)」を参照してください。

  2. システム上の使用可能な BE のリストを表示するには、次のコマンドを入力します。


    ~# bootadm list-menu
    

    # lustatus
    

    lustatus コマンドは、SPARC システムでも使用できます。


    注 –

    lustatus コマンドの実行時に次のエラーが表示される場合は、インストールを新たに実行したときに Solaris Live Upgrade が使用されなかったことを示しています。BE が lustatus の出力で認識されるようにするには、最初にシステムで BE を新しく作成する必要があります。


    # lustatus
    ERROR: No boot environments are configured on this system
    ERROR: cannot determine list of all boot environment names

    Solaris Live Upgrade を使用して UFS ルートファイルシステムを ZFS ルートファイルシステムに移行する方法の詳細は、『Oracle Solaris ZFS 管理ガイド』「UFS ルートファイルシステムから ZFS ルートファイルシステムへの移行 (Oracle Solaris Live Upgrade)」を参照してください。


例 12–12 lustatus コマンドを使って使用可能な ZFS ブート可能データセットのリストを表示する

次の例では、lustatus コマンドの出力は 3 つの ZFS ブート可能データセットの状態を示しています。デフォルトのブート環境は be1 であるため、これを削除することはできません。


# lustatus
Boot Environment           Is       Active Active    Can    Copy
Name                       Complete Now    On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
s10s_nbu6wos               yes      no     no        yes    -
zfs2BE                     yes      yes    yes       no     -
zfsbe3                     no       no     no        yes    -
#

BE が作成され、ブート可能になっている場合は、Is Complete 列に「yes」が表示されます。BE が作成され、まだアクティブになっていない場合は、この列に「no」が表示されます。 BE をアクティブにするには、luactivate コマンドを使用します。そのあとで lustatus コマンドを実行して、BE が正常にアクティブ化されたことを確認します。

詳細は、lustatus(1M) および luactivate(1m) のマニュアルページを参照してください。


Procedurex86: 指定した ZFS ルートファイルシステムからブートする方法

次の手順では、ZFS ブートローダーをサポートする x86 システムで ZFS ルートファイルシステムからブートする方法について説明します。

ZFS ブートローダーをサポートする Oracle Solaris リリースをシステムにインストールするか、そのリリースにアップグレードする場合は、GRUB メニューエントリに、デフォルトで -B $ZFS-BOOTFS ブート引数が含まれます。そのため、追加のブート引数を指定しなくてもシステムは ZFS からブートします。

  1. システムを再起動します。


    # reboot
    

    Press any key to reboot プロンプトが表示されている場合は、任意のキーを押してシステムをリブートします。

    あるいは、リセットボタンを使用することもできます。システムが停止している場合は、電源スイッチを押してシステムを起動します。

    ブートシーケンスが始まると、GRUB メインメニューが表示されます。デフォルトのブートエントリが ZFS ファイルシステムの場合は、次のようなメニューが表示されます。


    GNU GRUB  version 0.95  (637K lower / 3144640K upper memory)
     +----------------------------------------------------------------+
    | be1
    | be1 failsafe
    | be3
    | be3 failsafe
    | be2
    | be2 failfafe
      +---------------------------------------------------------------+
          Use the ^ and v keys to select which entry is highlighted.
          Press enter to boot the selected OS, 'e' to edit the
          commands before booting, or 'c' for a command-line.
  2. GRUB メニューが表示されたら、Enter キーを押してデフォルトの OS インスタンスをブートします。

    エントリを 10 秒以内に選択しない場合、システムは自動的に実行レベル 3 でブートします。

  3. 別の BE をブートするには、矢印キーを使用して指定のブートエントリを強調表示します。

  4. このエントリをブートする場合は b と入力し、このエントリを編集する場合は e と入力します。

    ブート時の GRUB メニューエントリの詳細は、「x86: ブート時に GRUB メニューを編集してブート動作を変更する方法」を参照してください。


例 12–13 x86: x86 システムで新しいブート環境をアクティブにする

次の例は、システム上でブート環境 be10 をアクティブにするために従う手順を示しています。最初に lustatus コマンドを実行して、システム上のどの BE がアクティブになっているか、またどの BE をアクティブにする必要があるかを確認します。


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



# luactivate be10
System has findroot enabled GRUB Generating boot-sign, partition and slice
information for PBE <be1>
WARNING: The following file s have change on both the current boot environment
<be1> zone <global> and the boot environment to be activitate <be10>
		/etc/zfs/zpool.cache
INFORMATION: The files listed above are in conflict between the current
boot environment <be1> zone <global> and the boot environment to be
activated <be10>. These files will not be automatically synchronized from
the current boot environment <be1> when boot environment <be10> is activated.

Setting failsafe console to <ttyb>
Generating boot-sign for ABE <be10>
Generating partition and slice information for ABE <be10>
Copied boot menu from top level dataset.
Generating direct boot menu entries for PBE.
Generating direct boot menu entries for ABE.
Disabling splashimage
Current GRUB menu default setting is not valid
title Solaris bootenv rc
No more bootadm entries. Deletion of bootadm entries is complete.
GRUB menu default setting is unchanged
Done eliding bootadm entries.
**************************************************************
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.
***************************************************************
,,,


# reboot
May 30 09:52:32 pups reboot: initiated by root on /dev/console
syncing file systems... done
rebooting...

CE SDRAM BIOS P/N GR-xlint.007-4.330
*

BIOS Lan-Console 2.0
Copyright (C) 1999-2001 Intel Corporation
.
.
.
GNU GRUB  version 0.95  (637K lower / 3144640K upper memory)
 +-------------------------------------------------------------------+
| be1
| be1 failsafe
| be10
| be10 failsafe
+------------------------------------------------------------------+
      Use the ^ and v keys to select which entry is highlighted.
      Press enter to boot the selected OS, 'e' to edit the
      commands before booting, or 'c' for a command-line.

SunOS Release 5.10 32-bit
Copyright 1983-2008 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.

Hostname: pups
NIS domain name is sunsoft.eng.sun.com
Reading ZFS config: done.
Mounting ZFS filesystems: (8/8)

pups console login:
# lustatus
Boot Environment           Is       Active Active    Can    Copy
Name                      Complete Now    On Reboot Delete Status
-----------------------------------------------------------------
be1                        yes      yes    yes       no     
be10                       yes      yes    yes       no
#