トップページ » Solarisデスクトップ設定 » SolarisでUSBハードディスクを使うには
カテゴリー
My Yahoo!に追加
Sun社提供情報
Solarisパッケージダウンロード
Sunマシンは買うには
blogs.sun.com
お勧めサイト
プライベートリンク

SolarisでUSBハードディスクを使うには

■ マシン環境
ハードウェア:Sun Java Workstation W1100z


bash-2.05# uname -a
SunOS W1100z 5.9 Generic_117172-12 i86pc i386 i86pc
bash-2.05# more /etc/release
Solaris 9 9/04 s9x_u7wos_09 x86
Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 28 June 2004
 
USBハードディスク: 160GB HDH-U160S (アイオーデータ製)

■ システムへの接続・認識

USBといえばホットプラグは当たりまえ!ということで稼働しているW1100zにUSBハードディスクを装着して、電源を入れてみた。

すると/var/adm/messagesに以下のような出力が・・・

bash-2.05# more /var/adm/messages
...
Jan 31 23:28:40 W1100z usba10: [ID 464422 kern.warning] WARNING: /pci@0,0/pci1022,7460@6/pci108e,534d@3,2/storage@3 (usba10_scsa2usb0): INQUIRY failed, cannot determine device type, pkt_reason=0x6
Jan 31 23:28:40 W1100z usba10: [ID 855233 kern.info] USB-device: storage@3, usba10_scsa2usb0 at bus address 2
Jan 31 23:28:40 W1100z usba10: [ID 349649 kern.info] I-O DATA DEVICE,INC. HDH-U 0000000098CD
Jan 31 23:28:40 W1100z genunix: [ID 936769 kern.info] usba10_scsa2usb0 is /pci@0,0/pci1022,7460@6/pci108e,534d@3,2/storage@3
Jan 31 23:28:40 W1100z genunix: [ID 408114 kern.info] /pci@0,0/pci1022,7460@6/pci108e,534d@3,2/storage@3 (usba10_scsa2usb0) online
Jan 31 23:28:40 W1100z scsi: [ID 193665 kern.info] sd31 at usba10_scsa2usb0: target 0 lun 0
Jan 31 23:28:40 W1100z genunix: [ID 936769 kern.info] sd31 is /pci@0,0/pci1022,7460@6/pci108e,534d@3,2/storage@3/disk@0,0
Jan 31 23:28:40 W1100z genunix: [ID 408114 kern.info] /pci@0,0/pci1022,7460
@6/pci108e,534d@3,2/storage@3/disk@0,0 (sd31) online

...

ちゃんと認識したようだ。
/dev/rdskを確認するとデバイスが増えている。

bash-2.05# ls -l /dev/rdsk | grep "storage@3/disk@0,0" | more
lrwxrwxrwx 1 root other 78 1月 30日 14:55 c4t0d0p0 -> ../../devices/pci@0,0/
pci1022,7460@6/pci108e,534d@3,2/storage@3/disk@0,0:q,raw
lrwxrwxrwx 1 root other 78 1月 30日 14:55 c4t0d0p1 -> ../../devices/pci@0,0/
pci1022,7460@6/pci108e,534d@3,2/storage@3/disk@0,0:r,raw
lrwxrwxrwx 1 root other 78 1月 30日 14:55 c4t0d0p2 -> ../../devices/pci@0,0/
pci1022,7460@6/pci108e,534d@3,2/storage@3/disk@0,0:s,raw
...
...省略


■ パーティション分割・フォーマット

まずfdiskコマンドでSolarisで使用するハードディスク領域を確保してみる。
ハードディスクの初期状態によっては下記と同じ出力結果にならない場合もあるが、最終的に全領域をSolaris用に設定すればよい。

bash-2.05# fdisk /dev/rdsk/c4t0d0p0
No fdisk table exists. The default partition for the disk is:

a 100% "SOLARIS System" partition

Type "y" to accept the default partition, otherwise type "n" to edit the
partition table.
y <--- yesで答える
bash-2.05#

もう一回実行して確認してみる。

bash-2.05# fdisk /dev/rdsk/c4t0d0p0

Total disk size is 19929 cylinders
Total disk size is 19929 cylinders
Cylinder size is 16065 (512 byte) blocks

Cylinders
Partition Status Type Start End Length %
========= ====== ============ ===== === ====== ===
1 Active Solaris 1 19928 19928 100

SELECT ONE OF THE FOLLOWING:

1. Create a partition
2. Specify the active partition
3. Delete a partition
4. Exit (update disk configuration and exit)
5. Cancel (exit without updating disk configuration)
Enter Selection: 4 <-- ここに上記メニューの数字を入力しいろいろ操作可能

