Discussion:
opinion request: more efficient hard-drive keepalive
Eric Olsen
2014-09-02 15:26:37 UTC
Permalink
More information below, the tl;dr is: which do you think would be more
efficient to keep a hard drive out of suspend only during waking hours, but
allow it to spindown when it's highly unlikely to be used? Also, are there
any side-effects I should be aware of (ie, if I use hdparm daily will it
break something pretty quick)?

option 1 - cron job to ls the drive every 1/2 hour (give-or-take depending
on the suspend timer)
option 2 - cron job to use hdparm to disable suspend during the day but
enable it at night
option 3 - just hdparm to disable spindown and leave the drive running all
night (I'd rather avoid this one, it seems it would decrease the life of
the drive a bit)
or any alternative options I haven't thought of?

(more info below)

Thanks,
Eric

More information:
I have a NAS with a USB-HDD attached to it, that drive goes into
suspend/spindown and takes longer to wake up than my wife cares for (It
takes maybe 10 seconds when I use Samba or ls to access it, but she uses
XBMC to connect to it via NFS, so maybe something in that combination
causes it to take longer? She claims it takes about 2 minutes).

My first thought was to use a cron job to ls the drive as a keep-alive
action, trigger the suspend to wait another 1/2 hour then do it again in
1/2 hour - I do worry that this might not be timed right, and I may be
letting it spin-down and then minutes later spin-up every 1/2 hour, that
doesn't sound like a good idea to me. After setting that up, I wondered if
it might be any better to just use hdparm to set the suspend timer, but I
didn't want to leave the drive spinning 24/7 so I considered using cron to
use hdparm to keep the drive awake during the day, but allow it to sleep if
unused at night. My concern here is that I don't know what hdparm modifies
exactly, but if it's a chip on the drive for example, I would worry about
how many times the chip could handle being written to.

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/
David Landry
2014-09-02 18:33:29 UTC
Permalink
It takes maybe 10 seconds when I use Samba or ls to access it, but she uses
XBMC to connect to it via NFS, so maybe something in that combination
causes it to take longer? She claims it takes about 2 minute
I'd look into this a little more before messing with the powersave features
of the hard drive. Might turn out that the delay has little or nothing to
do with the hard drive spinning down.

Maybe try mounting it via NFS on another machine and see if it has that
same two minute delay? Maybe it's not NFS at all, but XBMC is slowing down
for some other reason (transcoding delays, trouble looking up metadata,
etc, etc)?

---
David Landry

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/
Eric Olsen
2014-09-02 20:53:23 UTC
Permalink
Post by David Landry
It takes maybe 10 seconds when I use Samba or ls to access it, but she
uses
XBMC to connect to it via NFS, so maybe something in that combination
causes it to take longer? She claims it takes about 2 minute
I'd look into this a little more before messing with the powersave features
of the hard drive. Might turn out that the delay has little or nothing to
do with the hard drive spinning down.
I suppose that's a possibility. Once the drive is accessed the delay
doesn't occur for a while so I'm pretty certain it's related to the
spin-down. If I request the share via Samba, and it does its 10-second
delay, once it responds she can then start the video and it starts right
away. I'll see if trying to access it via NFS just to ls takes longer than
Samba, if not I wonder if XBMC might just not handle the delay well.

Thanks for the suggestion.

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/
David Landry
2014-09-03 20:15:01 UTC
Permalink
Post by Eric Olsen
I wonder if XBMC might just not handle the delay well
Could be. If you find out what's causing it, please post it. I've toyed
with the idea of switching from Plex to XMBC, and I have a similar setup
for my Plex server :).

---
David Landry

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Loading...