<< Back to man.ChinaUnix.net

11.18. /etc/hdparm.conf

hdparm命令是很有用的,它可以设置驱动器的运行参数,以提高系统性能,如硬盘的DMA开关就是通过该命令设置的。所以在Debian系统中已设置了开机自启动hdparm命令的Script,该Script位于/etc/rcS.d/目录下。当Debian系统启动时会自动运行该Script,并从/etc/hdparm.conf配置文件中读出配置参数来运行hdparm命令,从而达到自动设置驱动器运行参数的目的。/etc/hdparm.conf里列出了所有的配置参数说明,并有几个典型的示例。我们只要修改一下示例就可以用了。如:

...

#Samples follow:
#First three are good for devfs systems, fourth one for systems that do
#not use devfs.  The fifth example uses straight hdparm command line
#syntax.  Any of the blocks that use command line syntax must begin with
#the keyword 'command_line', and no attempt is made to validate syntax.
#It is provided for those more comfortable with hdparm syntax.

#/dev/discs/disc0/disc {
#       mult_sect_io = 16
#       write_cache = off
#       spindown_time = 240
#}

#/dev/discs/disc1/disc {
#       mult_sect_io = 32
#       spindown_time = 36
#       write_cache = off
#}

#/dev/cdroms/cdrom0 {
#       dma = on
#       interrupt_unmask = on
#       io32_support = 0
#}

/dev/hda {
        mult_sect_io = 16
        write_cache = off
        dma = on
}

#command_line {
#       hdparm -q -m16 -q -W0 -q -d1 /dev/hda
#}

重启电脑就可使配置生效。