I build myself a NAS using my raspberry pi model b with an external power hub with 2 connected hdd's. Instead of leaving everything always running, I want it to only run while it has to. So I need some mechanism that allows me to send the raspberry pi as well as the hdd's to sleep. Another problem I ran into is: After the wake up command, how will the raspberry pi and the hdd's 'fall asleep' again? I hope you got any hint for me I can work with.
Additional informations: I am using samba for filesharing. Raspian is my OS.