I have several notebooks running Scientific Linux 6.3.

The suspend function is working quite well, except for one problem:

When a notebook mounts a Samba share, plays a few videos through this share then the suspend function stops working, and the notebook suddenly needs 5 minutes to suspend.

Again, this problem only occurs if they watched videos over the samba share.

QUESTION: WHY? does samba keeps something open and need a timeout of 5 minutes, just after the suspend function has been involved or what?

Any suggestions on where to look to find out what's going on would be appreciated. Or a way for I could write a bash script to check when is the suspend button pressed so that I could do xy* thing to the machine.

(*xy=anything that corrects this problem)

  • Just to clarify, if a notebook mounts the samba share, are any of the other notebooks affected in that way? IE, the ones that don't have the share mounted, or didn't play any videos from it yet? – Shadur Jul 17 '12 at 11:25
  • no, the samba share is on an openwrt router.. the notebooks doesn't affect each other – gasko peter Jul 18 '12 at 20:07
  • can you post some logs which may relate to suspend (dmesg | grep -P (s2ram|suspend), possibly more)? – Jonas Schäfer Jul 19 '12 at 14:20
  • 5 Minutes sounds like Kerberos timeout. How do you authenticate? – Nils Jul 24 '12 at 20:10

I made the experience that samba shares react pretty bad if the connection gets interrupted while they're mounted.

Possibly the network is going down before the storage, so it may be that your system is trying to do anything with the samba share which is not possible without network connection. A workaround would be to auto-unmount it on suspend (and maybe remount it afterwards):

if [ $1 == "suspend" ]; then
    umount -afl -t cifs

If you place that in /etc/pm/sleep.d/ and make it executable, it should execute upon every suspend. I cannot really test though if it happens soon enough, just give feedback in the comments. However, you'll have problems if programs are still accessing the files in the share. -l should still unmount it from the filesystem tree, -f will make sure it works when the share server is not reachable.

You could extend that to be stateful and (attempt to) restore your mounts on resume.

I was unable to find official sources. The best is possibly to check out the linux kernel source and see in which order devices are sent to suspend and look what cifs tries to do upon suspend and so on.

  • I will try this one out as soon as I can get close to the machines.. thanks! (I will post the resolution here) – gasko peter Jul 28 '12 at 19:44


configure sudo permissions:

USERNAME ALL = NOPASSWD: /bin/mount // /home/USERNAME/Desktop/Share -t cifs*
USERNAME ALL = NOPASSWD: /bin/umount -f -a -t cifs
USERNAME ALL = NOPASSWD: /bin/umount -f -l -a -t cifs
USERNAME ALL = NOPASSWD: /sbin/modprobe -r -f cifs


with normal user:

vi ~/.mountsamba.sh; chmod +x ~/.mountsamba.sh
case $1 in

echo 'In progress...'
/usr/bin/sudo /bin/mount // /home/USERNAME/Desktop/Share -t cifs -o ro,bg,intr,soft,noexec,nosuid,nodev,password=,nolock
pkill nautilus
echo "MOUNTShare - `date`" | /usr/bin/logger

echo 'folyamatban...'
/usr/bin/sudo /bin/umount -f -a -t cifs
/usr/bin/sudo /bin/umount -f -l -a -t cifs
sleep 5
/usr/bin/sudo /sbin/modprobe -r -f cifs
pkill nautilus
echo "UMOUNTShare - `date`" | /usr/bin/logger

exit 1



put icon in GNOME-panel:

gnome-terminal -x bash -c "/home/USERNAME/.mountsamba.sh mount"
gnome-terminal -x bash -c "/home/USERNAME/.mountsamba.sh umount"


if you want to use autofs:

vi /etc/auto.master
/-  /etc/auto.samba --timeout=120

vi /etc/auto.samba
/home/USERNAME/Desktop/Share    -fstype=cifs,bg,intr,soft,ro,noexec,nosuid,nodev,password=,nolock   ://

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.