LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-08-2006, 02:53 PM   #1
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
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.
 
Old 01-08-2006, 03:08 PM   #2
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
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.
 
Old 01-08-2006, 03:12 PM   #3
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
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.
 
Old 01-08-2006, 03:19 PM   #4
shilo
Senior Member
 
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132

Rep: Reputation: 50
/etc/rc.d/rc.local

This is the last script run at boot time. It is run by root.
 
Old 01-08-2006, 04:55 PM   #5
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
Does it not matter that you're multiuser by the time rc.local is run?
 
Old 01-08-2006, 05:29 PM   #6
shilo
Senior Member
 
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132

Rep: Reputation: 50
Why would it???
 
Old 01-08-2006, 05:57 PM   #7
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
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.
 
Old 01-08-2006, 06:11 PM   #8
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
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.
 
Old 01-08-2006, 06:25 PM   #9
zhy2111314
Member
 
Registered: Aug 2005
Location: China
Distribution: redhat(Fedora Core)->Debian Sid->Slackware
Posts: 91

Rep: Reputation: 15
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
 
Old 01-08-2006, 06:36 PM   #10
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
Sounds good, thanks for the clarification.
 
Old 01-10-2006, 05:58 PM   #11
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
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.
 
Old 01-10-2006, 08:23 PM   #12
Vgui
Member
 
Registered: Apr 2005
Location: Canada
Distribution: Slackware
Posts: 496

Rep: Reputation: 31
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
hdparm refdoc Ubuntu 5 09-08-2005 07:07 PM
Suitable place to run bash scripts Skyline Programming 7 01-21-2004 07:37 PM
im in user mode and cant run hdparm and ifconfig commands, but if im root, i can. kublador Linux - Newbie 2 09-12-2003 08:27 AM
hdparm ash4stuff Linux - Hardware 4 08-14-2003 03:05 AM
hdparm -g NOT= hdparm -i ---LILO hangs @ L stevewalsh Linux - General 4 07-23-2001 09:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration