HOME / コンピュータTips / Solaris / ディスクキャッシュの操作
Date: 2009/12/18 |
|
Tags: Solaris, OpenSolaris, キャッシュ, 有効, 無効, raidctl, コントロール, ライトキャッシュ, リードキャッシュ
RAIDの状態を確認する
pfexec raidctl -l
例)
Controller: 8
Volume:c8t1d0
Disk: 0.2.0
Disk: 0.9.0
RAIDボリュームとしてc8t1d0があるのが確認できる。この状態を確認する
pfexec raidctl -l c8t1d0
Volume Size Stripe Status Cache RAID
Sub Size Level
Disk
----------------------------------------------------------------
c8t1d0 1.8T N/A OPTIMAL OFF RAID1
0.9.0 1.8T GOOD
0.2.0 1.8T GOOD
キャッシュがOFFになっていることがわかる。
ONにする。
pfexec raidctl -p wp=on c8t1d0
出力)
Update attribute of array c8t1d0 (yes/no)? yes Set attribute of RAID volume c8t1d0 successfully.
再び確認する
pfexec raidctl -l c8t1d0
出力)
Volume Size Stripe Status Cache RAID
Sub Size Level
Disk
----------------------------------------------------------------
c8t1d0 1.8T N/A OPTIMAL ON RAID1
0.9.0 1.8T GOOD
0.2.0 1.8T GOOD
実は、この結果をiostatのログでみせようと思っていたのですが、データを取り忘れました。
結果的に、
iostat -Yn 1
等としておき、%b、%w、wsvc_t、asvc_tの値に注目しておきます。
これは、それぞれ平たく言うと
です。
Write Cacheを有効にすると、%b、%wの値が100に張り付くことが、少なくなるかんじです。
単品ディスクの時はformatコマンドに、exportオプション(-e)をつけて設定します。formatコマンドは非常に危険なので、ご注意。
cacheのコントロールが効かないアダプタや、ディスクもあります。
pfexec format -e
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c3d0 <DEFAULT cyl 15586 alt 2 hd 255 sec 63>
/pci@0,0/pci-ide@1f,1/ide@0/cmdk@0,0
1. c4t0d0 <DEFAULT cyl 60797 alt 2 hd 255 sec 63>
/pci@0,0/pci17aa,20a7@1f,2/disk@0,0
Specify disk (enter its number): 1
selecting c4t0d0
[disk formatted]
/dev/dsk/c4t0d0s0 is part of active ZFS pool rpool. Please see zpool(1M).
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
fdisk - run the fdisk program
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
scsi - independent SCSI mode selects
cache - enable, disable or query SCSI disk cache
volname - set 8-character volume name
!<cmd> - execute <cmd>, then return
quit
ここの一覧にcacheがあればサポートされています。
format> cache
cacheと入力します。
CACHE MENU:
write_cache - display or modify write cache settings
read_cache - display or modify read cache settings
!<cmd> - execute <cmd>, then return
quit
cache> write_cache
write_cacheとread_cacheが選べます。ここではwrite_cacheを選びます。
WRITE_CACHE MENU:
display - display current setting of write cache
enable - enable write cache
disable - disable write cache
!<cmd> - execute <cmd>, then return
quit
write_cache> display
displayで現状が表示できます
Write Cache is enabled