Posts tagged CentOS
Ok so the other day I wrote an article on how to mount the DFS to your Linux box, If you haven’t already read the other one, I suggest you go check it out now. Today im going to expand on that article and explain how to Auto Mount the DFS Share.
- Edit /etc/fstab and add the following line:
1//pinchii.com/share/data /mnt/dfsfolder cifs noauto,uid=pinchii_user,credentials=/etc/dfs_creds.conf,workgroup=PINCHII-DOMAIN 0 0
- //pinchii.com/share/data is my DFS Share
- /mnt/dfsfolder is my local mount point
- cifs is the file system
- noauto is telling the OS not to automount this mount (ill explain why later)
- uid sets the owner of the files in the file system
- credentials is the path to my credentials file
- workgroup is my domain name
- the last two 0 (zero) are the dump-freq and pass-dump, I wont get into these, google them if you like
- Create the above credential file, i created a file in /etc called dfs_creds.conf, the file looks like this:
create an init.d script, the script should look like this:Update: You dont even need the script above anymore, just setup your fstab entry as follows:
12Pause 10mount -v //mnt/dfsfolder >> logfile.log
The reason for not auto mounting the DFS in the FSTab is because if for some reason the network connection is not ready, your server will hang waiting for the DFS, pausing the script for a few seconds will allow the server to stablish a connection and then mount the DFS share.
1//pinchii.com/share/data /mnt/dfsfolder cifs uid=pinchii_user,credentials=/etc/dfs_creds.conf,workgroup=PINCHII-DOMAIN,<span style="color: #ff0000;">_netdev</span> 0 0
The option _netdev is always recommended for cifs mounts in fstab. Option _netdev delays mounting until the network has been enabled.
- Thats all you need, this is what works for me, hope it works for you!!!
- Create mount point (in my case I made /mnt/dfsfolder)
- Yum Update (doesnt hurt to have the latest and greatest of everything)
- Yum Install Samba
- Yum Install samba-client-3.0.33-3.7.el5
- Yum Install samba-common-3.0.33-3.7.el5
- Yum Install Keyutils (you need keyutils, dont skip it)
- after all is said and done, the output of uname -a is
- edit /etc/samba/smb.conf and change workgorup to PINCHII-DOMAIN (you may not even need this)
- edit /etc/request-key.conf and add:
12create cifs.spnego * * /usr/sbin/cifs.upcall -t %kcreate dns_resolver * * /usr/sbin/cifs.upcall %k
- Now try manually mounting the Share:
1mount -t cifs -v //pinchii.com/share/data /mnt/dfsfolder -o username=pinchii,workgroup=pinchii-domain
(This should prompt for a password )
- If all goes well, then you are done
- If you are getting errors, I suggest you check out the system log (dmesg | tail)
Linux pinchiilinux1 2.6.18-238.1.1.el5xen #1 SMP Tue Jan 4 13:52:39 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
And now you are done!!