LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Best place to run hdparm (https://www.linuxquestions.org/questions/slackware-14/best-place-to-run-hdparm-400939/)

jrdioko 01-08-2006 02:53 PM

Best place to run hdparm
 
I've been playing with hdparm, and, while it seems like Slackware defaults have done pretty well and there's very little difference I can make, I guess it wouldn't hurt to make those adjustments. Where is the best place to run hdparm with the new settings? I guess it's supposed to go after any fsck checks, but before going multi-user? I'm not familiar enough with the boot process to know how it all fits together, and was wondering if there's a recommended place to put the hdparm command.

Bruce Hill 01-08-2006 03:08 PM

You run the hdparm command in a terminal while
logged in as root. It's not part of the boot
sequence. The default Slackware-10.2 kernel has
DMA enabled, so you just need to set your drive
for whatever you'd like to add.

jrdioko 01-08-2006 03:12 PM

But running hdparm in a terminal doesn't persist across reboots, correct? The tutorial's I've been reading say you stick it in a startup script somewhere to make the settings stay.

shilo 01-08-2006 03:19 PM

/etc/rc.d/rc.local

This is the last script run at boot time. It is run by root.

jrdioko 01-08-2006 04:55 PM

Does it not matter that you're multiuser by the time rc.local is run?

shilo 01-08-2006 05:29 PM

Why would it???

jrdioko 01-08-2006 05:57 PM

All the hdparm tutorials recommend changes being done in the safest environment possible (backed up beforehand and in single-user mode), to reduce the chance of data loss. It just seems best to have as little as possible going on with your system when making hard drive adjustments.

gilead 01-08-2006 06:11 PM

When you're testing settings, yes - do the testing in a safe environment. Once you decide which ones are safe to use, add them to the boot scripts. It doesn't matter which run level the system is in when they become active.

zhy2111314 01-08-2006 06:25 PM

check out my /etc/rc.d/rc.local for hdparm:
Code:

# open harddisk and optical disk dma
# for testing to use the following command:
# #hdparm -Tt /dev/hda
# ATA33 : -X66
# ATA66 : -X68
# ATA100: -X69
# ATA133: -X70
echo -ne "DMA setting ...\n"
/usr/sbin/hdparm -d1 -X69 -c3 -m16 /dev/hda
/usr/sbin/hdparm -d1 -X66 -a8 -u1 /dev/hdd

And my /dev/hda and /dev/hdd are:
Code:

[zhyfly]@[zhy2fly][~](0)$dmesg|grep '^hd.:*'                                               
hda: Maxtor 6E040L0, ATA DISK drive
hdd: SAMSUNG CDRW/DVD SM-316B, ATAPI CD/DVD-ROM drive
hda: max request size: 128KiB
hda: 80293248 sectors (41110 MB) w/2048KiB Cache, CHS=65535/16/63, UDMA(100)
hda: cache flushes supported
hdd: ATAPI 40X DVD-ROM CD-R/RW drive, 8192kB Cache
hdd: CHECK for good STATUS


jrdioko 01-08-2006 06:36 PM

Sounds good, thanks for the clarification.

Woodsman 01-10-2006 05:58 PM

Quote:

Where is the best place to run hdparm with the new settings?
I run hdparm in /etc/rc.d/rc.local. Here is my snippet:

# Set hard drive parameters
echo "Setting hard drive parameters."
# /usr/sbin/hdparm -qd1qm16qc3qu1qk1 /dev/hda
# /usr/sbin/hdparm -qd1qm16qc3qu1 /dev/hda
# -q = quiet
# -d1 = enable dma
# m16 = set sector count to 16
# c3 = enable (E)IDE 32-bit I/O support and set special sync sequence
# u1 = set interrupt-unmask flag
# k1 = keep d, m, & u settings during a soft reboot
/usr/sbin/hdparm -qc3qu1 /dev/hda

Be sure to manually test your hard drive before you add something similar. As root, from the command line:

hdparm /dev/hda

To test your drive:

hdparm -tT /dev/hda

Quote:

Does it not matter that you're multiuser by the time rc.local is run?
Nope.

Vgui 01-10-2006 08:23 PM

I personally run it in rc.S, as it gets done early and (placebo affect) speeds up the rest of the boot process. Like everyone else said, the location shouldn't matter.


All times are GMT -5. The time now is 08:12 AM.