Jump to content

hdparm question


Recommended Posts

When using hdparm (to set spindown delay times) do I have to use /dev/sdx (x=a,b,c,...) or may I use /dev/mdn (n=1,2,3,...

The /dev/md devices represent partitions on the disks, specifically, the first partition (/dev/sdx1) on each is accessed through the /dev/md device.

 

The hparm command needs to be invoked on the actual drive, not a partition, so you need to use /dev/sdX.

 

It is very easy to use the spinup and spindown commands in unRAID though, and I'd use those so it knows if the drive is spinning or not.

 

/root/mdcmd spinup 1

/root/mdcmd spinup 2

etc...

 

/root/mdcmd spindown 1

/root/mdcmd spindown 2

etc...

 

or, you can make it dynamic, so you never have to edit the set of commands by having it read the set of configured devices

 

To spin them all up:

for disk in `/root/mdcmd status | strings | grep diskNumber | cut -d"=" -f2`

do

/root/mdcmd spinup $disk

done

 

To spin them all down:

for disk in `/root/mdcmd status | strings | grep diskNumber | cut -d"=" -f2`

do

/root/mdcmd spindown $disk

done

 

Joe L.

Link to comment

I'm sorry, I did not make myself clear.  Spinning them up or down is not my issue I know how to do that and am doing it via a TCPIP command to a TCPIP listener I wrote.  My Theater system ensures that the drives are spun up when I turn it on so there are no delays when selecting a movie. It spins all the drives down when I shut the theater system down for the night.

 

My question has to do with the spindown timer, which if I understand correctly controls whether the drives internal software, having nothing to do with unraid, will spin it down after a period of inactivity. I wish to turn them off using the command hdparm -S0 /dev/sdx.  I believe I only need to do this one time for each drive as once it is done the drive will leave it that way.

 

Do you concur?

 

 

Link to comment

My question has to do with the spindown timer, which if I understand correctly controls whether the drives internal software, having nothing to do with unraid, will spin it down after a period of inactivity. I wish to turn them off using the command hdparm -S0 /dev/sdx.  I believe I only need to do this one time for each drive as once it is done the drive will leave it that way.

I believe you are correct.  You only need to invoke the command once per drive.
Link to comment

No I did not, but if you email me via my profile I will send you a copy of the listener. It listens a tcpip port for mesages from the theater and then takes an action based upon what was sent and sends a reply (acknowledgement or status) back to the caller. Robust in the sense that the other side can disappear and contact will be re-established when it reappears. Does not use HTTP but rather a raw tcpip intrface.  The other side is embedded in my home theater control system. I use it for spin control and drive status

Link to comment

I guess I have no real issue doing that as it is a blatant plagarism of other code I have seen here.  One rule though, no laughing, constructive criticism is always welcome, my Bash scripting skills and basic linux knowledge is not up to the level I want them to be. The code needs to be cleaned up as my coding methodology is first to get it working then eliminate dead code and then make it fast and efficient. I have just completed step 1 and tend to run it that way for a while just to iron out any issues.

 

Having said all that, the attached zip archive contains the listener in a subfolder and the client side as a stand alone module written in VB with source.  When I develop for my theater I always first do a standalone module with a driver that supplies missing stubs.  This module also has the code to do a WOL

 

The following is the germane snippet from my go file that loads the script and starts it running.

 

#logger -t "GOSCRIPT"  "Install tcpip_listener system"

echo ">>>>> Install the tcpip_listener.sh  script"

cp /boot/custom/scripts/tcpip_listener.sh /usr/sbin/tcpip_listener

chmod +x /usr/sbin/tcpip_listener

tcpip_listener start &

 

Caveat emptor

 

Note: edited to correct the attachment archive

unRaid_TCPIP.zip

tcpip_listener.zip

Link to comment

The only part of the code that I actually wrote has to do with the handling of the TCPIP interface.  All of the other code, with some trivial modifications came from others in thi forum.  I am not sure who, but They are publicly thanked by me.

 

It is working quite well for me. When the theater PC is told by the user interface device running over Wi-fi (the Pronto PRO) to turn on the theater; It will check the unraid system and spin up the disks if needed; It Will power up the display and the A/V Processor; It will turn on the two players (Dune, XBMC).  It waits for the disks to spin up and the display and A/V processor to become ready, but does not wait for the players to power up as there is a high probability that I will be watching TV and not a movie.

 

When I go to select a movie, however it does double check that the disks are spun up, and the desired player is turned on and ready. All this is done over TCPIP.

 

When I shutdown the Theater for the evening, it spins down the disks, and turns off all devices except the DVR's. The Dune goes to standby and XBMC is shutdown ready to respond to a WOL. Naturally the other componets; Projector, A/V processer are also powered down and the a dealy cycle ientered to allow the Projector to cool prior to accepting another startup command.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...