Configure NFS in Sabayon 5 Linux


1. Configure Server NFS (file /etc/exports)
  1.1 NFS options
     1.1.1 By access
     * ro - The directory is shared read only. The client machine will not be able to write it. This is the default.
     * rw - The client machine will have read and write access to the directory.
     * proto=(tcp|udp) - Mount the NFS filesystem using a specific network protocol instead of the default TCP protocol from
        /etc/netconfig. Valid protocol types are udp and tcp.
     * sync - This option allows the NFS server to violate the NFS protocol and reply to requests before any changes made by that request
        have been committed to stable storage.
     * async - Reply to requests only after the changes have been committed to stable storage.
     * no_subtree_check(subtree_check) - If a subdirectory of a filesystem is exported, but the whole filesystem isn't then whenever a NFS
        request arrives, the server must check
        not only that the accessed file is in the appropriate filesystem but also that it is in the exported tree.  
     * no_root_squash - This means that root (uid 0) on the client machine will be mapped to the anonymous UID (uid 65534), commonly
        nobody.The result is that root on the client machine
        will not be able to access anything in the exported entry. The no_root_squash option prevents this behavior. This options should only
        be used for trusted clients.
      
     1.1.2 By address
     By IP address
      /home/nfs 192.168.1.1(async,no_root_squash,no_subtree_check,rw) 192.168.1.2(async,no_root_squash,no_subtree_check,rw)
     By DNS name
      /home/nfs mohado(async,no_root_squash,no_subtree_check,rw) mohado1(async,no_root_squash,no_subtree_check,rw)
     By IP range
      /home/nfs 192.168.1.0/255.255.255.0(async,no_root_squash,no_subtree_check,rw)

  1.2 Edit exports file
  Edit /etc/exports file and add new line like this.
  /home/nfs/ 192.168.1.0/24(async,no_root_squash,no_subtree_check,rw)

  1.3 Restart NFS daemon
  To apply changes in the /etc/exports file you need to restart NFS daemon.
  #/etc/init.d/nfs restart

2. Mount remote file system on client
  2.1 First you need to create a local mount point
  # mkdir /home/nfs_local

  2.2 Mount directory
  # mount 192.168.1.1:/home/nfs /home/nfs_local

  2.3 Configure automount
  You can use your favorite editor and create new line like this in /etc/fstab:
  192.168.1.1:/home/nfs /home/nfs_local nfs defaults 0 0

  2.4 You may get error message:
  mount.nfs: mount system call failed
  ERROR: nfsmount failed to start
  For solution you must change previous line (point 2.3) on this line in /etc/fstab:
  192.168.1.1:/home/nfs /home_local nfs proto=udp,defaults 0 0

likuado
Используются технологии uCoz