Setting Up NFS
Services for Sharing directories
Checking nfs service status
#
svcs -a |grep -i nfs
online 2012 svc:/network/nfs/status:default
online 2012 svc:/network/nfs/cbd:default
online 2012 svc:/network/nfs/mapid:default
online 2012 svc:/network/nfs/nlockmgr:default
online 2012 svc:/network/nfs/client:default
online 2012 svc:/network/nfs/rquota:default
online 12:17:33
svc:/network/nfs/server:default
Share any folder that you need share with nfs by editing /etc/dfs/dfstab file.
#
cat /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
""] [resource]
# .e.g,
# share
-F nfs -o rw=engineering -d "home dirs" /export/home2
/usr/sbin/share -F nfs -o rw -d "" /share
#
Disable the NFS
service on the server.
# svcadm disable network/nfs/server
Enable the NFS
service on the server.
#
svcadm enable network/nfs/server
Select Different Versions of NFS on a Server
Edit the /etc/default/nfs file
NFS_SERVER_VERSMAX=value
NFS_SERVER_VERSMIN=value
Value :Provide the version number.
Mount NFS on the client.
# mount server-name:/share-point /local-dir
Check that the NFS services started on the NFS server
#
rpcinfo -s 172.16.0.4|egrep 'nfs|mountd'
100005
3,2,1
ticots,ticotsord,tcp,ticlts,udp
mountd superuser
100003
4,3,2 tcp,udp nfs 1
100227
3,2 tcp,udp nfs_acl 1
Check that the server's mountd is responding
#
/usr/bin/rpcinfo -u 172.16.0.4 mountd
program
100005 version 1 ready and waiting
program
100005 version 2 ready and waiting
program
100005 version 3 ready and waiting
Verify that file system is shared as expected on the server
#
showmount -e
export
list for NTU-HQ-GLOBAL:
/share
(everyone)
Some Troubleshoots:
#svcs -xv nfs/server
svc:/network/nfs/server:default
(NFS server)
State:
disabled since Tue Jan 12 12:19:22 2013
Reason:
Disabled by an administrator.
See: Sun Message ID: SMF-8000-06
See: man -M /usr/share/man -s 1M nfsd
Impact:
This service is not running.
It will say what is the problem of not starting the
service, you can also go to that mention log file and observe error logs.
Nfs client mount RPC Error: Program not registered.
When trying to mount nfs partition from nfs client, its keep
getting above message that saying
nfs client mount RPC Error: Program not registered.
# mount -t nfs 172.16.0.1:/usr/local/backup
mount: mount to NFS server 172.16.0.1' failed: RPC Error:
Program not registered.
#
Solution
This is generally happens due to following reasons..
*not having any shared folders in server or
*not having necessary access rights to server or folder
NFS run in local Zones in solaris:
For this you have to enable nfs server in global Zone and
for shearing you have to give local Zone path to mount point in nfstab
Eg: /usr/sbin/share -F nfs -o rw -d "" /Zones/EMS/root/share/backup