2

I have a Pi that is set-up with miniDlna for playing media to my tv and a samba server for a NAS set-up. My pi is connected to an external hard-drive that is actually just a hard drive enclosure; it uses internal ide/sata hard drives and makes them into usb hard drives. When you install the hard drive there is access to all the internal electronic components.

I want to be able to turn off the hard drive when it is not being accessed. I am thinking the best way to do this is to make a small circuit/relay that is activated by the gpio pins. Then the pi would run some software/service that would detect when the media is trying to be accessed. It would then send the signal to the gpio pin/s letting the hard-drive turn on and serve the request.

I believe I can figure out the electronics side of this project! My biggest hurdle and what I need help on is understanding what to look for within the software side and OS so I can determine when the hard drive is going to be accessed. I also am concerned with how miniDlna and samba are working? How connected and aware are they of the HD?

Anyone with any ideas of what I should look into on this would be great to here from you

NDEthos
  • 121
  • 1
  • 2
  • 2
  • [What @lenik said]. 2. You can use hdparm -y to issue a spin-down signal to the hard-disk. That way, you don't have to worry about syncing file system changes before disconnecting the drive (since you're not disconnecting it) and it will spin up automatically when it is accessed.
  • – n.st May 12 '14 at 22:42
  • I have tried hdparm but with a different parameter passed in. It did spin down but would not allow me to access it after that. I will try with the -y and see. With this hard drive being an ide hard drive in an enclosure connected to the computer by usb it kinda is finicky. – NDEthos May 15 '14 at 15:14
  • I measured the power consumption of by pi with as external Toshiba drive and without. The difference was ~4W. When this drive went to sleep, the power consumption dropped to 3.5W !!

    I measured the power using a kill a watt meter.

    – Lord Loh. Sep 10 '14 at 01:38