Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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) :

Network

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 mnt.auto 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

1 Answer 1

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/auto.win --timeout=60

Then create /etc/auto.win 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:

username=domain/user
password=user_password

Finally,

chkconfig autofs on
service autofs start

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

share|improve this answer

Your Answer

 
discard

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.