LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   mounting an smbfs share using mount vs /etc/fstab (https://www.linuxquestions.org/questions/linux-networking-3/mounting-an-smbfs-share-using-mount-vs-etc-fstab-216429/)

sichen 08-11-2004 07:35 PM

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!

danedwards11 08-11-2004 08:16 PM

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.

sichen 08-12-2004 11:42 AM

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.

danedwards11 08-12-2004 01:06 PM

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.

sichen 08-13-2004 06:40 PM

Hi. I found the answer. In /etc/fstab, no spaces are allowed. You have to use \040.


All times are GMT -5. The time now is 04:54 AM.