UJP - 技術情報

Life is fun and easy!

不正IP報告数

Okan Sensor
 
メイン
ログイン
ブログ カテゴリ一覧

     

Solarisのハードディスク増設


Solarisのハードディスク増設


0.改定履歴

  • 1997.09.21 初版
  • 1997.10.05 文字の間違い修正(作業内容に変更なし)と,センタリングをなおした

1.はじめに

 この手順では,内蔵2Gハードディスクを2台搭載しているUltraSPARCに,外付けドライブをSCSIで接続し,利用できる様にするまでの手順を示す.

 なお,事前にドキュメント「Solarisのディスク関係」を理解していることを前提とする. ここで利用するのは外付けハードディスクは,2Gを4つ搭載したモデルである.

2.接続前の状態の確認

2.1.ハードディスクの接続状況を確認する

 増設前の現在の状態を確認するためには,formatコマンドを入力する.

root@duo: format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c0t0d0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
          /sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@0,0
       1. c0t1d0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
          /sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@1,0
Specify disk (enter its number):

 これを見て判るように,ハードディスクは2台接続されていることが判る.

2.2.ファイルシステムのマウント状態を確認する

 現在のマウント状態をdfコマンドによって確認する.

root@duo: df -k
ファイルシステム     Kバイト  使用済  使用可 使用率    マウント場所
/dev/dsk/c0t0d0s0      48023   12538   30685    30%    /
/dev/dsk/c0t0d0s6     125735   94384   18781    84%    /usr
/proc                      0       0       0     0%    /proc
fd                         0       0       0     0%    /dev/fd
/dev/dsk/c0t0d0s4     105943    3868   91485     5%    /var
/dev/dsk/c0t1d0s7    1952573       9 1757314     1%    /actuate
/dev/dsk/c0t0d0s7    1028102       9  925283     1%    /export/home
/dev/dsk/c0t0d0s5     202719   80040  102409    44%    /opt
/dev/dsk/c0t0d0s3     316279  239191   45468    85%    /usr/openwin
swap                  499288       8  499280     1%    /tmp
root@duo:

3.外付けハードディスクの接続と再起動

 外付けハードディスクを接続するには,マシンをシャットダウンした後で行なう. また,ハードディスクを認識させるためにコンフィギュレーションブート(boot -r)を行なう.

  • マシンをシャットダウンする.(haltコマンドとかshutdown -i0 -g0 -y)
  • 外付けディスクを接続する.
  • マシンの電源を入れる
  • メモリのカウントを行なっているところでSTOP+Aで停止する
  • okプロンプトからboot -rを実行する.
  • しばらくすると,OSが起動する.

4.外付けディスクの認識の確認

 これで認識されたか否かを再度,formatコマンドで確認してみる.

root@duo: format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c0t0d0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
          /sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@0,0
       1. c0t1d0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
          /sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@1,0
       2. c1t0d0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
          /sbus@1f,0/SUNW,fas@0,8800000/sd@0,0
       3. c1t1d0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
          /sbus@1f,0/SUNW,fas@0,8800000/sd@1,0
       4. c1t2d0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
          /sbus@1f,0/SUNW,fas@0,8800000/sd@2,0
       5. c1t3d0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
          /sbus@1f,0/SUNW,fas@0,8800000/sd@3,0
Specify disk (enter its number):

 2〜5が追加されていることが判る.

5.物理フォーマット

 殆どのハードディスクは,その出荷時にフォーマットされているらしいが,念の為に物理フォーマットを行なっておいた方が良いと思われる. ここでは,物理フォーマットを行なう.

 物理フォーマットは,formatコマンドで行なう.

root@duo: format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c0t0d0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
          /sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@0,0
       1. c0t1d0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
          /sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@1,0
       2. c1t0d0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
          /sbus@1f,0/SUNW,fas@0,8800000/sd@0,0
       3. c1t1d0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
          /sbus@1f,0/SUNW,fas@0,8800000/sd@1,0
       4. c1t2d0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
          /sbus@1f,0/SUNW,fas@0,8800000/sd@2,0
       5. c1t3d0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
          /sbus@1f,0/SUNW,fas@0,8800000/sd@3,0
Specify disk (enter its number):

  • ここでは,4番のフォーマットを行なう場合を示す.
  • "Specify disk (enter its number): "で,4を入力する.
  • すると,次のように表示される.

Specify disk (enter its number): 4
selecting c1t2d0
[disk formatted]


FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        quit
format>

  • ここで,formatを選択する.

format> format


Ready to format.  Formatting cannot be interrupted
and takes 27 minutes (estimated). Continue? y
Beginning format. The current time is Sat Sep 20 15:32:09 1997

Formatting...
done

Verifying media...
        pass 0 - pattern = 0xc6dec6de
   2732/18/14  

        pass 1 - pattern = 0x6db6db6d
   2732/18/14  

