# Problem with Gentoo hdparm script...

## Yoshi Assim

Hello, gentoo users:

Today I get a problem with DMA settings when I set "hdparm". I read GWN and follow a thread to improve X perfomance when I make some changes in my /etc/conf.d/hdparm:

```

# Copyright 2003 Gentoo Technologies, Inc. 

# Distributed under the terms of the GNU General Public License, v2 or later

# $Header: /home/cvsroot/gentoo-x86/sys-apps/hdparm/files/hdparm-conf.d,v 1.1 2003/03/01 21:17:39 sethbc Exp $

# You can either set hdparm arguments for each drive using disc*_args and cdrom*_args..

# eg.

disc0_args="-qc1 -qd1 -qk1 -qu1 -qX66"

#disc1_args"-d1"

#cdrom0_args="-d1"

#cdrom1_args="-d1"

#cdrom2_args="-d1"

#cdrom3_args="-d1"

# Or, you can set hdparm options for ALL drives using all_args..

# eg.

# this mimics the behavior of the current script

#all_args="-d1"

```

This is a brief description of my hardware configuration:

Pentium III "Coppermine" 1000 Mhz

512 Mb SDRAM PC-133

Creative GeForce4Ti 4200 64Mb DDR TV-Out

IDE1: HD Seagate Cheetah 20 Gb 7200 rpm UDMA-66

IDE2: HITACHI GD-7000 IDE-ATAPI DVD-ROM

IDE3: ACER ATAPI CD-RW 24/10/40

IDE4: LG IDE-ATAPI CD-R x52

Also I have a Adaptec AHA-2940U with a Plextor SCSI x40 CD-ROM attached.

My / (root) is a Reiser filesystem and the boot partition is ext2.

All works Ok until I added hdparm to muy "default" runlevel. When hdparm runs at default runlevel I have "problems" reading from my disk. Also some scripts at "default" runlevels like samba, sshd, local, won't runs and I get some "segmentation faults"...  :Shocked:  Read data corruption...  :Sad: 

But  If I delete hdparm from my "default" runlevel and pass the same parameters at /etc/conf.d/local.start it works fine.

Here my /etc/conf.d/local.start

```

# /etc/conf.d/local.start:

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/local.start,v 1.4 2002/11/18 19:39:22 azarah Exp $

# This is a good place to load any misc.

# programs on startup ( 1>&2 )

# Updating date form Internet

rdate -s 129.6.15.28

# Setting hd parameters

hdparm -qc1 -qd1 -qm16 -qk1 -qu1 -qX66 /dev/hda

```

Really this only adds "multiread" to default configuration of my disk and I can't feel the increased disk perfomance but I don't understand because the "hdparm" script fails... :Sad: 

Can someone give me a little clue, hint or hack about this... 

Thanks!!!

----------

## dirtyjake

 *Quote:*   

> hdparm -qc1 -qd1 -qm16 -qk1 -qu1 -qX66 /dev/hda 

 

The Gentoo hdparm script would actually issue this command:

```
hdparm -qc1 -qd1 -qm16 -qk1 -qu1 -qX66 /dev/discs/disc0/disc
```

See if that gives you errors.  If so, sounds like a bug that needs to be reported.

A hack might be:

/etc/conf.d/hdparm

```
disc0_args="-qc1 -qd1 -qk1 -qu1 -qX66 /dev/hda; ls "
```

No guarantees or warranties.  Make sure there is a space after 'ls'.  Check out /etc/init.d/hdparm to see why this will/should work.

----------

## Yoshi Assim

 *dirtyjake wrote:*   

>  *Quote:*   hdparm -qc1 -qd1 -qm16 -qk1 -qu1 -qX66 /dev/hda  
> 
> The Gentoo hdparm script would actually issue this command:
> 
> ```
> ...

 

Hello, first thanks for your help!

I made the changes you suggest in my hdparm conf file and

removed in hdparms in local.start that is the results:

```

venus root # service hdparm start

 * Starting hdparm...

 * Skipping cdrom0 hdparm does not support SCSI devices.

 * Running hdparm on disc0...

 * Failed to start hdparm on disc0.                                       [ !! ]

                                                                         [ ok ]

venus root #
```

The results is clear... I get the same "corruption" messages and hangs my computer at "local" (at the end of init "default" scripts...

The warning is because my first CD is the SCSI Plextor... I use ide-scsi module but I load if I need it...

Thanks!

----------

## dirtyjake

Sorry, I am a little confused.  Were you able to get it working with my hack?

----------

## wolf31o2

Remove the -X66 as it is known to cause filesystem corruption.  You do not need it anyway.

----------

## Yoshi Assim

 *dirtyjake wrote:*   

> Sorry, I am a little confused.  Were you able to get it working with my hack?

 

No. It refuses to works. This is post is the results of your hack...

```
venus root # service hdparm start

* Starting hdparm...

* Skipping cdrom0 hdparm does not support SCSI devices.

* Running hdparm on disc0...

* Failed to start hdparm on disc0.                                       [ !! ]

                                                                         [ ok ]

venus root #
```

Sorry!. service "command" is a shel script to easy start/stop/status/restart services.

I maded the changes you suggest and doesn't works for me... Computer hangs at boot after a data corruption !   :Shocked:  if I start  hdparm at "default" runlevel.

But if I use the same parameters in local.start that I have in /etc/conf.d/hdparm (see in this thread) it works fine...    :Shocked: 

Really I don't understand... Why?   :Shocked: 

----------

## Yoshi Assim

 *wolf31o2 wrote:*   

> Remove the -X66 as it is known to cause filesystem corruption.  You do not need it anyway.

 

Really I don't need this but is the correct way!... But If I don't pass this parameter I get the same results...

----------

