darkside40 Posted May 16, 2011 Share Posted May 16, 2011 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? Quote Link to comment
Joe L. Posted May 17, 2011 Share Posted May 17, 2011 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 Quote Link to comment
darkside40 Posted May 17, 2011 Author Share Posted May 17, 2011 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. Quote Link to comment
Joe L. Posted May 17, 2011 Share Posted May 17, 2011 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) Quote Link to comment
darkside40 Posted May 17, 2011 Author Share Posted May 17, 2011 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. Quote Link to comment
Joe L. Posted May 17, 2011 Share Posted May 17, 2011 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. Quote Link to comment
darkside40 Posted May 17, 2011 Author Share Posted May 17, 2011 Thanks Joe thats great i will try that in the S3 script when it works like expected i will post the script here and in the suitable Script Topic. Quote Link to comment
darkside40 Posted May 23, 2011 Author Share Posted May 23, 2011 Joe do you think your cache_dir script maybe could also help me without spinning up the drives after S3? Quote Link to comment
Joe L. Posted May 23, 2011 Share Posted May 23, 2011 Joe do you think your cache_dir script maybe could also help me without spinning up the drives after S3? no Quote Link to comment
jonathanblim Posted December 18, 2011 Share Posted December 18, 2011 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. Quote Link to comment
Recommended Posts
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.