|
今天发现的.其实就是把硬盘的DMA模式打开只是不是对所有的硬盘都有效,所以大家在使用时最好先把重要的数据备份一下,我是先在vm上试用的。
步骤:先su成root,因为普通用户没有权限修改,然后输入/sbin/hdparm /dev/hda,就能看到
/dev/hda:
multcount = 64 (on)
IO_support = 0 (default 16-bit)
unmaskirq = 0 (off)
using_dma = 1 (on)
keepsettings = 0 (off)
readonly = 0 (off)
readahead = 8 (on)
geometry = 780/128/63, sectors = 6291456, start = 0
看得出dma是打开了的,但io仍是16位的。这时我们再输入/sbin/hdparm -c3 /dev/hda硬盘的16位格式转换为32位模式,再/sbin/hdparm /dev/hda,就是
/dev/hda:
multcount = 64 (on)
IO_support = 3 (32-bit w/sync)
unmaskirq = 0 (off)
using_dma = 1 (on)
keepsettings = 0 (off)
readonly = 0 (off)
readahead = 8 (on)
geometry = 780/128/63, sectors = 6291456, start = 0
这时再运行一下,是不是速度快多了?主要是在vm下,速度一下就感觉出来了
另外再说说Multcount,这是硬盘的多路扇区的读功能,从上面我们看得出是一次读64个扇区,我们也可以用hdparm -i /dev/hda 来看看硬盘最大能读写的扇区数目。
/dev/hda:
Model=VMware Virtual IDE Hard Drive, FwRev=00000001, SerialNo=00000000000000000001
Config={ HardSect NotMFM HdSw>15uSec SpinMotCtl Fixed DTR>5Mbs FmtGapReq }
RawCHS=6241/16/63, TrkSize=0, SectSize=0, ECCbytes=0
BuffType=unknown, BuffSize=32kB, MaxMultSect=64, MultSect=64
CurCHS=6241/16/63, CurSects=6290928, LBA=yes, LBAsects=6291456
IORDY=on/off, tPIO={min:160,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio1 pio2 pio3 pio4
DMA modes: mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 *udma2
AdvancedPM=yes: disabled (255)
Drive conforms to: ATA/ATAPI-4 T13 1153D revision 17: 2
看得出就是64了,已经是最大了。 |
|