Solaris のシステム管理 (第 1 巻)

IA: システムを復元するためにブートする方法

重要なシステム資源を修復するには、次の手順に従ってシステムをブートします。この例では、Solaris Installation CD またはネットワークからブートし、ルート (/) ファイルシステムをディスクにマウントし、 /etc/passwd ファイルを修復する方法を説明しています。

以下の説明で使用されている変数 devicename は、修復するファイルシステムのデバイス名に置き換えてください。システムのデバイス名については、第 26 章「デバイスへのアクセス (概要)」を参照してください。

Solaris Installation CD またはネットワークのどちらからブートしているかによって、対応する手順に従ってください。

  1. Solaris Installation CD (またはネットワーク) から、シングルユーザーモードでブートします。

    1. Device Configuration Assistant (デバイス構成用補助) フロッピーディスクまたは Installation CD を適切なドライブに挿入します。

    2. Type any key to continue プロンプトが表示されている場合は、任意のキーまたはリセットボタンを押してシステムをリブートします。システムがシャットダウンされている場合は、電源スイッチを押してシステムを起動します。

    3. 「Solaris Device Configuration Assistant」画面で、F2 キー (F2_Continue) を押します。

      デバイスが識別され、識別されたデバイスを示す画面が表示されます。

    4. 「Identified Devices」画面で、F2 キー (F2_Continue) を押します。

      ブート可能なドライバが読み込まれます。

    5. 「Boot Solaris」メニューから CD または NET をデバイスとして選択します。次に F2 キー (F2_Continue) を押します。

      「Current Boot Parameters」メニューが表示されます。

    6. プロンプトで b -s と入力して、Enter キーを押します。

      数分後に、シングルユーザーモードの # プロンプトが表示されます。

  2. 無効な passwd ファイルがあるルート (/) ファイルシステムをマウントします。


    # mount /dev/dsk/devicename /a
    
  3. 新しくマウントした etc ディレクトリに移動します。


    # cd /a/etc
    
  4. 必要に応じて、エディタを使って passwd ファイルに必要な変更を加えます。


    # vi passwd
    
  5. ルート (/) ディレクトリに移動します。


    # cd /
    
  6. /a ディレクトリのマウントを解除します。


    # umount /a
    
  7. システムをリブートします。


    # init 6
    
  8. システムが実行レベル 3 でブートしたことを確認します。

    ブートプロセスが正常に終了すると、ログイン画面かログインプロンプトが表示されます。


    hostname console login:

IA: 例 - システムを復元する目的でブートする


 
Type any key to continue
 
SunOS Secondary Boot version 3.00
 
 
Solaris Intel Platform Edition Booting System
 
Running Configuration Assistant...
Autobooting from Boot path: /pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:a
 
If the system hardware has changed, or to boot from a different
device, interrupt the autoboot process by pressing ESC.
 
Press ESCape to interrupt autoboot in 5 seconds.
      .
      .
      .
Boot Solaris
 
Select one of the identified devices to boot the Solaris kernel and
choose Continue.
 
To perform optional features, such as modifying the autoboot and property
settings, choose Boot Tasks.
 
An asterisk (*) indicates the current default boot device.
 
> To make a selection use the arrow keys, and press Enter to mark it [X].
 
[ ]  NET : DEC 21142/21143 Fast Ethernet
on Board PCI at Dev 3                                                
[ ]  DISK: (*) Target 0, QUANTUM  FIREBALL1280A
on Bus Mastering IDE controller on Board PCI at Dev 7, Func 1
[ ]  DISK: Target 1:ST5660A
on Bus Mastering IDE controller on Board PCI at Dev 7, Func 1
[ ]  DISK: Target 0:Maxtor 9 0680D4
on Bus Mastering IDE controller on Board PCI at Dev 7, Func 1
[ ]  CD  : Target 1:TOSHIBA  CD-ROM XM-5602B  1546
on Bus Mastering IDE controller on Board PCI at Dev 7, Func 1
 
F2_Continue   F3_Back   F4_Boot Tasks   F6_Help
      .
      .
      .
               <<< Current Boot Parameters >>>
Boot path: /pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:a
Boot args: kernel/unix -r
 
Select the type of installation you want to perform:
 
1 Solaris Interactive
2 Custom JumpStart
3 Solaris Web Start
 
Enter the number of your choice followed by <ENTER> the key.
 
If you enter anything else, or if you wait for 30 seconds,
an interactive installation will be started.
 
Select type of installation:  b -s
      .
      .
      .
# mount /dev/dsk/c0t0d0s0 /a
      .
      .
      .
# cd /a/etc
# vi passwd
(無効なエントリを削除する)
# cd /
# umount /a
# init 6