Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use CentOS with Apache and PHP5 to make web development servers. Files (html, php, js, etc...) are located on a network file share (SMB) :


So, basically, developpers work on Windows workstations in network drives. Files are hosted on the file server and shared with CentOS 6.4 web servers.

What is the best way to mount the share on the CentOS servers?

I'm asking because I've tried with fstab and sometimes it went wrong and I had to manually re-mount the shares on the servers.

I also tried with autofs (in a conf. file) and it was a pain to setup even if it was more stable.

What would you recommend in that case?

Thanks a lot.

share|improve this question

The most reliable way I've found is to use autofs (you may need to install it first).

In your /etc/auto.master add the following:

/win /etc/ --timeout=60

Then create /etc/ with an entry for each Windows share such as:

user -rw,intr,credentials=/root/creds,fstype=cifs,noperm    userpc:/share_name

Next create the credentials file:



chkconfig autofs on
service autofs start

Your shares will be mapped as sub-directories of /win

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.