2006年7月19日水曜日

RAID1を構成してみた

7月2日に購入したHDDでソフトウェアRAID1を組んだ。
利用しているOSはNetBSD 3.0_STABLEなのでRAIDframeで設定した。
これについてはこのページを参考にさせていただきました。



wd2,wd3をRAID1にする。
1)disklabelで利用するパーティションをa:と決めてRAIDとする。
blue# disklabel -i -I wd2
disklabel: Invalid signature in mbr record 0
partition> P
4 partitions:
# size offset fstype [fsize bsize cpg/sgs]
a: 488397168 0 4.2BSD 0 0 0 # (Cyl. 0 - 484520)
d: 488397168 0 unused 0 0 # (Cyl. 0 - 484520)
partition> a
Filesystem type [?] [4.2BSD]: RAID
Start offset ('x' to start after partition 'x') [0c, 0s, 0M]:
Partition size ('$' for all remaining) [484521c, 488397168s, 238475M]: $
a: 488397168 0 RAID # (Cyl. 0 - 484520)
partition> P
4 partitions:
# size offset fstype [fsize bsize cpg/sgs]
a: 488397168 0 RAID # (Cyl. 0 - 484520)
d: 488397168 0 unused 0 0 # (Cyl. 0 - 484520)
partition> W
Label disk [n]? y
Label written
partition> P
4 partitions:
# size offset fstype [fsize bsize cpg/sgs]
a: 488397168 0 RAID # (Cyl. 0 - 484520)
d: 488397168 0 unused 0 0 # (Cyl. 0 - 484520)
partition> Q
wd3も同様
2)設定ファイルを作り覚え込ませる
blue# cat >/etc/raid0.conf
START array
# numRow numCol numSpare
1 2 0
START disks
/dev/wd2a
/dev/wd3a
START layout
# sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_1
128 1 1 1
START queue
fifo 100
blue# raidctl -C /etc/raid0.conf raid0
blue# raidctl -I 20060717 raid0
3)RAIDを構築する(250GBで90分かかった)
blue# time raidctl -iv raid0
Initiating re-write of parity
Parity Re-write status:
99% |***************************************| ETA: 00:01 -
0.056u 0.056s 1:32:12.11 0.0% 0+0k 0+0io 0pf+0w
4)raid0デバイス用のdisklabelを作成する。d:パーティションを4.2BSDとして作る。
5)フォーマット(UFS2で行なった)した。
raidctl -s /dev/raid0d
をする(10秒程度)。
6)マウントしてみる。
mount /dev/raid0d /mnt
7)書き込んでみる
読み込みが書き込み速度の倍になっている。シングル構成のディスクで同じ事を行なったら、そちらは読み書き同じ速度だった。
そんなものなのかな。
1GB書き込み
blue# time dd if=/dev/zero of=/mnt/gomi ibs=1m obs=1m count=1024
1024+0 records in
1024+0 records out
1073741824 bytes transferred in 35.802 secs (29991112 bytes/sec)
0.010u 6.120s 0:35.80 17.1% 0+0k 33+104io 0pf+0w
1GB読み込み
blue# time dd of=/dev/null if=/mnt/gomi ibs=1m obs=1m count=1024
1024+0 records in
1024+0 records out
1073741824 bytes transferred in 16.520 secs (64996478 bytes/sec)
0.010u 3.811s 0:16.53 23.1% 0+0k 0+0io 1pf+0w

0 件のコメント:

コメントを投稿