Sunday, June 4, 2017

Solaris 10 - autofs set up


autofs


On nfs server perform the following tasks

1. Add entry to dfshare
# vi /etc/dfs/dfstab
share -F nfs /data/mydb/test/myshare

2. Share your directory
# shareall

3. Verify your share
# share
-               /data/mydb/test/myshare   rw   ""

4. List the directories under the share
# ls -R /data/mydb/test/myshare
/data/mydb/test/myshare:
test

/data/mydb/test/myshare/test:
best

/data/mydb/test/myshare/test/best:
bishal

/data/mydb/test/myshare/test/best/bishal:


Now, go to your client system

1. Add entry to auto_master file for direct map
# vi /etc/auto_master
/-      auto_data       -browse

2. Add entry for direct map on auto_data file
# vi /etc/auto_data
/dbdata/OS_Image1       192.168.10.21:/data/mydb/test/myshare

3. Run automunt command to update the share to be managed by automount
# automount -v

4. Restart autofs
# svcs -a | grep autofs
online         10:20:06 svc:/system/filesystem/autofs:default
# svcadm restart autofs

# cd /dbdata/
# ls
OS_Image1
# cd OS_Image1/
# ls
test
# cd test/
# ls
best
# cd best/bishal/


ls -R /dbdata/OS_Image1
/dbdata/OS_Image1:
test

/dbdata/OS_Image1/test:
best

/dbdata/OS_Image1/test/best:
bishal

/dbdata/OS_Image1/test/best/bishal:


# df -h .
Filesystem             size   used  avail capacity  Mounted on
192.168.10.21:/data/mydb/test/myshare     872M   453M   419M    52%    /dbdata/OS_Image1

No comments:

Post a Comment