README.Debian
1hdparm for Debian
2 -----------------
3
4General hard disk tuning:
5
6 To get the best performance out of your hard drive turn on DMA support
7 in the kernel and enable 32bit IO (-c) and multiple sector I/O (-m)
8 with hdparm. You can find out the number to use for -m by using -i and
9 reading MaxMultSect.
10
11 These settings can now be set in either /etc/hdparm.conf or in
12 /etc/apm/20hdparm. I advise against setting the same features in both -
13 unpredictable things could happen.
14
15Multiple disks with the same options:
16
17 /etc/default/hdparm can take environment variables for simple options
18 for a block of disks that are to be set up in the same way. This would
19 be useful for a JBOD type array, or similar arrangement. Setting up disks
20 in this way does not currently integrate with the more complicated checks
21 and arrangements that are done with the settings in hdparm.conf. If you
22 need to load modules before tuning a hard disk, or need to allow udev to
23 run before hdparm, do not use this option. This is intended only for
24 disks with normal device nodes, accessible early in the boot process, and
25 with kernel support before module loading. A complete rewrite is really
26 needed to better integrate this option. Hopefully I'll have the time soon
27 (or somebody will send the patches :)
28
29APM and ACPI:
30 APM and ACPI are handled somewhat differently in Debian. If you have a
31 machine that uses APM, there is a script in /etc/apmd that you can use to
32 have APM events trigger hdparm commands. For ACPI users, I recommend a
33 package like powersaved, that will call hdparm as appropriate for ACPI
34 events.
35
36Some problems with udev and module loading:
37
38 hdparm's init script is set to run at /etc/rcS.d/S07 because there have
39 been reports of data corruption with mounted disks. This particular
40 placement may not work for you if the ability to use things like DMA
41 relies on having modules for your motherboard or drive loaded, as it is
42 run before the module loading init script. If this is the case for you,
43 (and you don't use udev) do the following:
44
45 In hdparm.conf, set ROOTFS to whatever drive / is mounted on, for example
46 ROOTFS = /dev/hda
47
48 Set up a second link, /etc/rcS.d/S29hdparm.second, pointing to
49 /etc/init.d/hdparm. ln -s /etc/init.d/hdparm /etc/rcS.d/S29hdparm.second
50 will do this for you.
51
52 If you use an alternate init scheme, such as runit or minit or file-rc,
53 set this up appropriately for your setup. The important thing is that
54 the link name does not _end_ in 'hdparm' (the script checks this with
55 case "$0" in *hdparm), so take care in your naming scheme. Now the init
56 script will run once at 07 for your root drive, and then later for all
57 other defined devices. This will give the other scripts a chance to
58 load modules and create devices.
59
60 hdparm now supports udev created device nodes, using the script
61 /etc/udev/hdparm.rules. This allows users to set up regular stanzas in
62 /etc/hdparm.conf, that will fail the first time (as the device nodes
63 don't yet exist) but will be properly set up when udev gets to them.
64
65Known problems, limitations, and work-arounds:
66
67 Additional information from David B Harris:
68 The init script is probably not safe to run with an MD array, as there
69 is a possibility of disk corruption during rebuild if the array was not
70 stopped cleanly. As the rebuild process begins (at least on newer MD
71 arrays) before init is started, there is no way to run the init script
72 early enough for this to always be safe. Please do not add anything to
73 hdparm.conf, and instead run hdparm by hand only after you are sure that
74 your array has finished rebuilding.
75
76 For this reason, the init script aborts if it detects that the raid array
77 is not rebuilt, or otherwise 'dirty'. See below for ways to bypass these
78 checks.
79
80 If the init script gives you problems, you can boot the kernel with the
81 command line option 'nohdparm' (without the single quotes), and the init
82 script will not run.
83
84 If one of the built-in checks that aborts the hdparm init script is
85 triggered (RAID array is rebuilding, nohdparm was passed on the kernel
86 command line), the init script will not run at boot time. If you want
87 to run the init script anyway, you can override the safety features by
88 passing the environment variable FORCE_RUN=yes to the init script.
89 i.e.:
90 FORCE_RUN=yes /etc/init.d/hdparm start
91
92 -- Stephen Gran <sgran@debian.org> Wed, 10 Aug 2005 14:48:31 -0400
93