This is a well known bug :
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/211631?comments=all
It's one of those thankfully-rare, but nonetheless embarrassing, high impact, over-two-years-old bugs that negatively impact Ubuntu's sheen.
It should only affect WIFI connections, but I don't see any detail about that in your question. If you're experiencing this over a wired connection then something else is in play here.
Until Network Manager is fixed (it shuts down wifi connections too quickly - before any of the init scripts are triggered), the only feasible workaround I could find is to use AutoFS.
Paraphrased from http://www.howtoforge.com/accessing_windows_or_samba_shares_using_autofs
sudo apt-get install autofs
Create /etc/auto.cifs with these file contents :
#!/bin/bash
# $Id$
# This file must be executable to work! chmod 755!
key="$1"
# Note: create a cred file for each windows/Samba-Server in your network
# which requires password authentification. The file should contain
# exactly two lines:
# username=user
# password=*****
# Please don't use blank spaces to separate the equal sign from the
# user account name or password.
credfile="/etc/auto.smb.$key"
# Note: Use cifs instead of smbfs:
mountopts="-fstype=cifs,file_mode=0644,dir_mode=0755,uid=user,gid=users"
smbclientopts=""
for P in /bin /sbin /usr/bin /usr/sbin
do
if [ -x $P/smbclient ]
then
SMBCLIENT=$P/smbclient
break
fi
done
[ -x $SMBCLIENT ] || exit 1
if [ -e "$credfile" ]
then
mountopts=$mountopts",credentials=$credfile"
smbclientopts="-A "$credfile
else
smbclientopts="-N"
fi
$SMBCLIENT $smbclientopts -gL $key 2>/dev/null \
| awk -v key="$key" -v opts="$mountopts" -F'|' -- '
BEGIN { ORS=""; first=1 }
/Disk/ { if (first) { print opts; first=0 };
gsub(/ /, "\\ ", $2);
sub(/\$/, "\\$", $2);
print " \\\n\t /" $2, "://" key "/" $2 }
END { if (!first) print "\n"; else exit 1 }
'
(edit the mountops line to reflect your real user name)
Make it exectuable with sudo chmod 755 /etc/auto.cifs
Then add this line to your /etc/auto.master, at the bottom :
/smb /etc/auto.cifs --timeout=60 --ghost
Finally, restart autofs with this line (or a reboot would work, of course) :
sudo service autofs restart
And you should then be able to open nautilus to /smb/server/share (or ls -l /smb/Server/Share)
Shutdown, suspend, hibernate should all be seamless.
If you use passwords to connect to your shares, you have to add another file in /etc/ for each server you connect to, with username and password specified. Do a "man autofs" for more detail on that, but here's the gist :
You need one credentials file for each password-protected share that you're connecting to. In your case, your server is called "Server", so create the relevant file with gksudo gedit /etc/auto.smb.Server. Then put this into that file :
username=myusername
password=mypassword
(obviously editing the fields as required).
Then you'll need to make sure that this file is only readable by root with sudo chmod 600 /etc/auto.smb.Server.
Then restart autofs as above and try browsing /smb/Server - you should see a list of your shares.
If you connect using an IP address, you'll need to repeat this process for /etc/auto.smb.192.168.1.10 or whatever.