New upstream version 1.05+ds

parents
Please refer to debian/changelog
This diff is collapsed.
###############################################################################
#
# General Definitions
#
###############################################################################
ifdef DESTDIR
# dh_auto_install (Debian) sets this variable
TARGET_DIR = $(DESTDIR)/usr
else
TARGET_DIR ?= /usr/local
endif
LIB_DIRS =
INC_DIRS =
CC ?= gcc
CFLAGS += $(INC_DIRS) -Wall
LD = $(CC)
LDFLAGS += $(LIB_DIRS)
###############################################################################
#
# Main Dependencies
#
###############################################################################
TARGET = hd-idle
LIBS =
SRCS = hd-idle.c
OBJS = $(SRCS:.c=.o)
all: $(TARGET)
distclean: clean
clean:
rm -f $(OBJS) $(TARGET)
install: $(TARGET)
install -D -g root -o root $(TARGET) $(TARGET_DIR)/sbin/$(TARGET)
install -D -g root -o root $(TARGET).1 $(TARGET_DIR)/share/man/man1/$(TARGET).1
hd-idle.o: hd-idle.c
$(TARGET): $(OBJS)
$(LD) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIB_DIRS) $(LIBS)
Hard Disk Idle Spin-Down Utility
==============================================================================
hd-idle is a utility program for spinning-down external disks after a period
of idle time. Since most external IDE disk enclosures don't support setting
the IDE idle timer, a program like hd-idle is required to spin down idle
disks automatically.
A word of caution: hard disks don't like spinning up too often. Laptop disks
are more robust in this respect than desktop disks but if you set your disks
to spin down after a few seconds you may damage the disk over time due to the
stress the spin-up causes on the spindle motor and bearings. It seems that
manufacturers recommend a minimum idle time of 3-5 minutes, the default in
hd-idle is 10 minutes.
One more word of caution: hd-idle will spin down any disk accessible via the
SCSI layer (USB, IEEE1394, ...) but it will NOT work with real SCSI disks
because they don't spin up automatically. Thus it's not called scsi-idle and
I don't recommend using it on a real SCSI system unless you have a kernel
patch that automatically starts the SCSI disks after receiving a sense buffer
indicating the disk has been stopped. Without such a patch, real SCSI disks
won't start again and you can as well pull the plug.
You have been warned...
The latest version of hd-idle can be found on SourceForge:
http://hd-idle.sf.net
hd-idle is not public domain software. It's copyrighted by myself,
Christian Mueller, according to the terms of the GNU General Public
License (GPL). Please see the file LICENSE for additional information.
Copyright (c) Christian Mueller 2007
==============================================================================
Installation
------------
The compile process is rather simple, thus there's no automake or configure
script at this point, just a makefile for Linux. Since hd-idle is using the
Linux generic SCSI layer, it requires the include files scsi/sg.h and
scsi/scsi.h which should come with libc6-dev (at least on Debian they do).
Non-Debian Systems:
* In order to compile the program, type "make".
* In order to install the program into /usr/local/sbin, type "make install"
(this will also install the manpage into /usr/local/share/man/man1)
Debian Systems:
* Run "dpkg-buildpackage -rfakeroot"
* Run "dpkg -i ../hd-idle_*.deb" to install the package
NOTE: The build framework has been changed to be compatible to the Debian
package management with the intention of making hd-idle an official
Debian package. Once this effort has completed, hd-idle can be
installed with "apt-get install hd-idle". The changes to the Debian
build instructions as outlined above (previous releases used "make
install_debian") are a side effect of this effort.
Once completed, please check /etc/default/hd-idle for configuration
information. The default settings will *not* start hd-idle automatically.
Running hd-idle
---------------
In order to run hd-idle, type "hd-idle". This will start hd-idle with the
default options, causing all SCSI (read: USB, Firewire, SCSI, ...) hard disks
to spin down after 10 minutes of inactivity.
On a Debian system, after editing /etc/default/hd-idle and enabling it,
use "/etc/init.d/hd-idle start" to run hd-idle.
Please note that hd-idle uses /proc/diskstats to read disk statistics. If
this file is not present, hd-idle won't work.
In case of problems, use the debug option (-d) tp get further information.
Command line options:
-a <name> Set device name of disks for subsequent idle-time
parameters (-i). This parameter is optional in the
sense that there's a default entry for all disks
which are not named otherwise by using this
parameter. This can also be a symlink
(e.g. /dev/disk/by-uuid/...)
-i <idle_time> Idle time in seconds for the currently named disk(s)
(-a <name>) or for all disks.
-l <logfile> Name of logfile (written only after a disk has spun
up). Please note that this option might cause the
disk which holds the logfile to spin up just because
another disk had some activity. This option should
not be used on systems with more than one disk
except for tuning purposes. On single-disk systems,
this option should not cause any additional spinups.
Miscellaneous options:
-t <disk> Spin-down the specfified disk immediately and exit.
-d Debug mode. This will prevent hd-idle from
becoming a daemon and print debugging info to
stdout/stderr
-h Print usage information.
Regarding the parameter "-a":
Users of hd-idle have asked for means to set idle-time parameters for
individual disks. This makes a lot of sense, not only because some [SCSI]
disks may not react well to being stopped. Originally, hd-idle had one idle
time for all disks. The parameter "-a" can now be used to set a filter on
the disk's device name (omit /dev/) for subsequent idle-time settings.
1) A -i option before the first -a option will set the default idle time;
hence, compatibility with previous releases of hd-idle is maintained.
2) In order to disable spin-down of disks per default, and then re-enable
spin-down on selected disks, set the default idle time to 0.
Example:
hd-idle -i 0 -a sda -i 300 -a sdb -i 1200
This example sets the default idle time to 0 (meaning hd-idle will never
try to spin down a disk), then sets explicit idle times for disks which
have the string "sda" or "sdb" in their device name.
Stopping hd-idle
----------------
Use "killall hd-idle" to stop hd-idle. On a Debian system, use
"/etc/init.d/hd-idle stop".
export CVS_RSH=ssh
export CVSROOT=cjmueller@hd-idle.cvs.sourceforge.net:/cvsroot/hd-idle
.\" Hey, EMACS: -*- nroff -*-
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH HD-IDLE 1 "September 29, 2011"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
hd-idle \- spin down idle hard disks
.SH SYNOPSIS
.B hd-idle
.RI [ options ]
.P
.SH DESCRIPTION
hd-idle is a utility program for spinning down external disks after a period
of idle time. Since most external IDE disk enclosures don't support setting
the IDE idle timer, a program like hd-idle is required to spin down idle
disks automatically.
.P
A word of caution: hard disks don't like spinning up too often. Laptop disks
are more robust in this respect than desktop disks but if you set your disks
to spin down after a few seconds you may damage the disk over time due to the
stress the spin-up causes on the spindle motor and bearings. It seems that
manufacturers recommend a minimum idle time of 3-5 minutes, the default in
hd-idle is 10 minutes.
.P
One more word of caution: hd-idle will spin down any disk accessible via the
SCSI layer (USB, IEEE1394, ...) but it will NOT work with real SCSI disks
because they won't spin up automatically. Thus it's not called scsi-idle and
I don't recommend using it on a real SCSI system unless you have a kernel
patch that automatically starts the SCSI disks after receiving a sense buffer
indicating the disk has been stopped. Without such a patch, real SCSI disks
won't start again and you can as well pull the plug.
.SH OPTIONS
.TP
.B \-a name
Set device name of disks for subsequent idle-time parameters
.B (-i).
This parameter is optional in the sense that there's a default entry for
all disks which are not named otherwise by using this parameter. This can
also be a symlink (e.g. /dev/disk/by-uuid/...)
.TP
.B \-i idle_time
Idle time in seconds for the currently named disk(s) (-a <name>) or for
all disks.
.TP
.B \-l logfile
Name of logfile (written only after a disk has spun up). Please note that
this option might cause the disk which holds the logfile to spin up just
because another disk had some activity. This option should not be used on
systems with more than one disk except for tuning purposes. On single-disk
systems, this option should not cause any additional spinups.
.TP
.B \-t disk
Spin-down the specfified disk immediately and exit.
.TP
.B \-d
Debug mode. This will prevent hd-idle from becoming a daemon and print
debugging info to stdout/stderr
.TP
.B \-h
Print usage information.
.SH "DISK SELECTION"
The parameter
.B \-a
can be used to set a filter on the disk's device name (omit /dev/) for
subsequent idle-time settings. The default is all disks:
.P
.TP
.B \1)
A
.B \-i
option before the first
.B \-a
option will set the default idle time; hence, compatibility with previous
releases of hd-idle is maintained.
.TP
.B \2)
In order to disable spin-down of disks per default, and then re-enable
spin-down on selected disks, set the default idle time to 0.
.SH EXAMPLE
hd-idle -i 0 -a sda -i 300 -a sdb -i 1200
.P
This example sets the default idle time to 0 (meaning hd-idle will never
try to spin down a disk), then sets explicit idle times for disks which
have the string "sda" or "sdb" in their device name.
.SH AUTHOR
hd-idle was written by Chistian Mueller <chris@mumac.de>
.PP
This manual page was written by Christian Mueller <chris@mumac.de>,
for the Debian project (and may be used by others).
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment