Linux server hard drive speed-up solution

Source: Internet
Author: User
Article Title: Linux server hard drive speed-up solution. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
At present many friends use large capacity DMA or UDMA-33 standard hard disk. In Windows 98, Microsoft can enable the DMA (Direct Memory Access) function of the IDE Hard Disk in computer CMOS or operating system to improve the data transmission rate of DMA or UDMA-33 standard hard disk. But in Linux platform, Linux does not automatically open the DMA mode, so in Linux using these IDE interface UDMA-33 standard hard disk feel data transmission is far from faster in Windows. In fact, the DMA mode can also be enabled through software on the Linux platform. The following describes how to speed up the hard disk in Linux.
  
First, before enabling the DMA mode in Linux, the most important thing is to back up the data on the hard disk. No one can predict whether the hard disk works normally and whether the data is complete after the DMA mode is enabled. It is the best choice to back up all the important data in Linux to other hard disks or storage media such as CD-R, please do not back up the data on the same hard disk, data cannot be backed up to the same hard disk partition.
  
Step 2: Modify the parameters of some device nodes in the hdparm directory. However, to modify these parameters, you must log on to the Linux system as the ROOT user. Normal Linux users do not have this permission to modify things in the hdparm directory. The following is an example of modifying the node parameters of a hard disk device. Note that the parameters listed for hard disks of different models and capacities are not the same, but the modification process and method are basically the same.
  
#/Sbin/hdparm/dev/hda
/Dev/hda:
Multcount = 0 (off)
I/O support = 0 (default 16-bit)
Unmaskirq = 0 (off)
Using_dma = 0 (off)
Keepsettings = 0 (off)
Nowerr = 0 (off)
Readonly = 0 (off)
Readahead = 8 (on)
Geometry = 629/240/63, sectors = 9514260, start = 0
#
  
Note that OFF indicates that this parameter does not work, and ON indicates that this function or mode is enabled. The above parameter list is clearly written. Multcount (multi-sector read) is not enabled; this hard disk format is in the 16-bit format; the DMA data transmission mode is not enabled. Obviously, this parameter does not optimize the hard disk and does not fully utilize the performance of the current high-speed IDE hard disk.
  
To optimize the hard disk and increase the data transmission rate of the hard disk, you must first understand the meanings of the following parameters:
  
C3: converts the 16-bit format of the hard disk to the 32-Bit mode.
  
M16: changed the multi-sector reading function of the hard disk.-m16 enables the hard disk to read data from 16 sectors at a time. However, not all hard disks support this function. Use hdparm-I/dev/hda to view the maximum number of read/write sectors on your hard disk.
  
D1X34 is in a hard disk that supports DMA-capable. This parameter can support the data transmission mode of the dual DMA channel.
  
D1X66 is in a hard disk that supports UDMA-capable. This parameter supports dual-DMA data transmission mode.
  
After understanding the functions and meanings of the above parameters, Please carefully check the labels on the hard disk to see if your hard disk supports the DMA or UDMA mode, then, compare these parameters to optimize your hard disk to prevent unexpected errors.
  
You can also refer to the following example to optimize the hard disk parameters. Note that not all hard disks are applicable to the optimization parameters. Set the parameters as needed:
  
# Hdparm-d1X66-m16-c3/dev/hda
# Hdparm/dev/hda
/Dev/hda:
Multcount = 16 (on)
I/O support = 3 (32-bit w/sync)
Unmaskirq = 0 (off)
Using_dma = 1 (on)
Keepsettings = 0 (off)
Nowerr = 0 (off)
Readonly = 0 (off)
Readahead = 8 (on)
Geometry = 629/240/63, sectors = 9514260, start = 0
  
After modifying these parameters, the hard disk cannot be optimized at one time. If the data is modified while the hard disk is still working normally, the hard disk enters the "Sleep" state. In this case, it is easier to optimize the hard drive parameters when the hard drive lights are off.
  
Hdparm changes to a temporary state. The next time you start the Linux system, hdparm will disappear. Therefore, to permanently Save the modified information, you must write the modified parameters and data to/etc/rc. d/rc. local or/etc/rc. local files, or even programs that run earlier than the startup process.
  
Note that if your motherboard's chipset or Linux kernel (for example, the kernel version is too old and earlier than Version 2.2) does not support the UDMA mode, then there is no need to modify the parameters of the hard disk device. Upgrading the motherboard or kernel is a good solution to this problem.
  
  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.