LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 01-31-2014, 01:21 PM   #1
Ryanms3030
Member
 
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:

[Media]
; 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:

//192.168.1.7/media /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
displace
Member
 
Registered: Jan 2013
Location: EU
Distribution: Mint, Xubuntu
Posts: 253

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.
https://wiki.archlinux.org/index.php/autofs
 
Old 01-31-2014, 02:35 PM   #3
Ryanms3030
Member
 
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
/dev/random
Member
 
Registered: Aug 2012
Location: Ontario, Canada
Distribution: Slackware 14.1, LFS-current, NetBSD 6.1.3
Posts: 272

Rep: Reputation: 103Reputation: 103
file:
/etc/fstab

//<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
<username>
<password>


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
Ryanms3030
Member
 
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:

//192.168.1.7/media /home/ryan/Desktop/media cifs password=,uid=1000,umask=000 0 0
//192.168.1.7/backup /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.
 
  


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:16 PM.

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