NFS Setup on Solaris

NFS Server Setup
1)  /etc/rc.d or /etc/init.d
    /usr/sbin/portmap or rpc.portmap

2)  /etc/dfs/dfstab

    share   -F   nfs   -o   rw=nfsclient:   /export/nfs
3)  /etc/dfs/sharetab

    /export/nfs   -   nfs   rw=nfsclient
4)  /etc/dfs/fstypes 

    nfs NFS Utilities

5)  /etc/rmtab lists filesystems that are remotely mounted by clients. 
6)  mountd      rpc.mountd
    nfsd        rpc.nfsd
7)  /usr/sbin/share (and chomod a+rx)

    killall -HUP /usr/sbin/rpc.mountd
    killall -HUP /usr/sbin/rpc.nfsd
    echo re-exported file systems
    (Run script after modifying /etc/exports)
8)  rpcinfo -p (to check mountd and nfsd running)

NFS Client Setup

1)  To make the system mount a nfs file system upon boot


    nfsserver:/export/nfs     -      /mnt/nfs    nfs   -    yes    -

2)  /etc/mnttab lists filesystems which are currently mounted on
    onto that client.
3)  To mount:

    % mount nfsserver:/export/nfs /mnt/nfs

4)  To unmount:

    % umount /mnt/nfs

Server security: the portmapper

1)  First we edit /etc/hosts.deny.

  portmap: ALL

2)  /etc/hosts.allow.

Debugging NFS Status

1)  # share (lists filesystems being exported)

2)  # showmount -e host.domain (shows export list for host)

3)  # nfsstat -c (shows the stats of an NFS client)

4)  # nfsstat -s (shows the stats of an NFS server)

5)  # rpcinfo -T udp nfsserver {nfs,mountd,nlockmgr,llockmgr}
      (to check daemons running)
6)  # snoop nfsserver and nfsclient

7)  script /var/lockd.out
    /usr/lib/nfs/lockd -d3
8)  script /var/lockd.out
    truss -o /var/truss.out -vall -f /usr/lib/nfs/lockd -d3
9)  # fuser /mnt (lists which process is using the partition)

10) To trim /etc/rmtab, add following in rc:

   if [ -f /etc/rmtab ] then
     sed -e "/^#/d /etc/rmtab > /tmp/rmtab 2>/dev/null
     mv /tmp/rmtab /etc/rmtab >/dev/null 2>&1

Copyright© 1995-2001 Daniel SW Kim. All Rights Reserved