Solaris 10 NFS (1)

Network File System (NFS) Version 3.0

1. Concept:
NFS is a set of protocals

2. Daemons:
mountd ; receives client's mount request and sends back handle


3. Files
A) Server
/etc/dfs/dfstab ;list what to share out
share -o ro /usr/share/man

related commands:

share ;show what's currently share out
/etc/dfs/sharetab ;stores the results of the share command

B) Client
/etc/vfstab ;specifies nfs server's share
/etc/rmtab ;shows what's currently mounted

#dfshares server

#dfmounts server ;not supported in NFS 4.0

NFS 4.0
- Stateful connections
- Single protocal - (server) nfsd,nfsmapid (client) nfs4cbd,nfsmapid
- Improved firewall support, uses well-known port 2049

Note: server may run mountd/lockd/statd to support earlier versions of nfs.

Extra daemon: nfs4cbd - NFS V4 callback daemon. Runs on the client.
/etc/dfs/fstypes ; the default filesystem types for remote FS

ksh:gulf1# cat /etc/dfs/fstypes
nfs NFS Utilities
autofs AUTOFS Utilities
cachefs CACHEFS Utilities

To start NFS server
#/etc/init.d/nfs.server start or
svcadm -v enable svc:/network/nfs/server

#mount -o ro server:/usr/share/man /usr/share/man
#mount ; shows what's currently mounted

share -F nfs -o ro /directory

share -F nfs -o rw,rw=client1 /directory

share -F nfs -o root=client2 /directory

share -F nfs -o ro,anon=0 /directory ; anonymous user is uid 0, jumpstart

share -F nfs \
-o ro=client:client2,,root=client4 /directory

By default, anonymous user is mapped as nobody 60001. But anon= access list
can set it to something else. anonymous user is any user who doesn't have
account on the server. "-o anon=-1 " will deny anonymous users.

Quick Guide:
Server -
#svcadm -v enable svc:/network/nfs/server
#echo "share -F nfs -o ro=client /export/home/nfs" >> /etc/dfs/dfstab

Client -
#svcadm -v enable svc:/network/nfs/client
#dfsshare server
#mount -F nfs server:/export/home/nfs /mnt

mount options:
rw | ro
bg | fg ; default is fg - trys mount in foreground
soft | hard ; soft reports error and stops trying
intro | nointr ; enable or disable keyboard interrupts to kill hanging client
; intr+hard will allow control C to stop trying
suid | nosuid ; whether to enable setuid
timeo=n ; time out n thenths of a second
retry=n ; number of retry, default 10,000 times!!!!
retrans=n ; number of NFS retransmissions . default udp 5. NA for tcp


Server logging isn't supported in NFS version 4.


Read write for client1, read only for the rest clients
#share -o rw=client, ro= /directory

Cliff notes:
NFS uses dynamic rpc port allocation. see /etc/rpc for program # and rpcinfo -p for actual port.