I pretty much always have my home file server mounted via samba (automount/dynamic) on my laptop. The problem is that samba and other network shares usually don't play nice after a sleep, causing me to manually remount the shares. This is especially the case when my ip changes. My solution is to use the sleepwatcher daemon (download) to run commands just before sleep and after wake.
By unmounting your network shares just before sleep, your system won't have to deal with lost connections when it wakes up. Additionally, when your system wakes up, the sleepwatcher daemon will run your wakeup script, which can remount your network shares. sleepwatcher daemon Here are the steps:
1. Install sleepwatcher.
2. Make a shell script in your home directory named .sleep. I just unmount my network mounts in this script. Make sure you chmod it to at least 700; 755 is OK, too. Here's the script:
logger -t sleepwatcher "unmounting serv"
umount /Network/Servers/servh/data
3. Make a shell script in your home directory named .wakup. Since this script might run before the network comes back up, I use a trick to pipe the command to a backgrounded bash prompt with a sleep 10 command. chmod this one to 700 or 755 as well:
echo 'sleep 10
logger -t sleepwatcher "remounting serv"
ls /Network/Servers/servh/data' | /bin/sh&
The logger lines help you see what's going in system.log. Since my mount is dynamic, a simple ls is enough to tell automount to mount it.