Simplest Enterprise Continuous Integration Solutions

Saturday, August 13, 2011

Enterprise Linux - Autofs Automounting

Implementing an automount to NFS /home directory when user login to NIS client.
  • NFS Client
Make sure netfs, nfslock, portmap are installed and daemons are running.
[root@linux64-client1 ~]# chkconfig nfslock on
[root@linux64-client1 ~]# service nfslock start 
Starting NFS statd:                                        [  OK  ]
[root@linux64-client1 ~]# chkconfig portmap on
[root@linux64-client1 ~]# service portmap start
Starting portmapper:                                       [  OK  ]
[root@linux64-client1 ~]# chkconfig netfs on
[root@linux64-client1 ~]# service netfs start
Mounting other filesystems:                                [  OK  ]
[root@linux64-client1 ~]# mv /home /home.save
[root@linux64-client1 ~]# mkdir /home
Manual mount
[root@linux64-client1 ~]# mount 10.3.20.100:/home /home
[root@linux64-client1 ~]# umount /home
Configure autofs automount
[root@linux64-client1 ~]# cat /etc/auto.master
/home   /etc/auto.home
[root@linux64-client1 ~]# cat /etc/auto.home
*   -fstype=nfs,soft,intr,rsize=8192,wsize=8192,nosuid,tcp 10.3.20.100:/home/&
[root@linux64-client1 ~]# chkconfig autofs on
[root@linux64-client1 ~]# service autofs restart
Stopping automount:                                        [  OK  ]
Starting automount:                                        [  OK  ]
[root@linux64-client1 ~]#


After doing this, you won’t be able to see the contents of the /home directory on linux64-server as user root. This is because by default NFS activates the root squash feature, which disables this user from having privileged access to directories on remote NFS servers.

No comments:

Post a Comment