<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to spindown(sleep) a SATA hard disk drive after being idle (Linux)</title>
	<atom:link href="http://blog.mymediasystem.net/uncategorized/simple-way-to-spindown-a-sata-hard-disk-drive-after-being-idle-linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mymediasystem.net/uncategorized/simple-way-to-spindown-a-sata-hard-disk-drive-after-being-idle-linux/</link>
	<description>MyMediaSystem - 1080p - AVCHD - H.264 - Linux - 3D - GPS &#38; GPX</description>
	<lastBuildDate>Wed, 08 Feb 2012 06:03:13 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: acmelab68</title>
		<link>http://blog.mymediasystem.net/uncategorized/simple-way-to-spindown-a-sata-hard-disk-drive-after-being-idle-linux/comment-page-1/#comment-2419</link>
		<dc:creator>acmelab68</dc:creator>
		<pubDate>Wed, 09 Feb 2011 18:23:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mymediasystem.net/?p=653#comment-2419</guid>
		<description>This way you&#039;ve at least got a cleaner crontab entry. Thanks a lot.</description>
		<content:encoded><![CDATA[<p>This way you&#8217;ve at least got a cleaner crontab entry. Thanks a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: frazzmatazz</title>
		<link>http://blog.mymediasystem.net/uncategorized/simple-way-to-spindown-a-sata-hard-disk-drive-after-being-idle-linux/comment-page-1/#comment-2416</link>
		<dc:creator>frazzmatazz</dc:creator>
		<pubDate>Sun, 06 Feb 2011 01:52:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mymediasystem.net/?p=653#comment-2416</guid>
		<description>Here&#039;s my hacked together version:

The following line in /etc/crontab...

&lt;pre&gt;*/10 *  * * *   root    /usr/local/bin/check-bigspace-unmounted &gt;/dev/null 2&gt;&amp;1
&lt;/pre&gt;

Runs this script every 10 minutes (or is that 6) to see if &quot;Bigspace&quot; (my 2nd SATA drive for bulk storage) is not mounted. And if not, then it spins it down:

&lt;pre&gt;mount &#124;grep Bigspace
if [ $? -ne 0 ] ; then
   echo &quot;Bigspace is not mounted&quot;
   /sbin/hdparm -C /dev/disk/by-label/Bigspace &#124;grep standby
   if [ $? -ne 0 ] ; then
      echo &quot;Spinning down Bigspace&quot;
      spindown-bigspace
      exit 0
   fi
   echo &quot;Bigspace is spundown&quot;
else 
   echo &quot;Bigspace is mounted&quot;
   exit 1
&lt;pre&gt;fi 


I sadly haven&#039;t found a graceful way of doing this yet. But it works.</description>
		<content:encoded><![CDATA[<p>Here&#8217;s my hacked together version:</p>
<p>The following line in /etc/crontab&#8230;</p>
<pre>*/10 *  * * *   root    /usr/local/bin/check-bigspace-unmounted &gt;/dev/null 2&gt;&amp;1
</pre>
<p>Runs this script every 10 minutes (or is that 6) to see if &#8220;Bigspace&#8221; (my 2nd SATA drive for bulk storage) is not mounted. And if not, then it spins it down:</p>
<pre>mount |grep Bigspace
if [ $? -ne 0 ] ; then
   echo "Bigspace is not mounted"
   /sbin/hdparm -C /dev/disk/by-label/Bigspace |grep standby
   if [ $? -ne 0 ] ; then
      echo "Spinning down Bigspace"
      spindown-bigspace
      exit 0
   fi
   echo "Bigspace is spundown"
else
   echo "Bigspace is mounted"
   exit 1
</pre>
<pre>fi 

I sadly haven't found a graceful way of doing this yet. But it works.</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: doomy</title>
		<link>http://blog.mymediasystem.net/uncategorized/simple-way-to-spindown-a-sata-hard-disk-drive-after-being-idle-linux/comment-page-1/#comment-2392</link>
		<dc:creator>doomy</dc:creator>
		<pubDate>Fri, 05 Nov 2010 15:10:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mymediasystem.net/?p=653#comment-2392</guid>
		<description>hello,

i created a little script that is called in crontab i still would like to add a automatic detection of every disk in the system

#!/bin/bash
if [ ! -f /dev/shm/1 ]
then
        touch /dev/shm/1 /dev/shm/2
        echo &quot;$(date &#039;+%F %T&#039;) Tempfile does not exist, creating&quot; &gt;&gt; /var/log/hd_spindown.log
fi
mv /dev/shm/1 /dev/shm/2
cat /proc/diskstats &gt; /dev/shm/1

export HD=&quot;sdf &quot;
if [ &quot;$(diff /dev/shm/1 /dev/shm/2 &#124; grep $HD )&quot; =  &quot;&quot; ]
then
        if [ &quot;$(/sbin/hdparm -C /dev/$HD &#124; grep &quot;drive state&quot; &#124; cut -d: -f2 &#124; awk &#039;{ print $1}&#039;)&quot; = &quot;standby&quot; ]
        then
                echo &quot;$(date &#039;+%F %T&#039;) $HD already spun down&quot; &gt;&gt; /var/log/hd_spindown.log
        else
                /sbin/hdparm -y /dev/$HD
                echo &quot;$(date &#039;+%F %T&#039;) Spindown $HD&quot; &gt;&gt; /var/log/hd_spindown.log
        fi
else
        echo &quot;$(date &#039;+%F %T&#039;) $HD is in use&quot; &gt;&gt; /var/log/hd_spindown.log
fi
</description>
		<content:encoded><![CDATA[<p>hello,</p>
<p>i created a little script that is called in crontab i still would like to add a automatic detection of every disk in the system</p>
<p>#!/bin/bash<br />
if [ ! -f /dev/shm/1 ]<br />
then<br />
        touch /dev/shm/1 /dev/shm/2<br />
        echo &#8220;$(date &#8216;+%F %T&#8217;) Tempfile does not exist, creating&#8221; &gt;&gt; /var/log/hd_spindown.log<br />
fi<br />
mv /dev/shm/1 /dev/shm/2<br />
cat /proc/diskstats &gt; /dev/shm/1</p>
<p>export HD=&#8221;sdf &#8221;<br />
if [ "$(diff /dev/shm/1 /dev/shm/2 | grep $HD )" =  "" ]<br />
then<br />
        if [ "$(/sbin/hdparm -C /dev/$HD | grep "drive state" | cut -d: -f2 | awk '{ print $1}')" = "standby" ]<br />
        then<br />
                echo &#8220;$(date &#8216;+%F %T&#8217;) $HD already spun down&#8221; &gt;&gt; /var/log/hd_spindown.log<br />
        else<br />
                /sbin/hdparm -y /dev/$HD<br />
                echo &#8220;$(date &#8216;+%F %T&#8217;) Spindown $HD&#8221; &gt;&gt; /var/log/hd_spindown.log<br />
        fi<br />
else<br />
        echo &#8220;$(date &#8216;+%F %T&#8217;) $HD is in use&#8221; &gt;&gt; /var/log/hd_spindown.log<br />
fi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KingOfDos</title>
		<link>http://blog.mymediasystem.net/uncategorized/simple-way-to-spindown-a-sata-hard-disk-drive-after-being-idle-linux/comment-page-1/#comment-2378</link>
		<dc:creator>KingOfDos</dc:creator>
		<pubDate>Mon, 04 Oct 2010 09:55:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mymediasystem.net/?p=653#comment-2378</guid>
		<description>Thanks for this. I&#039;d was searching for a method how to check for disk-inactivity. I&#039;ve replaced the &#039;spindown command&#039; with hdparm -y /dev/sda, because that suits my setup (Western Digital MyBook World Edition, SATA disk, no spindown).</description>
		<content:encoded><![CDATA[<p>Thanks for this. I&#8217;d was searching for a method how to check for disk-inactivity. I&#8217;ve replaced the &#8216;spindown command&#8217; with hdparm -y /dev/sda, because that suits my setup (Western Digital MyBook World Edition, SATA disk, no spindown).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: acmelab68</title>
		<link>http://blog.mymediasystem.net/uncategorized/simple-way-to-spindown-a-sata-hard-disk-drive-after-being-idle-linux/comment-page-1/#comment-2055</link>
		<dc:creator>acmelab68</dc:creator>
		<pubDate>Thu, 02 Jul 2009 06:35:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mymediasystem.net/?p=653#comment-2055</guid>
		<description>@Christian
Well, actually I do have a few (mostly newer) machines hdparm is working right away for SATA drives, but only because the BIOS supports AHCI. This is definitely also true in your case, just look into your BIOS and see for yourself.</description>
		<content:encoded><![CDATA[<p>@Christian<br />
Well, actually I do have a few (mostly newer) machines hdparm is working right away for SATA drives, but only because the BIOS supports AHCI. This is definitely also true in your case, just look into your BIOS and see for yourself.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian</title>
		<link>http://blog.mymediasystem.net/uncategorized/simple-way-to-spindown-a-sata-hard-disk-drive-after-being-idle-linux/comment-page-1/#comment-2054</link>
		<dc:creator>Christian</dc:creator>
		<pubDate>Thu, 02 Jul 2009 06:26:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mymediasystem.net/?p=653#comment-2054</guid>
		<description>Why don&#039;t you use hdparm for SATA-drives as well? It works the same way for PATA and for SATA drives.</description>
		<content:encoded><![CDATA[<p>Why don&#8217;t you use hdparm for SATA-drives as well? It works the same way for PATA and for SATA drives.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

