DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2009-05-15 08:58:08

talkingRock
Member
Registered: 2009-03-26
Posts: 100

scriptable way to turn off spindown?

Is there a means of turning off spindown that can be called from a script?
I know that dns323-spindown will set the spindown between 5 and 30 minutes, but it seems to reject 0 or -1 which would be the obvious choices for "off".      The web interface can turn spindown off, but that's a web interface.   

The real problem I want to solve is that I'd like to be able to run an "extended offline" test through smartctl, invoked by a script which is itself a collection of weekly or monthly maintenance activities invoked through crond and which results in a nice email telling me that the box is in good or bad shape.   
Unfortunately, when the disks spin down, the disk firmware sees that as an "abort".   (I'm not sure why.) 

I've got a "daily maintenance" script already running that does a short test and a few other things.

Alternate solutions that get me to being able to run an extended offline test from a script would be welcome.   I did have the idea of setting the spindown to 30 and then having a script touch a different file and call sync every 15 minutes or so.   I'm guessing that is an ugly way of at least making it work.     In theory hdparm would do it, but hdparm doesn't seem to work on my disks through the marvell controller.

Offline

 

#2 2009-05-15 10:55:20

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: scriptable way to turn off spindown?

There is a way, but it wasn't implemented in dns323-spindown. You may want to try the attached version that also understands 'dns323-spindown off'. I didn't verify that it works, but at least it didn't crash my box wink


Attachments:
Attachment Icon dns323-spindown.c, Size: 2,581 bytes, Downloads: 225

Offline

 

#3 2009-05-15 20:25:24

talkingRock
Member
Registered: 2009-03-26
Posts: 100

Re: scriptable way to turn off spindown?

Fonz,
Thanks!    Is your "day job" in this area, or is this purely a hobby for you?

To compile this, I know that I'll need at least gcc and binutils.   

Which versions do I want?   The cross-compile how-to says that it will not work with gcc-4.   
Is this true for native compile too?   My current plan is to be able to compile very small things natively. 

Should I be able to compile this with the gcc-4 and binutils packages from your ffp 0.5 packages, or do I need gcc-3.4 (I think that I should be able to get that through optware?)      I don't have a compiler on the box right now and I was trying to figure out whether I wanted the gcc-4 or gcc-3.4 toolchain.

Offline

 

#4 2009-05-15 22:29:39

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: scriptable way to turn off spindown?

talkingRock wrote:

My current plan is to be able to compile very small things natively.

All of ffp 0.5 is compiled natively on my dns323. Binary attached.


Attachments:
Attachment Icon dns323-spindown, Size: 6,641 bytes, Downloads: 190

Offline

 

#5 2009-05-15 22:40:09

talkingRock
Member
Registered: 2009-03-26
Posts: 100

Re: scriptable way to turn off spindown?

Fonz,
Thanks again.  I'll give it a try.
Do you use the gcc-4 and binutils in your packages
directory to compile, or do you have a different one?

I would think that the memory limitations would
create problems compiling big stuff.   It's interesting
to know that it works.

Offline

 

#6 2009-05-15 23:30:13

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: scriptable way to turn off spindown?

talkingRock wrote:

Do you use the gcc-4 and binutils in your packages
directory to compile,

Yes, it's usually no problem as there's plenty of swap space.

Offline

 

#7 2009-05-24 12:26:06

krimb1
Member
Registered: 2008-01-05
Posts: 65

Re: scriptable way to turn off spindown?

fonz wrote:

Binary attached.

Just wondering if I'm doing something funny: I tried copying the binary to my lnx_bin directory and ran chmod a+x to give it excecute permissions. However, I still end up receiving

Code:

/ # dns323-spindown
ash: dns323-spindown: not found

It's a newbie mistake I know, but any help? smile

Offline

 

#8 2009-05-25 02:53:33

talkingRock
Member
Registered: 2009-03-26
Posts: 100

Re: scriptable way to turn off spindown?

There are two potential problems:
  Either your shell is not finding the executable.   This is a path problem.   Try fully specifying the path
  to see if this is the issue.

  Second possibility, ld is not finding a shared object.     Do you have ffp installed under /ffp?   I believe
  Fonz quasi-hardcodes a library path using one of the bintools to set one of the elf variables.     This works fine for almost everyone since we install under /ffp, and it makes coexistence with optware, ... easier.

Offline

 

#9 2009-05-25 04:57:37

krimb1
Member
Registered: 2008-01-05
Posts: 65

Re: scriptable way to turn off spindown?

Thanks talkingRock for your helpful response.

I've tried specifying the path to no avail. However I do think you've hit the nail on the head: my fun_plug is not installed to /ffp, but instead to an external USB drive.

Question: if I symlink the ffp directory from my USB drive to /ffp, will calling the dns323-spindown cause the hard drive to spin up? It would be rather ironic if I could not check to make sure the disks are spundown every time I call the binary! wink

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB