Using Automount services(Autofs)
# vim auto.master
/home /etc/auto.home
# vim auto.home
nfs -rw 192.168.0.130:/home/nfs
Started autofs. Logged in as an NFS user and the exported home directory get automatically mounted.
# vim /etc/auto.master
/home /etc/auto.home ------ means to mount directory specified in auto.home into "/home" all NFS shares specified in auto.home should mount under "/home"
# vim auto.home
nfs -rw 192.168.0.130:/home/nfs
------ "192.168.0.130:/home/nfs" will be mounted into
"nfs"(nfs -- first field)
SERVER SetUP
# mkdir /automount
# cd /automount/
# mkdir documents
# touch documents/commands.txt
# vim /etc/exports
/automount 10.0.0.154/255.0.0.0(rw,sync)
# service nfs restart
# service nfslock restart
CLIENT SetUp
# vim /etc/auto.master
/test /etc/auto.test
# vim/etc/auto.test
autofs rw,sync 10.0.0.180:/automount
# service autofs restart
# vim auto.master
/home /etc/auto.home
# vim auto.home
nfs -rw 192.168.0.130:/home/nfs
Started autofs. Logged in as an NFS user and the exported home directory get automatically mounted.
# vim /etc/auto.master
/home /etc/auto.home ------ means to mount directory specified in auto.home into "/home" all NFS shares specified in auto.home should mount under "/home"
# vim auto.home
nfs -rw 192.168.0.130:/home/nfs
------ "192.168.0.130:/home/nfs" will be mounted into
"nfs"(nfs -- first field)
SERVER SetUP
# mkdir /automount
# cd /automount/
# mkdir documents
# touch documents/commands.txt
# vim /etc/exports
/automount 10.0.0.154/255.0.0.0(rw,sync)
# service nfs restart
# service nfslock restart
CLIENT SetUp
# vim /etc/auto.master
/test /etc/auto.test
# vim/etc/auto.test
autofs rw,sync 10.0.0.180:/automount
# service autofs restart
No comments:
Post a Comment