Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-31-2014, 01:21 PM   #1
Registered: Jan 2014
Distribution: Debian, Mint, CentOS, Ubuntu
Posts: 261

Rep: Reputation: Disabled
How do I auto mount smb share?

I managed to get my samba shares working. I can manually mount them. I have just been doing that through the file browser. I am now trying to get my shares to auto mount when I log in. I have tried adding a few different lines to my fstab on my client machine but the shares don't mount. Here is how the shares are set up in my server smb.conf:

; comment = shared-directory
path = /media/media
; available = yes
; public = yes
; valid users = ryan, test, @staff
writable = yes
browsable = yes
guest ok = yes
guest only = yes
create mode = 0777
directory mode = 0777
share modes = yes
; printable = no

On my client's fstab I have the following line:

// /media/media cifs guest,uid=1000 0 0

I tried a few different fstab entries based on different things I have found on line but none have made the share automount
Old 01-31-2014, 01:38 PM   #2
Registered: Jan 2013
Location: EU
Distribution: Debian
Posts: 257

Rep: Reputation: 24
It would be interesting to setup the device to automatically mount whenever you browse a folder, and then unmount again after a while when not needed any more. You can do this by using autofs.
Old 01-31-2014, 02:35 PM   #3
Registered: Jan 2014
Distribution: Debian, Mint, CentOS, Ubuntu
Posts: 261

Original Poster
Rep: Reputation: Disabled
I'll try the suggestion. What I really want to do is have my shares mount on the desktop of two linux computers in my house so they are always there and browsable
Old 01-31-2014, 02:39 PM   #4
Registered: Aug 2012
Location: Ontario, Canada
Distribution: Slackware 14.2, LFS-current, NetBSD 6.1.3, OpenIndiana
Posts: 318

Rep: Reputation: 107Reputation: 107

//<share> /mnt/<mount point> cifs iocharset=utf8,nobrl,credentials=/root/samba.creds,_netdev,sec=ntlm,uid=<your uid>,rw 1 2

file: /root/samba.creds

chmod 700 /root/samba.creds

Last edited by /dev/random; 01-31-2014 at 02:40 PM. Reason: More information
Old 01-31-2014, 05:52 PM   #5
Registered: Jan 2014
Distribution: Debian, Mint, CentOS, Ubuntu
Posts: 261

Original Poster
Rep: Reputation: Disabled
thanks for the advice. after reading a few more tutorials, I ended up with this in my fstab:

// /home/ryan/Desktop/media cifs password=,uid=1000,umask=000 0 0
// /home/ryan/Desktop/backup cifs password=,uid=1000,umask=000 0 0

The shares mount to my desktop when I log in and that's all I want for now so I'm happy.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
NFS mount of smb mount of windows share: permission denied problem :( Bagatur Linux - Networking 4 07-07-2009 12:34 PM
How can I mount a NFS share that have a SMB share mounted? perezyanez Linux - Networking 2 09-26-2008 10:03 AM
Auto-mount windows share on boot - manual OK, auto not ok! erskie Linux - Newbie 2 02-12-2008 07:42 PM
Auto mounting Linux smb share on Windows at startup neranjana Linux - Networking 1 07-02-2004 07:56 PM
Cannot mount SMB share hotblack Linux - Networking 7 08-07-2003 12:36 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:21 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration