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