Linux HOWTOs

About | Home | Search

HOWTO: hdparm
Description: Get/set hard disk parameters
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything

# hdparm 6.6
# ==========
# Slackware 9.0 and 9.1's 'hdparm' package includes version 5.3, 10.0's
# includes 5.5, 10.1's includes 5.8, and 10.2's includes 6.1

test -f installed/hdparm-6.6.tar.gz && mv installed/hdparm-6.6.tar.gz .
test ! -f hdparm-6.6.tar.gz &&
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "hdparm-*" -exec rm -r {} \;
tar xzvf ~/hdparm-6.6.tar.gz
cd hdparm-6.6
test $UID = 0 && chown -R root:root .

# Become root to install it

test -x /sbin/removepkg && /sbin/removepkg hdparm
make install
strip /sbin/hdparm
ln -sf /sbin/hdparm /usr/sbin/hdparm

# Become yourself again

mkdir -p -m 0700 installed
rm -f installed/hdparm-*.tar.*
mv hdparm-6.6.tar.gz installed/

# Be aware that Slack's hdparm package had the hdparm binary in /usr/sbin,
# but we created a symlink there to cover that path if you have it set in
# various scripts.  The actual binary is /sbin/hdparm.

# The standard generic suggestion to improve IDE HD speed is something like
# this:  hdparm -qm8 -qu1 -qc1 -qd1 /dev/hda  If you're going to try this
# or another commandline, definitely read 'man hdparm' first.

# If you ever want to uninstall hdparm, this should do it:
su -c "rm -f /sbin/hdparm /usr/sbin/hdparm /usr/man/man8/hdparm.8"
find ~/src -maxdepth 1 -type d -name "hdparm-*" -exec rm -r {} \;
rm -f ~/installed/hdparm-*.tar.*

Back to the list

Last updated: Tue, 07 Aug 2018 12:06:17 -0400
Jason Englander <jason at englanders dot us>