# /etc/conf.d/hdparm help or documentation?

## t011

I'm trying to find a bit of documentation for /etc/conf.d/hdparm.  I believe the default file looks like this:

```
# Copyright 1999-2004 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: /var/cvsroot/gentoo-x86/sys-apps/hdparm/files/hdparm-conf.d.3,v 1.2 2004/09/06 02:17:08 swegener Exp $

# You can either set hdparm arguments for each drive using hdX_args,

# discX_args, cdromX_args and genericX_args, e.g.

#

# hda_args="-d1 -X66"

# disc1_args="-d1"

# cdrom0_args="-d1"

# or, you can set hdparm options for ALL drives using all_args, e.g.

#

all_args="-d1"

```

I'm trying to determine two things:

1) What is the difference between hdX_args and diskX_args?  Obviously hdX_args refers to a hard drive as a whole.  Does discX_args refer to a specific partition?

2)  With the all_args variable can you use that to specify settings that you want used across all drives and then individually specify specific settings for just one disk?  For example, does setting hda_args nullify any settings also in all_args?  What is the relationship between these variables?

Thanks for any help.

----------

## NeddySeagoon

t011,

Does 

```
man hdparm
```

 help?

----------

## t011

 *NeddySeagoon wrote:*   

> t011,
> 
> Does 
> 
> ```
> ...

 

Not really.  I'm not having problems with hdparm.  I can use hdparm to manage my drives settings fine after boot.  But I'd like to be able to set them automatically during boot.  And since this is a relatively important thing I'd like to know exactly what I'm doing before hand.

I'm inquiring about the syntax of a Gentoo configuration file.  I believe the file is relatively distribution specific, although Gentoo might have copied some of the syntax from some other distribution.  So what I need is a clarification about what the variables in the file do.  This info is likely going to come from a Gentoo developer or possibly someone who's set these before.  But maybe I'm not correctly reading man hdparm.  Is there a specific section of the man page that I'm missing?

----------

## shonglf

(nm)

----------

## t011

 *shonglf wrote:*   

> There may be a manpage for hdparm.conf as well.

 

A manpage for the configuration file is exactly what I'm looking for.  But on my system, I haven't found one.  And my attempts to google for hdparm.conf have only yielded info on Debian systems.  I'm going to keep looking, but this is such an important thing that it would be nice if there was a bit better documentation for it.

----------

## fifo

I realise it might not be what you call documentation, but you can always do "less /etc/init.d/hdparm" and just read what the init script does with the configuration parameters.

----------

## H3g3m0n

actually it says right at the top of /etc/init.d/hdparm

```
# METHOD

# ------

# if /dev/ide exists, find all block devices beneath it named disc, cd, or

# generic.

#

# for the disc and cd ones, if there is a a matching /dev/hdX symlink and

# hdX_args is set in the config file, use hdX_args.  otherwise, if there is a

# matching /dev/discs/discX or /dev/cdroms/cdromX symlink, and discX_args or

# cdromX_args is set in the config file, use discX_args / cdromX_args.  finally,

# if all_args is set in the config file, use that.

#

# for the generic ones, sort them and look for genericX_args in the config file

# or use all_args.

#

# if /dev/ide does not exist, check the /dev/hdX entries, and see which ones

# correspond to real devices by opening them for reading.  then check hdX_args

# and all_args in the config file.

#

# for each device considered, if no args are found in the config file, do not

# run hdparm.
```

It doesn't exactly explain what disc is for, but i assume that it refers to harddiscs only like cdrom refers to cdroms only but hdX can refer to either a cdrom or a hdd. This way if you remove a HDD cdrom2 is still cdrom2 but if you removed hda then hdc would become hdb.

I just have 

```
all_args="-d1 -a8 -u1 -c1 -X64"
```

Although the only IDE device I have is a dvdburner the rest of my hdds are SATA but those settings should probally work for most newer harddrives.

----------

## t011

Thanks for the tip on the documentation in /etc/init.d/hdparm, that helps somewhat.  There are still a few things I'm unclear about.  From the documentation, it sounds the matching is mutually exclusive in that if hdX_args is found then it is used by itself rather than adding whatever is also found in all_args.  Which is fine, I just wanted to understand how the all_args wildcard works in relation to the more specific settings.

Additionally, is that true that if you were to remove hda, then hdc would become hdb?  I thought it depended upon the way the drives are cabled in your box.  Meaning, that could happen if you pulled the first drive attached to the IDE cable but left the second in place.  The drive leter would shift up one.  But hda and hdb are on one bus and hdc and hdd are on the other.  I could be totally wrong about this, I'm basically just guessing.  But on my machine I have hda, hdc, and hdd.  No hdb, I believe because that would have to be at the end of the same cable with hda.

----------

