Enable/disable nfs

来源:互联网 发布:北京软件外包公司 编辑:程序博客网 时间:2024/05/29 07:02

Solaris:
share -F nfs /dir

unshare /dir

Linux:
modify /etc/exports
add dirs you want to share

/dir *(ro, no_root_squash)
# there are more options for nfs, pls look into the nfs manual;

service portmap start
service nfs start

 

Solaris 10:

On Solaris 10, if we delete nfs/server from smf using svccfg, we need to import the nfs/server.xml back and then add a new entry into /etc/dfs/dfstab, finally enable nfs/server will be successful.

 

svccfg import /var/svc/manifest/network/nfs/server.xml


[root@vcsv245i 51]#>more /etc/dfs/dfstab

#       Place share(1M) commands here for automatic execution
#       on entering init state 3.
#
#       Issue the command 'svcadm enable network/nfs/server' to
#       run the NFS daemon processes and the share commands, after adding
#       the very first entry to this file.
#
#       share [-F fstype] [ -o options] [-d "<text>"] <pathname> [resource]
#       .e.g,
#       share  -F nfs  -o rw=engineering  -d "home dirs"  /export/home2
share -F nfs /mnt