LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 08-11-2004, 07:35 PM   #1
sichen
Member
 
Registered: Mar 2004
Posts: 31

Rep: Reputation: 15
mounting an smbfs share using mount vs /etc/fstab


I can use the following command to mount an smbfs share:

mount -t smbfs //WINPC//Main\ Drive /mnt/winm/ -o user="My Username",uid=1000,gid=users,password='My Password"

But how do I do it in /etc/fstab. I am trying this:
//WINPC/Main\ Drive /windows/M smbfs username='My Username',password='My Password',owner,ro 0 0

And nothing happens. What is the exact syntax for /etc/fstab?

Thanks!
 
Old 08-11-2004, 08:16 PM   #2
danedwards11
LQ Newbie
 
Registered: Aug 2003
Posts: 12

Rep: Reputation: 0
I do mine something like this:

//host1/e /mnt/host1 smbfs rw,uid=user,gid=users,credentials=<path to smb.cred file> 0 0

I use the smb.cred file to provide additional security.

With this setup, I can do 'mount -t smbfs' and all my mounts are done.
 
Old 08-12-2004, 11:42 AM   #3
sichen
Member
 
Registered: Mar 2004
Posts: 31

Original Poster
Rep: Reputation: 15
I followed your format
//WINPC/Main\ Drive /windows/M smbfs rw,uid=myuser,gid=users,credentials=/home/myuser/.smbpasswd 0 0

In my /home/myuser/.smbpasswd
username=My User
password=My Password

But i get this message on boot up:
line 10 in /etc/fstab is bad

Is it because there is a space in my share name? Is the \ not the right syntax?

Also, how do I test a new /etc/fstab without restarting the computer? I tried /etc/init.d/autofs but it did not tell me, for example, that line 10 was bad.
 
Old 08-12-2004, 01:06 PM   #4
danedwards11
LQ Newbie
 
Registered: Aug 2003
Posts: 12

Rep: Reputation: 0
Spaces

The space is probably the problem. You can get info on fstab via 'man fstab'. It says spaces or tabs separate fields in the file. You could try using quotes, but I would at least try a non-space name to make sure that's the problem.

Also, you can use:

mount /windows/M

to try out your fstab changes.
 
Old 08-13-2004, 06:40 PM   #5
sichen
Member
 
Registered: Mar 2004
Posts: 31

Original Poster
Rep: Reputation: 15
Hi. I found the answer. In /etc/fstab, no spaces are allowed. You have to use \040.
 
  


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
Why fstab doesn't mount smbfs rjkfsm Linux - Newbie 3 12-16-2011 12:23 PM
Delay fstab mount of smbfs during boot Iron City Linux - General 7 01-21-2009 02:58 PM
Broblem mounting an smbfs in fstab without username/pass and weird names polemon Linux - Networking 6 10-25-2005 12:17 PM
RH9 mounting SMBFS from fstab - Jefficus Linux - Networking 24 11-24-2003 04:14 PM
can anyone with rh9 mount multiple shares with smbfs in fstab? Falafel Linux - Networking 2 11-15-2003 08:15 AM


All times are GMT -5. The time now is 03:27 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration