NFS Server Side
  • A server exports a file system to the specified hosts and allows them to mount it.
  • To specify what file system to export and to what hosts through
  • /etc/exports file:
    file-system host1(options)  host2(options) 
    
    For example:
    /home    unisys01(rw)  unisys05(ro)
    /exports unisys*(rw)
    
  • To export directories manualy, run command:
  • /usr/sbin/exportfs -o rw unisys01:/home
    
  • To un-export, run:
  • /usr/sbin/exportfs -u unisys01:/home
    
  • Export common options:
  • ro
    rw
    root_squash
    no_root_squash
    all_squash
    no_all_squash
    anonuid=xxxx
    anongid=xxxx
    sync  (NFSv3)
    async (NFSv3)
    noaccess (used with nested exports)
    
    For example, noaccess in /etc/exports can be used as follows:
    /users         node*(rw)
    /users/alexei  (noaccess) 
    
    Default options: ro, async, root_squash

  • To run the Server NFS services, the following deb packages need to be installed:
    portmap, nfs-common, nfs-kernel-server

  • To start the NFS services, run the startup scripts:
  • /etc/init.d/portmap start
    /etc/init.d/nfs-common start
    /etc/init.d/nfs-kernel-server start
    
  • To make sure that the RPC services are running:
  • /usr/bin/rpcinfo -p
    
  • Every time when you modify /etc/exports file, run
  • /usr/sbin/exportfs -ra
    
  • To verify exports, run one of the two commands below
  • /usr/sbin/exportfs -v
    /sbin/showmount -e
    
  • To start NFS services at boot-up time, run
    update-rc.d portmap defaults
    update-rc.d nfs-common defaults
    update-rc.d nfs-kernel-server defaults
    


    Previous Pageprevious First Pagetop Next Pagenext