I have a small server which runs Ubuntu, running webserver and other things, and as such is on 24/7. It also serves as our file server for the majority of frequently used files, serving files through samba.

I also have a much larger server with significantly more hard drive space that is used to store large video files that are accessed infrequently (maybe once a week). It's files are mounted to the small server through samba, so clients actually go through both servers to get to the large files.

In the interest of saving power (and noise!) I'd like to set the large server to go to sleep when it's not being used. But then the odd time people want a file from it, they need to go wake it up, or remember to run a wake on lan tool manually.

Is there any way to mount the remote file system and have the small server automatically wake up the large one when someone tries to access files on it? The large server only takes a few seconds to wake back up and spin up it's drives, so the small delay is acceptable. I just want to make it happen without having to train users to do anything special.

  • You would probably need to code some frontend by yourself. Wouldn't be better to power it down by default ouf of office hours? It means not putting in sleep/waking up on demand? – jirib May 15 '12 at 19:32

Yes, you can use something like

   comment = big files
   path = /mnt/bigserver/videos
   preexec = /usr/local/bin/my_wake-on-lan_and_mount_script

-> preexec in samba docs


You can use ethtool to enable wake on unicast packets rather than magic packets. You may need to add a permanent arp entry to the clients or if they forget the server's MAC address, they won't be able to send unicast packets to try to access it and thus, wake it up.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.