Posted August 11, 201113 yr Ideally, I'm looking for some way that a Windows-based PC on the local network could run a .bat or .exe file that would somehow send a command that UnRAID could recognise and spin up the drives. Currently is there any way of doing that?
August 12, 201113 yr Just open a file on that drive with a file explorer and it will spin up. Like a small jpg or just a txt file. Linking that file to your desktop and double clic it will do the trick.
August 12, 201113 yr Just open a file on that drive with a file explorer and it will spin up. Like a small jpg or just a txt file. Linking that file to your desktop and double clic it will do the trick. Or log in as "sync" Joe L.
August 12, 201113 yr Another option is to get curl on windows and do an http post to emhttp pressing the spinup button. Although that's a bit more involved.
August 13, 201113 yr Author Thanks for the responses. However, I probably should have been more specific. Is there a way I could create a .bat or .exe file to run from another PC on the network that would spin up ALL the drives. I'm trying to get this to work as part of an automation step so unfortunately logging in via a telnet session won't work, nor will opening one small file on the server. I thought there might be a way someone has thought of to do this already, but maybe not. However, if not, I wouldn't have thought it'd be too hard to do.
August 13, 201113 yr Is this some kind of real-time, "have to be able to write at 20MB/s immediately" problem? Or, put another way, what are you doing that needs the drives to be spun up that won't spin them up by being done? You could make your batch create a file on each drive and then delete it. Create a random name each run so it won't have been cached. Edit: You could also use scriptable putty (plink) to automate a logon to sync from your batch. (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)
August 13, 201113 yr Author I won't go into the specifics of it because it's not particularly interesting but I'm using UnRAID as a media server. Due to OTHER limitations I have to write the database files used to view all of our media to a share on the UnRAID server. If the drives are spun down (which they would be if this is the first time the system has been used in a while) and the system receives a request to view the database, frankly the length of time it takes to spin the drives up is unacceptable. However, whenever a user wants to watch some media there's a button on the interface they HAVE to press, which then initiates a sequence of events to bring the starting screen up. if I could use that button press as a trigger to ALSO spin up all the drives on the UnRAID server, this would minimise the spin-up time to an acceptable level. The automation system I use can run any exe file on the PC it runs on request so I would just add that to the sequence of events already attached to the button press. Whew! Sorry to subject you to that, but that's what I'm trying to do in a nutshell.
August 13, 201113 yr I would do my best to cache the database in ram or copy it to the ramdisk. Sure, fire up the relevant drives too, asynchronously, but don't rely on them unless there's no alternative. Subjecting you to an old guy's rambling, something I've learned too many times is that users who are most impatient are those who become accustomed to the sequence you're improving. Their brains are already three steps ahead so adding or taking advantage of layers to slow them down either won't, or it'll be even more annoying.
August 13, 201113 yr Author I would do my best to cache the database in ram or copy it to the ramdisk. Unfortunately this won't work (remember those "other" limitations I mentioned?) Subjecting you to an old guy's rambling, something I've learned too many times is that users who are most impatient are those who become accustomed to the sequence you're improving. Their brains are already three steps ahead so adding or taking advantage of layers to slow them down either won't, or it'll be even more annoying. I hear you - I really do. But it's a bit hard when the user you're talking about is me. I'm not trying to slow anything down. There's an existing wait built in already, I'm just trying to leverage off that - taking advantage of an existing delay in the critical path, as it were.
August 14, 201113 yr Create a go/cron job to pre-read it on unRAID, to keep it in cache, ala cache_dirs. That's doing essentially the same thing for a very similar problem.
August 14, 201113 yr This is where an SSD as part of or mounted outside the array would help... It would be accessible all the time without spin up. In any case you can write your own .bat file that can call cURL to do an http post which presses the SPIN UP button. http://curl.haxx.se/download.html If I remember correctly I also wrote a script to do this via inetd which is accessible via tcp/ip. I think it was called spincontrol and I think the windows tool socat or netcat can send strings to a socket. I have not used it in years. You could have a very basic script as such. for disk in `/root/mdcmd status | strings | grep diskNumber | cut -d"=" -f2` do /root/mdcmd spinup $disk done hooked into /etc/inetd.conf So that when you connected to a specific port with netcat, it would run this script which would spin up all the drives. With a little bit of know how it's even possible to use the net msg command to send a message through to the samba daemon which will then run a command... But that's trickier then using a basic script triggered via inetd.
August 14, 201113 yr Author This is where an SSD as part of or mounted outside the array would help... It would be accessible all the time without spin up. Yes, this is the concept I started with thinking it was a simple plan and would be the best way to do what I wanted to do. HOWEVER, due to limitations in both my media player (Dune Prime3) and my media management software (Zappiti) it simply does not work. Using S.N.A.P. my SSD was successfully mounted on the server but was not part of the array. LIMITATION 1: The Dune cannot recognise more than 1 share. Result - I can write the database to the SSD but when the Dune player accesses it, none of the links to my media work (this was tried using smb absolute path, and NOT using absolute path - different error, same result) So, then I added the SSD to the UnRAID array. Because of the above limitation 1 I had to have it in the same share and found the second limitation/issue LIMITATION 2: UnRAID cannot be directed to allow share writes to a specific drive, meaning the database gets written to the share on the array (and all media links work) BUT NOT to the SSD - defeating the reason to have an SSD in the first place. So then I tried to be tricky and have Zappiti write the database specifically to the share directory, but specifying disk 8 in the path. LIMITATION 3: Zappiti allows this write directly to disk 8 BUT modifies the output in such a way as to "break" the links to my media. I thought that perhaps, just prior to doing a Zappiti database update, if I went into the Share tab on the web interface and set the share to only include disk 8 that that would force UnRAID to direct the write to disk 8, but that didn't work either. I've finally got to the point where I'm going to ditch the SSD, allow the Zappiti database updates to be written to the disk with the most space available, and get around the spin-up delay by some method - which is why I started this particular thread in the first thread. However, it's getting to the point now where I've bashed my head against a brick wall with this so many times I think I'm gonna give this hobby up and take up fishing instead!
August 14, 201113 yr Do you power down your media player when it is not in use? Does it respond to a "ping" command when it is turned on? If yes to both you can use a scheme like I once used. A program on the unRAID server is constantly testing to see if a "ping" response is returned from the media player. If it is, it spins up all the movie disks. It requires the media players have a fixed IP address, but that is not too difficult for most players. Joe L.
August 14, 201113 yr You can have a symlink on the share point to a directory on a specifc drive. I do that all the time so I only have one share visible from SMB. In any case, there is Joe L's solution and the scriptlets I've provided.
August 14, 201113 yr Author Do you power down your media player when it is not in use? Does it respond to a "ping" command when it is turned on? If yes to both you can use a scheme like I once used. A program on the unRAID server is constantly testing to see if a "ping" response is returned from the media player. If it is, it spins up all the movie disks. It requires the media players have a fixed IP address, but that is not too difficult for most players. Joe L. Joe, Yes, I can answer yes to both those questions, and both media players already have their own static IP addresses. However, in keeping with the same luck I've experienced so far, I don't power the media players down so much as put them in a "soft off" state. Unfortunately, in this state the media players still respond to pings (I just tested this scenario), so there's yet another solution that bites the dust because of how these players work. In any case you can write your own .bat file that can call cURL to do an http post which presses the SPIN UP button. http://curl.haxx.se/download.html This solution looks like it might work OK although, after looking at the cURL website in order to get this to work I've got yet another steep learning curve ahead of me. I really don't know linux, and I don't know HTML at all.
August 14, 201113 yr Thanks for the responses. However, I probably should have been more specific. Is there a way I could create a .bat or .exe file to run from another PC on the network that would spin up ALL the drives. I'm trying to get this to work as part of an automation step so unfortunately logging in via a telnet session won't work, nor will opening one small file on the server. I thought there might be a way someone has thought of to do this already, but maybe not. However, if not, I wouldn't have thought it'd be too hard to do. Simple. Create a small txt file on each of the drives you want the bat file to spin up. Have your Disk Shares (SMB) at least read (hidden or not) spinup.bat type \\tower\disk1\disk1.txt type \\tower\disk2\disk2.txt type \\tower\disk3\disk3.txt exit (added exit to bat file example) Then just make sure you have those files on those disks.
August 14, 201113 yr Thanks for the responses. However, I probably should have been more specific. Is there a way I could create a .bat or .exe file to run from another PC on the network that would spin up ALL the drives. I'm trying to get this to work as part of an automation step so unfortunately logging in via a telnet session won't work, nor will opening one small file on the server. I thought there might be a way someone has thought of to do this already, but maybe not. However, if not, I wouldn't have thought it'd be too hard to do. Simple. Create a small txt file on each of the drives you want the bat file to spin up. Have your Disk Shares (SMB) at least read (hidden or not) type \\tower\disk1\disk1.txt type \\tower\disk2\disk2.txt type \\tower\disk3\disk3.txt Then just make sure you have those files on those disks. Welll then. I was in the exact same situation. My media players often get left in a state where they respond to pings too. It was worth asking about though...
August 14, 201113 yr Author Simple. Create a small txt file on each of the drives you want the bat file to spin up. Have your Disk Shares (SMB) at least read (hidden or not) spinup.bat type \\tower\disk1\disk1.txt type \\tower\disk2\disk2.txt type \\tower\disk3\disk3.txt exit (added exit to bat file example) Then just make sure you have those files on those disks. I'm not 100% familiar with the 'type' command, but it lets you view the contents of the named file, right? The only thing is, once I've viewed these files (which should force the drives to spin up), do I need to "tidy up" - i.e. do the files remain open on the calling PC. If so, I'd need to have the batch file close them again, right?
August 15, 201113 yr It will spin up the disks IF the file is not already in the buffer cache. If it is, it will be read from memory and you'll not spin up the drives at all.
August 15, 201113 yr Yep, create and delete a randomly named file each time. (from a couple pages back) set SERVERPATH=\\tower\disk1 :Make_Temp set TMPFILE=spinup%RANDOM%%TIME:~6,5%.tmp if exist "%SERVERPATH%\%TMPFILE%" GOTO :Make_Temp REM. > %SERVERPATH%\%TMPFILE% pause erase %SERVERPATH%\%TMPFILE% Kill the pause. It just lets you see the file before it disappears.
August 16, 201113 yr Author Hi cyrnel, I've just had a play with this and it seems to work really well. So if I want to adjust it so it will do all of my drives, would I need to create individual batch files for each disk, or just append the same code for each drive, being careful to rename the first line?
August 16, 201113 yr If you just want all the drives to work together then set them all into a spin-up group so when 1 is accessed they all spin-up. Peter
August 16, 201113 yr Maybe something like: (where's that "crappy-language code" tag?) SETLOCAL call :spinitup disk1 call :spinitup disk3 call :spinitup disk9 and so on goto :eof :spinitup :Make_Temp set TMPFILE=\\tower\%1\spinup%RANDOM%%TIME:~6,5%.tmp if exist "%TMPFILE%" GOTO :Make_Temp REM. > %TMPFILE% pause erase %TMPFILE% goto :eof :eof Edit: Of course if you're just doing everything at once Peter's suggestion of spinup groups would be the simplest.
August 17, 201113 yr Author Thanks very much for the input. I now have a bat file that works to spin up all the drives, and I only need one more step. My automation application will ONLY run .exe files....not .bat files SO is there an easy way to convert this .bat file to a working .exe file. I found some instructions online that used Windows XP's IExpress application to create an .exe but, after following those instructions, the exe file does not work. Any suggestions?
Archived
This topic is now archived and is closed to further replies.