From: Douglas Gilbert <dougg@torque.net>
To: linux-kernel@vger.kernel.org
Cc: marc@perkel.com
Subject: Re: Does Linux support powering down SATA drives?
Date: Sun, 20 Nov 2005 22:20:35 +1000 [thread overview]
Message-ID: <43806A13.80706@torque.net> (raw)
Marc Perkel wrote:
> Trying to save power consumption. I have a backup drive that is used
> only once a day to back up the main drive. So - why should I run it more
> that 10 minutes a day? What I'd like to do is keep it in an off state
> and then at night power it on, mount it up, do the backup, unmount it,
> and shut it down. Can I do that?
Yes, from lk 2.6.14 onwards.
An implementation (based on SAT:
http://www.t10.org/ftp/t10/drafts/sat/sat-r07.pdf) of
the START STOP UNIT SCSI command went into libata in
lk 2.6.14 . Hence you can use SCSI tools such as
sg_start (sg3_utils) or sdparm (sdparm) to place a
SATA disk in standby mode. For example:
"sg_start 0 /dev/sda" and "sdparm --command=stop /dev/sda"
are equivalent to "hdparm -y". The next command sent to that
disk will cause it to spin up again.
The power state machines of SCSI disks, ATA disks
and CD/DVD drives overlap but are not the same.
SATA and SAS transports add some wrinkles, see:
http://www.torque.net/sg/power.html
Spinning down disks with no mounted file systems makes
sense. However repeatedly spinning down a disk that is
periodically (e.g. 30 seconds later) accessed may shorten
its life.
In lk 2.6.15-rc1 implementations of the ATA COMMAND
PASS THROUGH (12 and 16 byte) SCSI commands went into
libata. These are defined in SAT (reference above).
libata also translates the HDIO_DRIVE_CMD and
HDIO_DRIVE_TASK ioctls into those pass through commands.
Recent versions of hdparm (I've tried 6.1 and 6.3) work as
expected. Hence "hdparm -y /dev/sda" puts the libata-connected
SATA disk /dev/sda into standby mode.
smartmontools also works for libata-connected SATA disks
in lk 2.6.15-rc1 .
The picture is not as bright for external USB and
1394 enclosures of ATA disks. They need to either
support the START STOP UNIT SCSI command or the
SAT pass through commands. I have not seen the
former and won't hold my breath waiting for the
latter.
Doug Gilbert
next reply other threads:[~2005-11-20 12:19 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-20 12:20 Douglas Gilbert [this message]
[not found] <5aF0K-82E-5@gated-at.bofh.it>
[not found] ` <5aH2x-2ub-5@gated-at.bofh.it>
[not found] ` <5aIrE-4BY-11@gated-at.bofh.it>
[not found] ` <5aK0x-6Wi-27@gated-at.bofh.it>
[not found] ` <5aROj-119-5@gated-at.bofh.it>
2005-11-21 3:39 ` Does Linux support powering down SATA drives? Robert Hancock
-- strict thread matches above, loose matches on Subject: below --
2005-11-21 0:27 Nicolas Mailhot
2005-11-19 17:41 Marc Perkel
2005-11-19 19:01 ` Alan Cox
2005-11-19 19:00 ` Alistair John Strachan
2005-11-19 19:14 ` Marc Perkel
2005-11-19 19:43 ` Jeff Woods
2005-11-19 20:25 ` Alan Cox
2005-11-19 20:21 ` Alistair John Strachan
2005-11-19 20:30 ` Ondrej Zary
2005-11-19 21:49 ` Alan Cox
2005-11-19 21:20 ` Marc Perkel
2005-11-19 23:04 ` Alistair John Strachan
2005-11-20 7:22 ` asmith
2005-11-20 15:53 ` Marc Perkel
2005-11-20 16:04 ` Tomasz Torcz
2005-11-20 16:07 ` Marc Perkel
2005-11-20 16:17 ` Tomasz Torcz
2005-11-20 16:08 ` Alistair John Strachan
2005-11-21 16:21 ` Rob Landley
2005-11-21 16:51 ` Jeff Garzik
2005-11-21 17:34 ` Rob Landley
2005-11-21 17:14 ` Jason L Tibbitts III
2005-11-20 1:59 ` Rogério Brito
2005-11-20 23:55 ` Pavel Machek
2005-11-21 8:48 ` Stefan Seyfried
2005-11-20 1:54 ` Rogério Brito
2005-11-20 0:57 ` James Courtier-Dutton
2005-11-21 15:43 ` Mark Lord
2005-11-21 15:49 ` Marc Perkel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43806A13.80706@torque.net \
--to=dougg@torque.net \
--cc=linux-kernel@vger.kernel.org \
--cc=marc@perkel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox