Package: hdparm
Version: 5.9-1
Severity: wishlist

I've got a bunch of Red Hat and Debian servers being configured by
cfengine, and part of that configuration is to tune the hdparm
parameters.

On the Red Hat boxes, I can just edit /etc/sysconfig/harddisks which is
a shell script fragment with variables matching some common hdparm
options, which then gets sourced by rc.sysinit and applied to all the
disks on the system.  Individual disk settings can also be specified by
using a disk-specific config of /etc/sysconfig/harddiskhda and so on.

On Debian, it seems that /etc/hdparm.conf will only let you specify
per-disk settings... at least, the first part of the file which
enumerates all the config options in the commented section led me to
believe that I could uncomment some of them and they would be
system-wide defaults, but this is not the case (by experimentation and
then referring to the operation of /etc/init.d/hdparm I realised that
settings would only be made if they appeared within a { } block.

So I ask that there be a method for setting the defaults on all disks,
i.e. the options appearing outside a { } become valid and are applied to
all disks by default.  The mechanism in Red Hat's rc.sysinit looks like
this:

# Turn on harddisk optimization
# There is only one file /etc/sysconfig/harddisks for all disks
# after installing the hdparm-RPM. If you need different hdparm parameters
# for each of your disks, copy /etc/sysconfig/harddisks to
# /etc/sysconfig/harddiskhda (hdb, hdc...) and modify it.
# Each disk which has no special parameters will use the defaults.
# Each non-disk which has no special parameters will be ignored.
#

disk[0]=s;
disk[1]=hda;  disk[2]=hdb;  disk[3]=hdc;  disk[4]=hdd;
disk[5]=hde;  disk[6]=hdf;  disk[7]=hdg;  disk[8]=hdh;
disk[9]=hdi;  disk[10]=hdj; disk[11]=hdk; disk[12]=hdl;
disk[13]=hdm; disk[14]=hdn; disk[15]=hdo; disk[16]=hdp;
disk[17]=hdq; disk[18]=hdr; disk[19]=hds; disk[20]=hdt;


if [ -x /sbin/hdparm ]; then
   for device in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do
        unset MULTIPLE_IO USE_DMA EIDE_32BIT LOOKAHEAD EXTRA_PARAMS
        if [ -f /etc/sysconfig/harddisk${disk[$device]} ]; then
                . /etc/sysconfig/harddisk${disk[$device]}
                HDFLAGS[$device]=
                if [ -n "$MULTIPLE_IO" ]; then
                    HDFLAGS[$device]="-q -m$MULTIPLE_IO"
                fi
                if [ -n "$USE_DMA" ]; then
                    HDFLAGS[$device]="${HDFLAGS[$device]} -q -d$USE_DMA"
                fi
                if [ -n "$EIDE_32BIT" ]; then
                    HDFLAGS[$device]="${HDFLAGS[$device]} -q -c$EIDE_32BIT"
                fi
                if [ -n "$LOOKAHEAD" ]; then
                    HDFLAGS[$device]="${HDFLAGS[$device]} -q -A$LOOKAHEAD"
                fi
                if [ -n "$EXTRA_PARAMS" ]; then
                    HDFLAGS[$device]="${HDFLAGS[$device]} $EXTRA_PARAMS"
                fi
        else
                HDFLAGS[$device]="${HDFLAGS[0]}"
        fi
        if [ -e "/proc/ide/${disk[$device]}/media" ]; then
             hdmedia=`cat /proc/ide/${disk[$device]}/media`
             if [ "$hdmedia" = "disk" -o -f 
"/etc/sysconfig/harddisk${disk[$device]}" ]; then
                  if [ -n "${HDFLAGS[$device]}" ]; then
                      action $"Setting hard drive parameters for 
${disk[$device]}: "  /sbin/hdparm ${HDFLAGS[$device]} /dev/${disk[$device]}
                  fi
             fi
        fi
   done
fi


-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.8-2-k7
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)

Versions of packages hdparm depends on:
ii  libc6                       2.3.2.ds1-20 GNU C Library: Shared libraries an

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to