Automatic startup hdparm on Opensuse 13.2/ 64 KDE

Hello, what I have to setup to run hdparm automatic at system boot up?

Now I’m doing it this way:

konsole:

su admin password

and i type

hdparm -B 254 /dev/sdb

Now my HDD work efficiently and without parking, but only until I start the computer again.

Ps. Could someone explain to me how to set it up for a beginner?

Add it to /etc/sysconfig/ide, to the DEVICES_FORCE_IDE_DMA line (yes, this is actually meant to force DMA mode for certain drives, but it just calls hdparm in the end and you can set other parameters there as well).

Something like this:

DEVICES_FORCE_IDE_DMA="/dev/sdb:on:-B254"

(you could set any specific DMA mode you want instead of “on”, see “man hdparm”, the -X parameter)

I haven’t tried this, but it should work that way after looking at the /usr/lib/udev/idedma.sh script.

Alternatively you could add your hdparm line to some boot script like e.g. /etc/init.d/boot.local.

Before I started this thread I searched on google and I found solution like this, but I do not know how to change the file, requires administrator rights from me.

#! /bin/sh

Copyright (c) 2002 SuSE Linux AG Nuernberg, Germany. All rights reserved.

Author: Werner Fink, 1996

Burchard Steinbild, 1996

/etc/init.d/boot.local

script with local commands to be executed from init on system startup

Here you should add things, that should happen directly after booting

before we’re going to the first run level.

Yes, like any system-wide change, and even calling hdparm too.

So use “su” or “sudo” to start a (text mode) editor as root, or use “su -”, “kdesu” or “gnomesu” to start a GUI editor as root.
E.g.:

kdesu kwrite /etc/init.d/boot.local

Or open the file in “File Manager - Super User Mode”.

kdesu kwrite /etc/init.d/boot.local
kdesu(8493)/kdeui (kdelibs): Session bus not found
To circumvent this problem try the following command (with Linux and bash)
export $(dbus-launch)
KCrash: Application ‘kdesu’ crashing…
KCrash: Attempting to start /usr/lib64/kde4/libexec/drkonqi from kdeinit
KCrash: Connect sock_file=/root/.kde4/socket-linux/kdeinit4__0
Warning: connect() failed: : No such file or directory
KCrash: Attempting to start /usr/lib64/kde4/libexec/drkonqi directly
drkonqi(8496)/kdeui (kdelibs): Session bus not found
To circumvent this problem try the following command (with Linux and bash)
export $(dbus-launch)

It does not work. Now I try this method “File Manager - Super User Mode”

#! /bin/sh

Copyright (c) 2002 SuSE Linux AG Nuernberg, Germany. All rights reserved.

Author: Werner Fink, 1996

Burchard Steinbild, 1996

/etc/init.d/boot.local

script with local commands to be executed from init on system startup

Here you should add things, that should happen directly after booting

before we’re going to the first run level.

hdparm -B 254 /dev/sdb

It is well?

Yes, this should work.

Or add it to /etc/sysconfig/ide as mentioned.

Now everything works automatically at system startup. I have used the method of “/etc/init.d/boot.local”

Thank you very much for your help.

Btw. I could also switch off parking in in the third HDD- WD GREEN, I thought it was not possible due to a series of “green” but it worked. I used the following commands for WD GREEN if someone needed “hdparm --please-destroy-my-drive -J 300 /dev/sdc”