Command for Spinning up all disks


Recommended Posts

Hi there,

i use the unRaid Server together with Media Portal to serve my HTPC's.

Because i dont need the Server the whole time i put it to S3 when not needed.

 

THe problem is that if it comes out of S3 the disks spin down and one of the Media Portal component can't deal with it, not showing my my TV Series anymore.

 

So what i want to do is to spin up the disk when the server comes out of S3. On the Webgui there is a command for spinning up all drives at once, how can i do this on the command line?

Link to comment

Hi there,

i use the unRaid Server together with Media Portal to serve my HTPC's.

Because i dont need the Server the whole time i put it to S3 when not needed.

 

THe problem is that if it comes out of S3 the disks spin down and one of the Media Portal component can't deal with it, not showing my my TV Series anymore.

 

So what i want to do is to spin up the disk when the server comes out of S3. On the Webgui there is a command for spinning up all drives at once, how can i do this on the command line?

 

It takes two commands:

 

/usr/bin/wget  -q  -O  -  localhost/update.htm >/dev/null

/usr/bin/wget  -O  -  --post-data  'startState=STARTED&cmdSpinUpAll=Spin Up'  localhost/update.htm

Link to comment

Thanks for that hint.

 

Would there also be an way to do that with the mdcmd tool within unRaid, unfortunatly i have nowhere found an dokumentation for that command.

I do not know of a command to spinup all the disks using mdcmd, jusy individual disks.

/root/mdcmd spinup 1

/root/mdcmd spinup 2

/root/mdcmd spinup 3

(will spin up disks 1,2,3)

 

 

Link to comment

Okay then what i have to do is to evaluate how many disks are in the System, and then using a loop in my S3 Script to spin up all disk's with the mdcmd tool.

This will do it: 

for disknum in 0 `ls /dev/md* | sed "sX/dev/mdXX"`; do /root/mdcmd spinup $disknum; done

 

If you do not want to spin up the parity disk, you can use:

for disknum in `ls /dev/md* | sed "sX/dev/mdXX"`; do /root/mdcmd spinup $disknum; done

 

the mdcmd interface will not spin up the cache drive, since it is not part of the protected array.  That has to be done with hdparm.

 

Joe L.

Link to comment
  • 6 months later...

Hello, complete unraid noob here.

 

I am unsure where to copy the "for disknum in 0 `ls /dev/md* | sed "sX/dev/mdXX"`; do /root/mdcmd spinup $disknum; done" code in my S3 script?

 

This is what I have in my S3.sh. (pretty standard, taken for others in the forums)

 

--------

#!/bin/bash

 

 

drives="/dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde"

timeout=20

 

 

count=20

while [ 1 ]

do

  hdparm -C $drives | grep -q active

  if [ $? -eq 1 ]

  then

    count=$[$count-1]

  else

    count=$timeout

  fi

  if [ $count -le 0 ]

  then

    # Do pre-sleep activities

    sleep 5

 

    # Go to sleep

    echo 3 > /proc/acpi/sleep

 

    # Do post-sleep activities

    # Force a DHCP renewal (shouldn't be used for static-ip boxes)

    /sbin/dhcpcd -n

    sleep 5

 

    count=$timeout

  fi

  # Wait a minute

  echo COUNT $count

  sleep 60

done

---------

 

Thanks in advance.

 

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.