Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
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? –  Jiri Xichtkniha May 15 '12 at 19:32
add comment

2 Answers

up vote 3 down vote accepted

Yes, you can use something like


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

-> preexec in samba docs

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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