Spinup all disks via network command


Recommended Posts

I can easily turn on my UnRAID server remotely via a simple WOL command; but there are two other things I'd like to be able to do just as easily -- and I'm not sure how (if at all) these can be done.

 

(1)  Spin up all the disks.    Clearly this is trivial with the Web interface (just click the button) ... but what I'm looking for is a simply command that can be executed as a batch file (or a scheduled task) to spin up all the disks a couple minutes before a scheduled middle-of-the-night backup utility runs.  {Yes, they'll spin individually as needed, but I'd like the server to simply be at full speed when the backup starts).

 

(2)  Shut down the server.  Again, simple with the web interface -- but is there an easy way to do this from a Windows command line?    I know there's a simple utility that will let me schedule an automatic shutdown at a specified time -- but I'd like to do it when a specific batch file that can take a widely variable time to run has completed.

 

 

Link to comment

1) here the spindown function from unmenu. shouldnt be too hard to wrap that in a bash script. there might already be something easier but i dont know.

function  SpinUp( disk, cmd, f) {
    # Spin Up drives
    # loop through the drives spinning them up by using the spinup command if available or
    # by reading a single "random" block from each /dev/md* device in turn if not.  
    srand() # important to get random numbers when unmenu is re-started.
    for ( i =0; i<numdisks; i++ ) {
#print disk_name[i] ORS
        if ( disk_name[i] == disk || disk == "All Disks" ) {
            if ( has_spinup == "true" ) {
               cmd="/root/mdcmd spinup " i " >/dev/null 2>&1"
            } else {
               # calculate a random block between 1 and the max blocks on the device
               skip_blocks = 1 + int( rand() * disk_size[i] );

               #cmd="dd if=/dev/" disk_device[i] " of=/dev/null count=1 bs=1k skip=" skip_blocks " >/dev/null 2>&1"
               cmd="dd if=/dev/" disk_name[i] " of=/dev/null count=1 bs=1k skip=" skip_blocks " >/dev/null 2>&1"
            }
            #print cmd ORS
            system(cmd);
        }
    }
}

 

2) windows command line? no. but check the wiki for the powerdown script and you can easily do if from a terminal.

Link to comment
  • 2 years later...
  • 11 months later...

Sorry for bringing up this old thread, but I would like to know if there exists a command to spin up all disks via a URL in v6.

 

I have tried "http://tower/update.htm?cmdSpinUpAll=Spin%20up" and "http://tower/main.htm?cmdSpinUpAll=Spin%20up" but both didnt work.

I get a 404 file not found.

 

I checked the website source code and i guess these are the interesting lines:

<form name="otherOps" method="POST" action="/update.htm" target="progressFrame">
<input type="hidden" name="startState" value="STARTED">
<table class="array_status">
  <tr>
  <td></td>
  <td><input type="submit" name="cmdSpindownAll" value="Spin Down" style="width:80px"><input type="submit" name="cmdSpinupAll" value="Spin Up" style="width:80px"></td>
  <td><strong>Spin Down</strong> will immediately spin down all disks.<br><strong>Spin Up</strong> will immediately spin up all disks.</td>
  </tr>

 

Any ideas?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.