ちなみにこのモードでWindows用のFAT32などの領域も確保できる。
今回は全領域をSolarisで使うのでこのまま終了(4)。

次に、Solaris用に確保した上記領域(約160GB)をスライスに分割するためにformatコマンドを用いる。ここではリムーバブルデバイスも表示させる -e オプション(エキスパートモード)で実行している。

bash-2.05# format -e
Searching for disks...done


AVAILABLE DISK SELECTIONS:
0. c0d0
/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0
1. c0d1
/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0
2. c4t0d0
/pci@0,0/pci1022,7460@6/pci108e,534d@3,2/storage@3/disk@0,0
Specify disk (enter its number): 2 <-- USBディスクを選択

上記のようにシステムが認識しているハードディスクが表示されるので新しく接続した2番を選択する。ちなみに0と1は内蔵のIDEハードディスク。

あとはいつも通り、パーティションテーブルを作成するだけなので簡単。
ちなみにこんな感じで分けてみました。

Current partition table (unnamed):
Total disk cylinders available: 19926 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 alternates wm 1 - 9138 70.00GB (9138/0/0) 146801970
1 alternates wm 9139 - 19925 82.63GB (10787/0/0) 173293155
2 backup wu 0 - 19925 152.64GB (19926/0/0) 320111190
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 - 0 7.84MB (1/0/0) 16065
9 unassigned wm 0 0 (0/0/0) 0

最後に以下のようにnewfsでUFSファイルシステムを構築。

bash-2.05# newfs /dev/rdsk/c4t0d0s0
newfs: 新しいファイルシステム /dev/rdsk/c4t0d0s0 を作成しますか: (y/n)? y
警告: 最終シリンダグループに対して
i ノードブロック数/シリンダブロック数 (530) >= データブロック数 (118)
です。このため 1890 セクタの割り当てはできません。
/dev/rdsk/c4t0d0s0: 全セクター数: 146800080 (シリンダ数: 9709、トラック数: 240、セクター数: 63)
71679.7MB、1387 シリンダグループ (7 c/g, 51.68MB/g, 6272 i/g)
スーパーブロックのバックアップの位置 (fsck -F ufs -o b=# のため) :
32, 105936, 211840, 317744, 423648, 529552, 635456, 741360, 847264, 953168,
シリンダグループの初期化:
...........................
スーパーブロックのバックアップの位置 (最後の 10 シリンダグループのため):
145747920, 145853824, 145959728, 146065632, 146171536, 146277440, 146383344,
146489248, 146595152, 146701056,

bash-2.05# newfs /dev/rdsk/c4t0d0s1
newfs: 新しいファイルシステム /dev/rdsk/c4t0d0s1 を作成しますか: (y/n)? y
警告: 最終シリンダで 12286 セクタが割り当てられません。
/dev/rdsk/c4t0d0s1: 全セクター数: 173293154 (シリンダ数: 11462、トラック数: 240、セクター数: 63)
84615.8MB、1638 シリンダグループ (7 c/g, 51.68MB/g, 6272 i/g)
スーパーブロックのバックアップの位置 (fsck -F ufs -o b=# のため) :
32, 105936, 211840, 317744, 423648, 529552, 635456, 741360, 847264, 953168,
シリンダグループの初期化:
................................
スーパーブロックのバックアップの位置 (最後の 10 シリンダグループのため):
172313440, 172419344, 172525248, 172631152, 172737056, 172842960, 172948864,
173054768, 173160672, 173266576,

※ 警告が出てるが、ディスク領域の端数の問題なので動作に影響はない。

■ マウントの確認

bash-2.05# mkdir /usb0
bash-2.05# mkdir /usb1
bash-2.05# mount /dev/dsk/c4t0d0s0 /usb0
bash-2.05# mount /dev/dsk/c4t0d0s1 /usb1

bash-2.05# df -h
ファイルシステム サイズ 使用済み 使用可能容量 マウント先
/dev/md/dsk/d0 67G 2.8G 64G 5% /
/proc 0K 0K 0K 0% /proc
mnttab 0K 0K 0K 0% /etc/mnttab
fd 0K 0K 0K 0% /dev/fd
swap 1.3G 24K 1.3G 1% /var/run
swap 1.3G 12K 1.3G 1% /tmp
/dev/md/dsk/d10 7.1G 7.3M 7.0G 1% /export/home
/dev/dsk/c4t0d0s0 69G 64M 68G 1% /usb0
/dev/dsk/c4t0d0s1 81G 64M 81G 1% /usb1

■ 書き込み確認

bash-2.05# ufsdump 0uf /usb0/root.bk /
DUMP: Date of this level 0 dump: 2005年02月02日 (水) 16時16分57秒
DUMP: Date of last level 0 dump: the epoch
DUMP: Dumping /dev/md/rdsk/d0 (W1100z:/) to /usb0/root.bk.
DUMP: Mapping (Pass I) [regular files]
DUMP: Mapping (Pass II) [directories]
DUMP: Writing 32 Kilobyte records
DUMP: Estimated 5963990 blocks (2912.10MB).
DUMP: Dumping (Pass III) [directories]
DUMP: Dumping (Pass IV) [regular files]
DUMP: 5963966 blocks (2912.09MB) on 1 volume at 9219 KB/sec
DUMP: DUMP IS DONE
DUMP: Level 0 dump on 2005年02月02日 (水) 16時16分57秒

bash-2.05# df -k
ファイルシステム kbytes 使用済み 使用可能容量 マウント先
/dev/md/dsk/d0 70575514 2952059 66917700 5% /
/proc 0 0 0 0% /proc
mnttab 0 0 0 0% /etc/mnttab
fd 0 0 0 0% /dev/fd
swap 1330048 24 1330024 1% /var/run
swap 1330052 28 1330024 1% /tmp
/dev/md/dsk/d10 7458949 7430 7376930 1% /export/home
/dev/dsk/c4t0d0s0 72290402 3049001 68518497 5% /usb0
/dev/dsk/c4t0d0s1 85336135 65553 84417221 1% /usb1


ちゃんとデータが書き込まれてる。

Solarisデスクトップ設定のその他のリンク

Solaris系技術トレーニング一覧

Solaris10システム管理基本コース
Solaris10ネットワーク・インターネットサーバー管理コース
セキュリティ・パフォーマンス管理・トラブルシューティング等
Sun Cluster、ボリューム管理ソフトウェア
仮想化技術全般
シンクライアント、SunRay、デスクトップソフトウェア
アイデンティティマネージメントサービス
アプリケーションサーバーとWebポータル
サーバー(ハードウェア)メンテナンス
Sun Java CAPS
MySQL

コメント

PVWew5 tmqbqwelrilz, [url=http://ccqblvffoxql.com/]ccqblvffoxql[/url], [link=http://kwqqzihnndbp.com/]kwqqzihnndbp[/link], http://ttkkywziowxo.com/

Posted by: tinlteq : 2009年11月11日 01:57

roabjgrh [URL=http://vbijkxyx.com]jwnookfr[/URL] qpdvahwm http://pqffmvnn.com igzbjxwn aimsszvg

Posted by: uhwzwjqg : 2010年01月06日 16:21

czyebwdt http://gvtuqich.com jplfgala ictjkkgd [URL=http://ktshzgdj.com]nbehtewf[/URL] ihsnetih

Posted by: ulhixted : 2010年01月06日 16:37

dCV0HH yxgmobegkoha, [url=http://vikvimvhywjh.com/]vikvimvhywjh[/url], [link=http://cgeuezibgvao.com/]cgeuezibgvao[/link], http://harumiwjmjit.com/

Posted by: jwjhdk : 2010年01月22日 18:49

yJphZZ djmmpfvcbbcu, [url=http://qafxlckwdstd.com/]qafxlckwdstd[/url], [link=http://vufllfoouldb.com/]vufllfoouldb[/link], http://hqvbblmulbml.com/

Posted by: kdxtng : 2010年02月25日 14:44

hEGIM1 hooampvlpolh, [url=http://lydcrobjkfbw.com/]lydcrobjkfbw[/url], [link=http://yfwadkmgpoat.com/]yfwadkmgpoat[/link], http://jgqvshuwftwf.com/

Posted by: ugcprfxaese : 2010年06月26日 20:56

hEGIM1 hooampvlpolh, [url=http://lydcrobjkfbw.com/]lydcrobjkfbw[/url], [link=http://yfwadkmgpoat.com/]yfwadkmgpoat[/link], http://jgqvshuwftwf.com/

Posted by: ugcprfxaese : 2010年06月26日 20:56

hEGIM1 hooampvlpolh, [url=http://lydcrobjkfbw.com/]lydcrobjkfbw[/url], [link=http://yfwadkmgpoat.com/]yfwadkmgpoat[/link], http://jgqvshuwftwf.com/

Posted by: ugcprfxaese : 2010年06月26日 20:57
コメントする









名前、アドレスを登録しますか?