How can I stop Ubuntu from automatically unmounting Samba shares?


Answer: 1

29 hours ago

I have some music files I'd like to listen to sitting on a Samba share. I added this share via the Ubuntu GUI (Places -> Connect to server...), and everything worked just fine.

However, despite the fact that my music file is playing from this location, after I've not touched the location using the Nautilus GUI, Ubuntu/GNOME decides that I'm not using the share anymore and terminates the connection. Thus, my music stops playing and Rhythmbox is unhappy with me. Simply clicking on the new shortcut the "Connect to server..." bit created for me immediately makes the files come back again and allows me to restart the music playing.

How can I have Ubuntu not automatically dismount samba shares?

Added by: Mia Jaskolski

Answer: 2

35 hours ago

This is the method I have used successfully from 9.10 through 10.10 by mounting the shares with fstab following these steps.

  1. Make sure you have smbfs installed first.

  2. Create new directory(s) to mount the share to in terminal eg sudo mkdir /media/my_share

  3. Open fstab in gedit gksudo gedit /etc/fstab also in terminal

  4. Add one line per share example music, films, tv etc

    // /media/my_share cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

    obviously changing the IP address, share_name and my_share to the relevant folders

  5. Lastly create a hidden .smbcredentials file in root and open it in gedit

    gksudo gedit /root/.smbcredentials

    and add these lines to the new file


    if you have no password for the shares then leave them blank and if you have many different share passwords then create multiple credentials files.

    you will then need to change the owner of the credentials file

    sudo chmod 700 /root/.smbcredentials

once all of this is in place you can test your setup by typing sudo mount -a in the terminal and your shares will be mounted.

from now on they will automatically mount when you log in.

Answer: 3

34 hours ago

This is a problem with GVFS. See this post for a workaround. Hopefully someone adds a better way to do this. As an alternative you could use the standard mount-command, which does not have these limitations.

Added by: Serenity Mohr

Answer: 4

16 hours ago

If you have a server, it may be worth moving it over to a fixed IP... If it's Ubuntu Server look here: How To Geek (Ignore the line sudo apt-get remove dhcp-client as there's no need for it)

Answer: 5

26 hours ago

Im pretty sure samba times itself out after a time and unmounts. Its a security feature I think (even if you are connecting to a share without a password).

Popular Search

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1 2 3 4 5 6 7 8 9