Total of 0 defective blocks repaired.
format>

  • 2Gのディスクで物理フォーマットには約30分かかり,アナライズに再度30分程かかるようである.
  • 同時に複数のディスクの物理フォーマットを行なえば,時間を節約できる.

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

 物理フォーマットが終了したら,新しいファイルシステムを作成する. ファイルシステムを作成するには,newfsコマンドを使用する.

 ここでは,ディスクc0t0d0に対してファイルシステムを作成する.

 その場合には,次のようなコマンドを入力する.

newfs /dev/rdsk/c0t0d0s2

 ここで注意するのは,c0t0d0s2の最後のs2を付けることである. これは“ディスクc0t0d0のスライスの2番”を示す意味であって,ディスク全体を示すパーティションの事である. この意味に関してはドキュメント「Solarisのディスク関係」を参照する.

 newfsコマンドを入力すると,次の様に表示される.

root@duo: newfs /dev/rdsk/c0t0d0s2
newfs: /dev/rdsk/c0t0d0s2 last mounted as /
newfs: construct a new file system /dev/rdsk/c0t0d0s2: (y/n)? y
/dev/rdsk/c0t0d0s2:全セクタ数: 4154160  (シリンダ数: 2733、トラック数: 19、セク
タ数: 80)
        2028.4MB、171 シリンダグループ (16 c/g, 11.88MB/g, 5696 i/g)
スーパーブロックのバックアップの位置 (fsck -F ufs -o b=# のため) :
 32, 24432, 48832, 73232, 97632, 122032, 146432, 170832, 195232, 219632,
 244032, 268432, 292832, 317232, 341632, 366032, 390432, 414832, 439232,
 463632, 488032, 512432, 536832, 561232, 585632, 610032, 634432, 658832,
 683232, 707632, 732032, 756432, 778272, 802672, 827072, 851472, 875872,
 900272, 924672, 949072, 973472, 997872, 1022272, 1046672, 1071072, 1095472,
 1119872, 1144272, 1168672, 1193072, 1217472, 1241872, 1266272, 1290672,
 1315072, 1339472, 1363872, 1388272, 1412672, 1437072, 1461472, 1485872,
 1510272, 1534672, 1556512, 1580912, 1605312, 1629712, 1654112, 1678512,
 1702912, 1727312, 1751712, 1776112, 1800512, 1824912, 1849312, 1873712,
 1898112, 1922512, 1946912, 1971312, 1995712, 2020112, 2044512, 2068912,
 2093312, 2117712, 2142112, 2166512, 2190912, 2215312, 2239712, 2264112,
 2288512, 2312912, 2334752, 2359152, 2383552, 2407952, 2432352, 2456752,
 2481152, 2505552, 2529952, 2554352, 2578752, 2603152, 2627552, 2651952,
 2676352, 2700752, 2725152, 2749552, 2773952, 2798352, 2822752, 2847152,
 2871552, 2895952, 2920352, 2944752, 2969152, 2993552, 3017952, 3042352,
 3066752, 3091152, 3112992, 3137392, 3161792, 3186192, 3210592, 3234992,
 3259392, 3283792, 3308192, 3332592, 3356992, 3381392, 3405792, 3430192,
 3454592, 3478992, 3503392, 3527792, 3552192, 3576592, 3600992, 3625392,
 3649792, 3674192, 3698592, 3722992, 3747392, 3771792, 3796192, 3820592,
 3844992, 3869392, 3891232, 3915632, 3940032, 3964432, 3988832, 4013232,
 4037632, 4062032, 4086432, 4110832, 4135232,
root@duo:

  • UltraSPARC 167MHzで2GのボリュームでFastWideSCSIで約5分かかる.
  • 使用するすべてのディスクドライブにファイルシステムを作成する.
  • これも複数のドライブに同時に行なうことが出来る.

5.マウントポイントの作成

 今回ファイルシステムを作成したディスクを,どこにマウントするかを指定する作業を行なう必要がある. そのためにマウントポイントを作成する.

 マウントポイントとは,単なるディレクトリである.

mkdir /macintosh

 適切な物を作ればよい.

 ディレクトリは階層が深い物でも良いらしい. たとえば,現在macintoshというディレクトリがあるのであれば,その下にpowerbookを作成して新しいディスクにあてがうときは,powerbookというディレクトリを作ればよいだけである.

mkdir /macintosh/powerbook

6.ディスクのマウント

 作成したマウントポイントにディスクをマウントするには,mountコマンドを使用する.

 たとえば,/dev/dsk/c1t1d0s2を/macintoshにマウントしたい場合には,次のようなコマンドを入力する.

mount /dev/dsk/c1t1d0s2 /macintosh

7.自動的にマウントさせる方法

 マシンの起動時に,自動的にディスクをマウントするには,vfstabを編集する.

 多分,rcにmount〜なんて書いていてもだめなのかもしれない. vfstabの編集に関しては,ドキュメント「/etc/vfstabの編集」を参照のこと



広告スペース
Google