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

第 31 章 IA: ディスクの追加 (手順)

この章では、IA システムにディスクを追加する手順について説明します。この章で説明する手順は次のとおりです。

ディスク管理の概要については、第 28 章「ディスクの管理 (概要)」を参照してください。SPARC システムにディスクを追加する手順については、第 30 章「SPARC: ディスクの追加 (手順)」 を参照してください。

IA: システムディスクと二次ディスクについて

システムディスクには、ルート (/) ファイルシステム、/usr ファイルシステム、またはその両方が入っています。この 2 つのファイルシステムのどちらかが入っているディスクが損傷した場合、復元方法は次の 2 つがあります。

二次ディスクには、ルート (/) ファイルシステムも /usr ファイルシステムも入っていません。通常はユーザーファイル用の領域が入っています。システムに二次ディスクを追加してディスク容量を増やしたり、損傷した二次ディスクを交換できます。システム上の二次ディスクを交換すると、古いディスクのデータを新しいディスク上に復元できます。

IA: システムディスクまたは二次ディスクの追加

表 31-1 IA: 作業マップ: システムディスクまたは二次ディスクの追加

作業 

説明 

手順の説明 

1. ディスクの接続とブート 

システムディスク

新しいディスクを接続して、ローカルまたはリモートの Solaris CD からブートする 

「IA: システムディスクを接続してブートする方法」

 

二次ディスク

新しいディスクを接続し、システムでディスクが認識されるように再構成ブートを実行する。 

「IA: 二次ディスクを接続してブートする方法」

2. スライスとディスクラベルの作成 

まだディスクメーカーによって実行されていない場合は、ディスクスライスとディスクラベルを作成する。 

「IA: Solaris fdisk パーティションを作成する方法」

3. ファイルシステムの作成 

newfs コマンドを使用してディスクスライス上に UFS ファイルシステムを作成する。ルート (/) および /usr ファイルシステムは、システムディスク上に作成しなければならない。

「IA: ファイルシステムを作成する方法」

4. ファイルシステムの復元 

システムディスク上にルート (/) および /usr ファイルシステムを復元する。必要に応じて、二次ディスク上にファイルシステムを復元する。

第 44 章「ファイルとファイルシステムの復元 (手順)」

5. ブートブロックのインストール 

システムディスクのみ 

システムをブートできるように、ルート (/) ファイルシステムにブートブロックをインストールする。

「IA: システムディスクにブートブロックをインストールする方法」

IA: fdisk パーティションの作成上のガイドライン

次のガイドラインに従って fdisk パーティションを設定してください。


x86 のみ -

Solaris スライスはパーティションと呼ばれることがあります。このマニュアルではスライスという用語を使用しますが、Solaris のマニュアルやプログラムによっては、スライスをパーティションと呼ぶ場合があります。混乱を避けるために、Solaris のマニュアルでは、 fdisk パーティション (Intel 版 Solaris でのみサポートされます) と、スライスやパーティションと呼ばれる Solaris の fdisk パーティションを区別するようにしています。


IA: システムディスクを接続してブートする方法

