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! |
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. |
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. |
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. |
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. |