Operating System - Linux
1830216 Members
1951 Online
109999 Solutions
New Discussion

Correct syntax for mounting a windows share in the /etc/fstab file

 
Andrew Kaplan
Super Advisor

Correct syntax for mounting a windows share in the /etc/fstab file

Hi there --

I am trying to mount a Windows share using the /etc/fstab file. The Windows share can be mounted manually using the following command syntax:

mount -t cifs ///Photon-CMS -o username=,password= /FOCUS/tmp/network/import

The command syntax that I used in the /etc/fstab file to automate the process shown above is the following:

///Photon-CMS$ /FOCUS/tmp/network/import cifs user=,password= 0 0

However, when I ran the mount -a command, I got the following error:

mount error 6 = No such device or address
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

I tried the smbfs instead of the cifs option in the fstab line. The new syntax read as follows:

///Photon-CMS$ /FOCUS/tmp/network/import smbfs user=,password= 0 0

When I ran the mount -a command again, the output that I got was the following:

Unknown parameter encountered: "client code page"
Ignoring unknown parameter "client code page"
6309: session setup failed: ERRDOS - ERRnoaccess (Access denied.)
SMB connection failed

The user account is a domain user account. I vaguely remember an option that addresses this issue, but I don't remember the syntax.

What is the correct syntax for the fstab file? Thanks.
A Journey In The Quest Of Knowledge
2 REPLIES 2
Ivan Ferreira
Honored Contributor

Re: Correct syntax for mounting a windows share in the /etc/fstab file

Please see these methods:

http://wiki.centos.org/TipsAndTricks/WindowsShares

Try with a share that does not contains "$" first.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Andrew Kaplan
Super Advisor

Re: Correct syntax for mounting a windows share in the /etc/fstab file

Hi there --

Thanks for your reply. I checked out the URL you mentioned, and I am using the so-called "Better Method" of mounting the samba mount.

The problem that I am seeing now is the following: Using the following syntax in the fstab file,

///Photon-CMS$ /FOCUS/tmp/network/import cifs user,uid=1961,rw,noauto,suid,credentials=/root/secret.txt 0 0

and running the mount -a command, the mount in question does not appear to be mounted, although no errors are indicated with the command.

The above syntax was used with uid 1961, which is local user account, as well as uid 0, which is the local root account.

What other step(s) do I need to take to rectify this issue? Thanks.

A Journey In The Quest Of Knowledge