|
Page 1 of 3 Hdparm
Introduction Hdparm is a tool that allows you to set IDE device settings. This includes things such as DMA modes, transfer settings and various other settings that can help improve the speed of your hard disks and CDROMs. These settings are not enabled by default, so you will probably want to enable them. This guide is also intended to provide more up-to-date information on hdparm settings and inform the user how to check what settings are supported so that the optimum settings for the drive can be used. Many hdparm guides simply tell people to enable specific modes such as '-X33' or '-c1', and as most of these guides are now out-of-date many people end up using those older settings when better, newer options may now be used. By speeding up your hard drives you should get a faster system. It should also help solve stuttering DVD playback or extremely slow burning. Note: much of this document is tailored towards standard IDE connected devices. If you use SATA or SCSI, look at using sdparm instead of hdparm. Notice (RAID and such) HDParm is the root of all evil with Software/BIOS-RAID. Most disks do not sync evenly with DMA enabled, the more drives you have the less speed you should set. Installing hdparm Firstly check if hdparm is already installed on your system by typing the following as root: emerge -n hdparm
Getting information about your different drives Different drives have different capabilities, so in order to configure them you must know what they are capable of doing. # hdparm -i /dev/hdX should give you the information you need (replace hdX with your drive) Udev systems also allow for drives to be accessed with a slightly more understandable filename. For hard drives (replace X with the disc number): hdparm -i /dev/discs/disc#/disc, and for CDROMs: hdparm -i /dev/cdroms/cdrom#/cdrom You should get something similar to the following You will want to repeat this process for each IDE HDD/CDROM you have. Pay attention to the MaxMultSect and maximum mode available from the PIO/DMA/UDMA modes. Benchmarking devices hdparm -tT hdparm includes a handy benchmark mode, which should allow you to see how much of a speed improvement each of the different settings gives you. When running a benchmark it is recommended that you close all programs that could interfere with the results. Ideally do it from the console, rather than in a xterm with xorg running. To perform a benchmark, issue a command like the following - once again replacing X with your drive letter: # hdparm -tT /dev/hdX
You should then get some speed results like the following: | Code: hdparm -tT /dev/hdX | | | It is recommended that you benchmark all your drives and save the results before you start tweaking them, so that you can tell how much of an improvement you are getting. For example, the following test was run on a hard drive supporting UDMA6: | Code: hdparm -tT /dev/hdX | | | Here's a hard drive set to low, slow settings: | Code: # hdparm -cuda /dev/hda | | | And here is its performance information: | Code: # hdparm -tT /dev/hda | | | This is the same hard drive, after rebuilding the kernel with the Cotroller's drivers and DMA enabled (see below: "I get "Operation not permitted" errors on setting DMA (-d1)"): | Code: # hdparm -cuda /dev/hda | | | And this is the performance statistics for those settings: | Code: # hdparm -tT /dev/hda | | | | Note: The IDE Controller in this system doesn't support higher udma levels than udma4, so with a newer controller and udma6 you will probably get better improvements. | bonnie++ Sometimes hdparm -tT won't show any differences when tweaking hdparm settings, or will show inaccurate results. bonnie++ does more accurate and in-depth analysis of the hard drive speed. Here is a comparison from my system (hdparm -tT gave ~ 260/570 kbps for cached/buffered reads in BOTH cases): | Code: # hdparm -d0 -u0; bonnie++ | | | | Code: # hdparm -d1 -u1 -X udma5; bonnie++ | | |
|