この手順は、システムがシャットダウンされていることを前提としています。

  1. 損傷したシステムディスクをシステムから外します。

  2. 追加しようとするディスクにシステム上の他のデバイスとは異なるターゲット番号が設定されているかどうかを確認します。

    通常は、ディスクの背面にそのための小型スイッチが付いています。

  3. 交換用のディスクをシステムに正しく接続します。

    インストールについての詳細は、ディスクのハードウェアインストールガイドを参照してください。また、ディスクに固有のハードウェア構成要件については、『Solaris 8 デバイスの構成 (Intel 版)』を参照してください。

  4. ローカルまたはリモートの Solaris CD からブートする場合は、手順 a から e までを実行します。ネットワークからブートする場合は、手順 a をスキップします。

    1. Solaris のインストール CD を CD-ROM ドライブに挿入します。

    2. Solaris ブートフロッピーディスクを主フロッピーディスクドライブ (DOS ドライブ A) に挿入します。

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

      数分後に Boot Solaris 画面が表示されます。

    4. Boot Solaris 画面から、ブートデバイスとして CD または NET を選択します。

      Current Boot Parameters 画面が表示されます。

    5. システムをシングルユーザーモードでブートします。


      Select the type of installation: b -s
      

      数分後に、スーパーユーザーのプロンプト (#) が表示されます。

次に進む手順

システムをブートしたら、ディスク上にスライスとディスクラベルを作成できます。「IA: ディスクスライスとディスクラベルを作成する方法」を参照してください。

IA: 二次ディスクを接続してブートする方法

  1. スーパーユーザーになります。

  2. ディスクが Solaris ソフトウェアでサポートされない場合は、ハードウェアに添付された説明書に従って、そのディスクのデバイスドライバを追加します。

  3. システムのブート時に読み込まれる /reconfigure ファイルを作成します。


    # touch /reconfigure
    

    /reconfigure ファイルを作成すると、電源を入れるとき、または後からシステムをブートするときに、SunOS ソフトウェアは新しくインストールされた周辺デバイスの有無をチェックします。

  4. システムをシャットダウンします。


    # shutdown -i0 -g30 -y
    

    -i0

    システムを init 状態 0 (電源切断) にする。 

    -gn

    ログインしているユーザーに、n 秒後にシステムのシャットダウンが始まることを通知する。 

    -y

    コマンドがユーザーの介入なしで実行されるように指定する。 

    Type any key to continue プロンプトが表示されます。

  5. システムとすべての外部周辺デバイスの電源を切ります。

  6. 追加しようとするディスクにシステム上の他のデバイスとは異なるターゲット番号が設定されているかどうかを確認します。

    通常は、ディスクの背面にそのための小型スイッチが付いています。

  7. ディスクをシステムに正しく接続します。

    インストールについての詳細は、ディスクのハードウェアインストールガイドを参照してください。また、ディスクに固有のハードウェア構成要件については、『Solaris 8 デバイスの構成 (Intel 版)』を参照してください。

  8. すべての外部周辺デバイスの電源を入れます。

  9. システムの電源を入れます。

    システムがブートされ、ログインプロンプトが表示されます。

次に進む手順

システムをブートしたら、ディスク上にスライスとディスクラベルを作成できます。「IA: ディスクスライスとディスクラベルを作成する方法」を参照してください。

IA: Solaris fdisk パーティションを作成する方法

  1. 「IA: fdisk パーティションの作成上のガイドライン」を必ず読んでください。

  2. スーパーユーザーになります。

  3. format ユーティリティを起動します。


    # format
    
  4. 画面に表示されたリストから、Solaris fdisk パーティションを作成するディスクの番号を入力します。


    Specify disk (enter its number): disk-number
    

    disk-number

    Solaris fdisk パーティションを作成するディスクの番号

  5. fdisk メニューに移動します。


    format> fdisk
    

    表示される fdisk メニューは、fdisk パーティションがすでにディスク上に存在しているかどうかによって異なります。次の表を使用して、次に行う手順を決定してください。

    目的の作業 

    次の手順 

    参照 

    IA: ディスク全体を占有する Solaris fdisk パーティションを作成する。

    手順 6 

    「IA: 例 - ディスク全体を占有する Solaris fdisk パーティションを作成する」

    Solaris fdisk パーティションを作成し、既存の Solaris 以外の fdisk パーティションは変更しない。

    手順 7 

    「IA: 例 - 既存の fdisk パーティションを変更せずに、Solaris fdisk パーティションを作成する」

    Solaris fdisk パーティションと、Solaris 以外の fdisk パーティションを追加作成する。

    手順 7 

    「IA: 例 - Solaris fdisk パーティションと、DOSBIG fdisk パーティションを作成する」

  6. ディスク全体にまたがる Solaris fdisk パーティションを作成してそれをアクティブにするには、プロンプトで y を入力します。次に、手順 14 に進みます。


    The recommended default partitioning for your disk is:
    
      a 100% "SOLARIS System" partition.
    
    To select this, please type "y".  To partition your disk
    differently, type "n" and the "fdisk" program will
    let you select other partitions. y
    
  7. ディスク全体にまたがる Solaris fdisk パーティションを作成しない場合は、プロンプトで n を入力します。


    To select this, please type "y".  To partition your disk
    differently, type "n" and the "fdisk" program will let you
    select other partitions. n
    Total disk size is 2694 cylinders
                 Cylinder size is 765 (512 byte) blocks
                                              Cylinders
        Partition   Status    Type      Start   End   Length    %
        =========   ======    ========  =====   ===   ======   ===
    
    THERE ARE NO PARTITIONS CURRENTLY DEFINED SELECT ONE OF THE
    FOLLOWING:
    
         1.   Create a partition
         2.   Change Active (Boot from) partition
         3.   Delete a partition
         4.   Exit (Update disk configuration and exit)
         5.   Cancel (Exit without updating disk configuration)
    Enter Selection: 
  8. 「1、Create a partition 」を選択し、fdisk パーティションを作成します。


                 Total disk size is 2694 cylinders
                 Cylinder size is 765 (512 byte) blocks
                                              Cylinders
        Partition   Status    Type      Start   End   Length    %
        =========   ======    ========  =====   ===   ======   ===
    
    THERE ARE NO PARTITIONS CURRENTLY DEFINED SELECT ONE OF THE
    FOLLOWING:
    
         1.   Create a partition
         2.   Change Active (Boot from) partition
         3.   Delete a partition
         4.   Exit (Update disk configuration and exit)
         5.   Cancel (Exit without updating disk configuration)
    Enter Selection: 1
    
  9. 1(=Solaris)」を選択して、Solaris fdisk パーティションを作成します。


    Indicate the type of partition you want to create
      (1=SOLARIS, 2=UNIX, 3=PCIXOS, 4=Other, 8=DOSBIG)
      (5=DOS12, 6=DOS16, 7=DOSEXT, 0=Exit) ? 1
    
  10. Solaris fdisk パーティション用に割り当てるディスクのパーセントを指定します。このパーセントを計算するときには、既存の fdisk パーティションのサイズを考慮してください。


    Indicate the percentage of the disk you want this partition
    to use (or enter "c" to specify in cylinders). nn
    
  11. プロンプトで y を入力して、Solaris fdisk パーティションをアクティブにします。


    Do you want this to become the Active partition? If so, it will be 
    activated each time you reset your computer or when you turn it on 
    again. Please type "y" or "n". y
    

    fdisk パーティションがアクティブになった後、Enter Selection: プロンプトが表示されます。

  12. 別の fdisk パーティションを作成する場合は、「1.Create a partition」を選択します。

    fdisk パーティションを作成する手順については、手順 9 から 手順 11 を参照してください。

  13. ディスク構成を更新し、Selection メニューから fdisk メニューに戻ります。


    Selection: 4 
    
  14. label コマンドを使用して、ディスクに新しいラベルを付けます。


    WARNING: Solaris fdisk partition changed - Please relabel the disk
    format> label
    Ready to label disk, continue? yes
    format> 
  15. format メニューを終了します。


    format> quit
    

次に進む手順

ディスク上に Solaris fdisk パーティションを作成し終わったら、ディスク上にスライスを作成できます。「IA: ディスクスライスとディスクラベルを作成する方法」を参照してください。

IA: 例 - ディスク全体を占有する Solaris fdisk パーティションを作成する

次の例は、formatfdisk オプションを使用して、ディスク全体にまたがる Solaris fdisk パーティションを作成する方法を説明しています。


# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
       0. c0d0 <DEFAULT cyl 2466 alt 2 hd 16 sec 63>
          /pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0
       1. c0d1 <DEFAULT cyl 522 alt 2 hd 32 sec 63>
          /pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0
       2. c1d0 <DEFAULT cyl 13102 alt 2 hd 16 sec 63>
          /pci@0,0/pci-ide@7,1/ide@1/cmdk@0,0
Specify disk (enter its number): 0
selecting c0d0
Controller working list found
[disk formatted]
format> fdisk
The recommended default partitioning for your disk is:
 
  a 100% "SOLARIS System" partition.
 
To select this, please type "y".  To partition your disk
differently, type "n" and the "fdisk" program will let you
select other partitions. y
 
WARNING: Solaris fdisk partition changed - Please relabel the disk
format> label
Ready to label disk, continue? yes
format> quit

IA: 例 - 既存の fdisk パーティションを変更せずに、Solaris fdisk パーティションを作成する

次の例は、DOS-BIG fdisk パーティションがすでに存在しているディスクに、Solaris fdisk パーティションを作成する方法を説明しています。


format> fdisk
             Total disk size is 2694 cylinders
             Cylinder size is 765 (512 byte) blocks
                                         Cylinders
     Partition   Status    Type     Start  End   Length    %
     =========   ======   ========  =====   ===   ====== ===
        1                 DOS-BIG       1   538     538   20
SELECT ONE OF THE FOLLOWING:
     1.   Create a partition
     2.   Change Active (Boot from) partition
     3.   Delete a partition
     4.   Exit (Update disk configuration and exit)
     5.   Cancel (Exit without updating disk configuration)
Enter Selection: 1
Indicate the type of partition you want to create
  (1=SOLARIS, 2=UNIX, 3=PCIXOS, 4=Other, 8=DOSBIG)
  (5=DOS12, 6=DOS16, 7=DOSEXT, 0=Exit) ?1
Indicate the percentage of the disk you want this partition
to use (or enter "c" to specify in cylinders). 80
Do you want this to become the Active partition? If so, it will be 
activated each time you reset your computer or when you turn it on 
again. Please type "y" or "n". y
Partition 2 is now the Active partition Total disk size is 2694 
cylinders
             Cylinder size is 765 (512 byte) blocks
                                         Cylinders
    Partition   Status    Type      Start   End   Length    %
    =========   ======    ========  =====   ===   ======   ===
        1                 DOS-BIG       1   538     538     20
        2       Active    SOLARIS     539  2693    2155     80
SELECT ONE OF THE FOLLOWING:
     1.   Create a partition
     2.   Change Active (Boot from) partition
     3.   Delete a partition
     4.   Exit (Update disk configuration and exit)
     5.   Cancel (Exit without updating disk configuration)
Enter Selection: Selection: 4
WARNING: Solaris fdisk partition changed - Please relabel the disk
format> label
Ready to label disk, continue? yes
format> q

IA: 例 - Solaris fdisk パーティションと、DOSBIG fdisk パーティションを作成する

次の例は、Solaris fdisk パーティションと DOSBIG fdisk パーティションを作成する方法を説明しています。


format> fdisk
The recommended default partitioning for your disk is:
   a 100% "SOLARIS System" partition.
To select this, please type "y".  To partition your disk
differently, type "n" and the "fdisk" program will let you
select other partitions. n
             Total disk size is 2694 cylinders
             Cylinder size is 765 (512 byte) blocks
                                         Cylinders
    Partition   Status    Type      Start   End   Length    %
    =========   ======    ========  =====   ===   ======   ===
THERE ARE NO PARTITIONS CURRENTLY DEFINED SELECT ONE OF THE FOLLOWING:
     1.   Create a partition
     2.   Change Active (Boot from) partition
     3.   Delete a partition
     4.   Exit (Update disk configuration and exit)
     5.   Cancel (Exit without updating disk configuration)
Enter Selection: 1
Indicate the type of partition you want to create
  (1=SOLARIS, 2=UNIX, 3=PCIXOS, 4=Other, 8=DOSBIG)
  (5=DOS12, 6=DOS16, 7=DOSEXT, 0=Exit) ?8
Indicate the percentage of the disk you want this partition
to use (or enter "c" to specify in cylinders). 20
Do you want this to become the Active partition? If so, it will be 
activated each time you reset your computer or when you turn it on 
again. Please type "y" or "n". n
             Total disk size is 2694 cylinders
             Cylinder size is 765 (512 byte) blocks
                                        Cylinders
    Partition   Status    Type      Start   End   Length    %
    =========   ======    ========  =====   ===   ======   ===
        1                 DOS-BIG       1   538     538     20
SELECT ONE OF THE FOLLOWING:
     1.   Create a partition
     2.   Change Active (Boot from) partition
     3.   Delete a partition
     4.   Exit (Update disk configuration and exit)
     5.   Cancel (Exit without updating disk configuration)Enter
Selection: 1
Indicate the type of partition you want to create
  (1=SOLARIS, 2=UNIX, 3=PCIXOS, 4=Other, 8=DOSBIG)
  (5=DOS12, 6=DOS16, 7=DOSEXT, 0=Exit) ?1
Indicate the percentage of the disk you want this partition
to use (or enter "c" to specify in cylinders). 80
Do you want this to become the Active partition? If so, it will be 
activated each time you reset your computer or when you turn it on 
again. Please type "y" or "n". y
Partition 2 is now the Active partition Total disk size is 2694 
cylinders
            Cylinder size is 765 (512 byte) blocks
                                         Cylinders
    Partition   Status    Type      Start   End   Length    %
    =========   ======    ========  =====   ===   ======   ===
        1                 DOS-BIG       1   538     538     20
        2       Active    SOLARIS     539  2693    2155     80
 
SELECT ONE OF THE FOLLOWING:
     1.   Create a partition
     2.   Change Active (Boot from) partition
     3.   Delete a partition
     4.   Exit (Update disk configuration and exit)
     5.   Cancel (Exit without updating disk configuration)
Enter Selection: 4
format> q

IA: ディスクスライスとディスクラベルを作成する方法

  1. スーパーユーザーになります。

  2. format ユーティリティを起動します。


    # format
    
  3. 画面に表示されるリストから、パーティションを変更したいディスクの番号を入力します。


    Specify disk (enter its number): disk-number
    

    disk-number

    パーティションを変更したいディスクの番号 

  4. partition メニューに移動します (スライスを設定できます)。


    format> partition
    
  5. 現在のパーティション (スライス) テーブルを表示します。


    partition> print
    
  6. 変更作業を開始します。


    partition> modify
    
  7. ディスクをすべて free hog に設定します。


    Choose base (enter number) [0]? 1
    

    free hog スライスについての詳細は、「free hog スライスの使用方法」を参照してください。

  8. 続行するかどうかを尋ねるプロンプトが表示されたら、yes と応答して新しいパーティションテーブルを作成します。


    Do you wish to continue creating a new partition
    table based on above table[yes]? yes
    
  9. プロンプトが表示されたら、free hog パーティション (スライス) と各スライスのサイズを指定します。

    システムディスクを追加するときは、次のスライスを設定しなければなりません。

    • ルート (スライス 0)、スワップ (スライス 1) (必須)

    および

    • /usr (スライス 6) (省略可能)

    スライスの情報を設定すると、新しいパーティションテーブルが表示されます。

  10. プロンプトが表示されたら yes と応答して、表示されたパーティションテーブルを現在のパーティションテーブルにします。


    Okay to make this the current partition table[yes]? yes
    

    表示されたパーティションテーブルが希望どおりでないために変更したい場合は、no と応答して 手順 6 に戻ります。

  11. パーティションテーブルに名前を付けます。


    Enter table name (remember quotes): "partition-name"
    

    partition-name

    新しいパーティションテーブルの名前 

  12. 新しいディスク上でスライスを割り当て終ったら、新しいパーティションテーブルを使用してディスクにラベルを付けます。


    Ready to label disk, continue? yes
    
  13. partition メニューを終了します。


    partition> quit
    
  14. verify コマンドで、新しいディスクラベルを確認します。


    format> verify
    
  15. format メニューを終了します。


    format> quit
    

次に進む手順

ディスクスライスとディスクラベルを作成し終ったら、ディスク上にファイルシステムを作成できます。「IA: ファイルシステムを作成する方法」を参照してください。

IA: ファイルシステムを作成する方法

  1. スーパーユーザーになります。

  2. newfs コマンドを使用して、スライスごとにファイルシステムを作成します。


    # newfs /dev/rdsk/cwtxdysz
    

    /dev/rdsk/cwtxdysZ

    作成するファイルシステムの raw デバイス 

    newfs コマンドについての詳細は、第 36 章「ファイルシステムのマウントとマウント解除 (手順)」を参照してください。

  3. 未使用のマウントポイントにマウントすることによって、新しいファイルシステムを確認します。


    # mount /dev/dsk/cwtxdysz /mnt
    # ls /mnt
    lost+found

次に進む手順

追加するディスク 

参照先 

システムディスク 

ディスク上にルート (/) と /usr のファイルシステムを復元する必要がある。第 44 章「ファイルとファイルシステムの復元 (手順)」を参照。

ルート (/) と /usr ファイルシステムの復元後、ブートブロックをインストールする。「IA: システムディスクにブートブロックをインストールする方法」を参照。

二次ディスク 

新しいディスク上にファイルシステムを復元しなければならないことがある。第 44 章「ファイルとファイルシステムの復元 (手順)」を参照。

 

新しいディスク上にファイルシステムを復元しない場合は、二次ディスクを追加する作業が終ったことになる。ファイルシステムをユーザーが利用できるようにする方法については、第 36 章「ファイルシステムのマウントとマウント解除 (手順)」を参照。

IA: システムディスクにブートブロックをインストールする方法

  1. スーパーユーザーになります。

  2. 次のコマンドを入力します。


    # installboot /usr/platform/`uname -i`/lib/fs/ufs/pboot /usr/platform/`uname -i`
    /lib/fs/ufs/bootblk /dev/rdsk/cwtxdys2
    

    /usr/platform/`uname -i`/lib/fs/ufs/pboot

    パーティションのブートファイル 

    /usr/platform/`uname -i`/lib/fs/ufs/bootblk

    ブートブロックコード 

    /dev/rdsk/cwtxdys2

    ディスク全体を表す raw デバイス名 

  3. システムをリブートし、レベル 3 で実行することによって、ブートブロックがインストールされていることを確認します。


    # init 6
    

IA: 例 - システムディスクにブートブロックをインストールする


# installboot /usr/platform/i86pc/lib/fs/ufs/pboot
 /usr/platform/i86pc/lib/fs/ufs/bootblk /dev/rdsk/c0t6d0s2