Speed Up your Hard Disk on Linux
2008-09-02 11:00
375 查看
Linux Hard Disk Speed up.
Use hdparm
hdparm -I
hdparm -i to review status of hd
Hdparm configure.
1.Open DMA
-d1
-X34 or -X69 set maximum transfer mode maybe just to X69
2.32bit
-c3 set to 32bit mode
3.Write cache.
-W1 turn on
4.Read ahead
-a256
5.Sets the amount of data transferred in each interrupt to that
number (-m2, -m4, -m8, or -m16)
Making hdparm Changes Permanent
Once you find hdparm settings you like, you can make them permanent in Fedora and other Red Hat Linux systems by adding them to the /etc/sysconfig/harddisks file. That way, the settings are used each time you boot your computer. You can set some options by simply uncommenting appropriate lines from the hard disk file. For example:
USE_DMA=1
MULTIPLE_10=16
EIDE_32BIT=3
LOOKAHEAD=1
By uncommenting those lines (removing the "#" character) you can turn on DMA, enable I/O transfer in multiple sectors (16 as set here), enable 32-bit I/O support, and turn on the read-ahead feature, respectively. As an alternative, you can add hdparm parameters directly to the EXTRA_PARAMS line at the end of this file. For example:
EXTRA_PARAMS="-d1 -X67"
Or just add some line in /etc/rc.local
hdparm -d1X69 -m16 -c3 /dev/hda
hdparm -d1X69 -m16 -c3 /dev/hdb
echo "/sbin/hdparm -c 1 -d 1 -k 1 /dev/hda" >> /etc/rc.d/rc.local
如果不打开内核的SATA选项,则不能使用SATA的DMA模式,否则使用/sbin/hdparm命令时会出错。
查看内核配置:
[root@anima lwg]# cat /boot/config-2.6.9-42.0.10.EL | grep ATA
# CONFIG_X86_MCE_NONFATAL is not set
# ATA/ATAPI/MFM/RLL support
# CONFIG_BLK_DEV_IDE_SATA is not set
CONFIG_SCSI_SATA=y
CONFIG_SCSI_SATA_AHCI=m
CONFIG_SCSI_SATA_SVW=m
CONFIG_SCSI_ATA_PIIX=m
CONFIG_SCSI_SATA_MV=m
CONFIG_SCSI_SATA_NV=m
CONFIG_SCSI_SATA_QSTOR=m
CONFIG_SCSI_SATA_PROMISE=m
CONFIG_SCSI_SATA_SX4=m
CONFIG_SCSI_SATA_SIL=m
CONFIG_SCSI_SATA_SIL24=m
CONFIG_SCSI_SATA_SIS=m
CONFIG_SCSI_SATA_ULI=m
CONFIG_SCSI_SATA_VIA=m
CONFIG_SCSI_SATA_VITESSE=m
CONFIG_SCSI_SATA_INTEL_COMBINED=y
# CONFIG_SCSI_EATA is not set
# CONFIG_SCSI_EATA_PIO is not set
# CONFIG_ATALK is not set
CONFIG_USB_STORAGE_DATAFAB=y
# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set
# CONFIG_ATARI_PARTITION is not set
[root@anima lwg]#
需要打开内核的如下两个选项:
CONFIG_SCSI_SATA=y
CONFIG_SCSI_ATA_PIIX=y
重新编译内核。
Use hdparm
hdparm -I
hdparm -i to review status of hd
Hdparm configure.
1.Open DMA
-d1
-X34 or -X69 set maximum transfer mode maybe just to X69
2.32bit
-c3 set to 32bit mode
3.Write cache.
-W1 turn on
4.Read ahead
-a256
5.Sets the amount of data transferred in each interrupt to that
number (-m2, -m4, -m8, or -m16)
Making hdparm Changes Permanent
Once you find hdparm settings you like, you can make them permanent in Fedora and other Red Hat Linux systems by adding them to the /etc/sysconfig/harddisks file. That way, the settings are used each time you boot your computer. You can set some options by simply uncommenting appropriate lines from the hard disk file. For example:
USE_DMA=1
MULTIPLE_10=16
EIDE_32BIT=3
LOOKAHEAD=1
By uncommenting those lines (removing the "#" character) you can turn on DMA, enable I/O transfer in multiple sectors (16 as set here), enable 32-bit I/O support, and turn on the read-ahead feature, respectively. As an alternative, you can add hdparm parameters directly to the EXTRA_PARAMS line at the end of this file. For example:
EXTRA_PARAMS="-d1 -X67"
Or just add some line in /etc/rc.local
hdparm -d1X69 -m16 -c3 /dev/hda
hdparm -d1X69 -m16 -c3 /dev/hdb
echo "/sbin/hdparm -c 1 -d 1 -k 1 /dev/hda" >> /etc/rc.d/rc.local
如果不打开内核的SATA选项,则不能使用SATA的DMA模式,否则使用/sbin/hdparm命令时会出错。
查看内核配置:
[root@anima lwg]# cat /boot/config-2.6.9-42.0.10.EL | grep ATA
# CONFIG_X86_MCE_NONFATAL is not set
# ATA/ATAPI/MFM/RLL support
# CONFIG_BLK_DEV_IDE_SATA is not set
CONFIG_SCSI_SATA=y
CONFIG_SCSI_SATA_AHCI=m
CONFIG_SCSI_SATA_SVW=m
CONFIG_SCSI_ATA_PIIX=m
CONFIG_SCSI_SATA_MV=m
CONFIG_SCSI_SATA_NV=m
CONFIG_SCSI_SATA_QSTOR=m
CONFIG_SCSI_SATA_PROMISE=m
CONFIG_SCSI_SATA_SX4=m
CONFIG_SCSI_SATA_SIL=m
CONFIG_SCSI_SATA_SIL24=m
CONFIG_SCSI_SATA_SIS=m
CONFIG_SCSI_SATA_ULI=m
CONFIG_SCSI_SATA_VIA=m
CONFIG_SCSI_SATA_VITESSE=m
CONFIG_SCSI_SATA_INTEL_COMBINED=y
# CONFIG_SCSI_EATA is not set
# CONFIG_SCSI_EATA_PIO is not set
# CONFIG_ATALK is not set
CONFIG_USB_STORAGE_DATAFAB=y
# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set
# CONFIG_ATARI_PARTITION is not set
[root@anima lwg]#
需要打开内核的如下两个选项:
CONFIG_SCSI_SATA=y
CONFIG_SCSI_ATA_PIIX=y
重新编译内核。
相关文章推荐
- Speed up your Internet browsing on Linux with a DNS Cache server
- HowTo: Linux Check IDE / SATA Hard Disk Transfer Speed
- How to clean up disk space on Linux
- TensorFlow问题“The TensorFlow library wasn't compiled to use SSE instructions, but these are available on your machine and could speed up CPU computations.”
- How to Start Intel Hardware-assisted Virtualization (hypervisor) on Linux to Speed-up Intel Android
- Speed up Downloading Files on Linux
- 【转】How to Start Intel Hardware-assisted Virtualization (hypervisor) on Linux to Speed-up Intel Android x86 Emulator
- How to Set Up an Rsync Daemon on Your Linux Server
- TensorFlow问题:The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
- 7 Ways To Free Up Hard Disk Space On Windows
- Build Your Own Oracle RAC 11g Cluster on Oracle Linux and iSCSI
- Speed Up Your Hibernate Applications with Second-Level Caching
- [转载]How To Set Up And Use X11 Forwarding On Linux And Mac
- Your boot partition is on a disk using the GPT partitioning Scheme but this machines cannot boot
- Your File and DataBase is downloaded and backed up on our secured servers
- Setting Up A PXE Install Server For Multiple Linux Distributions and WinPE On Debian Lenny
- Hard Disk Speed - What Affects Hard Disk Performance?
- Getting Up to Speed on DNN 6.x Design(来自DNN)
- Mac Error: Disk Utility can’t repair this disk. Back up as many of your files as possible, reformat