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

ヒント

次のヒントに従って、ディスクの管理効率を高めることができます。

format セッションのデバッグ

format -M と入力して、SCSI デバイスに対してのみ有効な拡張メッセージと診断メッセージを出力するようにします。

次の例では、Inquiry: の下の一連の数字は、その右側に表示されている inquiry データの 16 進値を表わします。


# format -M
Searching for disks...done
AVAILABLE DISK SELECTIONS:
       0. c0t3d0 <SUN0535 cyl 1866 alt 2 hd 7 sec 80>
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0

Specify disk (enter its number): 0
selecting c0t3d0
[disk formatted]
format> inquiry
Inquiry:
00 00 02 02 27 00 00 12 43 4f 4e 4e 45 52 20 20     ....'...CONNER 
43 50 33 30 35 34 30 20 20 53 55 4e 30 35 33 35     CP30540  SUN0535
42 30 42 42 39 33 30 38 46 39 30                    B0BB9308F90
Vendor:   CONNER 
Product:  CP30540  SUN0535
Revision: B0BB
format> 

prtvtocfmthard コマンドを使用して複数のディスクにラベルを付ける

prtvtoc コマンドと fmthard コマンドを使用して、同じディスクジオメトリを持つ複数のディスクにラベルを付けます。

この for ループをスクリプト内で使用して、1 台のディスクからディスクラベルをコピーし、複数のディスク上で複製します。


# for i in x y z
> do
> prtvtoc /dev/rdsk/cwtxdysz | fmthard -s - /dev/rdsk/cwt${i}d0s2
> done

例 - 複数のディスクにラベルを付ける

この例では、ディスクラベルがディスク c2t0d0s0 から他の 4 台のディスクにコピーされます。


# for i in 1 2 3 5
> do
> prtvtoc /dev/rdsk/c2t0d0s0 | fmthard -s - /dev/rdsk/c2t${i}d0s2
> done
fmthard:  New volume table of contents now in place.
fmthard:  New volume table of contents now in place.
fmthard:  New volume table of contents now in place.
fmthard:  New volume table of contents now in place.
#