Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
nfs [2017/03/27 15:55]
Stephane de Labrusse [Settings]
nfs [2020/01/19 04:04] (current)
Stephane de Labrusse [Custom rules]
Line 1: Line 1:
-==== Glpi ==== +{{page>​stephdl_donate}} 
-<wrap hi>​Available for NS7</​wrap>​+==== NFS ==== 
 +<wrap hi>​Available for NS7 and NS6</​wrap>​ 
 [[https://​en.wikipedia.org/​wiki/​Network_File_System|Network File System]] (NFS) is a distributed file system protocol originally developed by Sun Microsystems in 1984,[1] allowing a user on a client computer to access files over a computer network much like local storage is accessed. NFS, like many other protocols, builds on the Open Network Computing Remote Procedure Call (ONC RPC) system. The NFS is an open standard defined in Request for Comments (RFC), allowing anyone to implement the protocol. [[https://​en.wikipedia.org/​wiki/​Network_File_System|Network File System]] (NFS) is a distributed file system protocol originally developed by Sun Microsystems in 1984,[1] allowing a user on a client computer to access files over a computer network much like local storage is accessed. NFS, like many other protocols, builds on the Open Network Computing Remote Procedure Call (ONC RPC) system. The NFS is an open standard defined in Request for Comments (RFC), allowing anyone to implement the protocol.
  
Line 6: Line 8:
 ====Maintainer==== ====Maintainer====
 Stephane de Labrusse at [[stephdl@de-labrusse.fr]] Stephane de Labrusse at [[stephdl@de-labrusse.fr]]
 +
 ====Installation==== ====Installation====
  
Line 15: Line 18:
   ​   ​
 ==== Usage ==== ==== Usage ====
-The rpm installs nethserver-samba and nethserver-ibay,​ nfs is running and adjustable per ibay vi the sharedfolder panel. It is advised to install nethserver-dc (Samba AD) to protect by a password ​ the access via Samba, however nfs can work also if the share are in guest mode.+The rpm installs nethserver-samba and nethserver-ibay,​ nfs is running and adjustable per ibay via the sharedfolder panel. It is advised to install nethserver-dc (Samba AD) to protect by a password ​ the access via Samba, however nfs can work also if the share are in guest mode.
  
 You have two modes You have two modes
Line 36: Line 39:
 ====Settings==== ====Settings====
  
-===Group Ownership===+===Add secondary group to a user===
  
 Except the command '​id'​ all others must be used by root or by sudo Except the command '​id'​ all others must be used by root or by sudo
  
-* To see user+* To see user Ownership
  
 +<​file>​
   id User   id User
 +</​file>​
  
 * To create a new gid/group * To create a new gid/group
  
 +<​file>​
   groupadd -g GidNumber -o GroupName   groupadd -g GidNumber -o GroupName
 +</​file>​
  
 * To add a secondary group to a user * To add a secondary group to a user
  
 +<​file>​
   usermod -a -G GidNumber UserName   usermod -a -G GidNumber UserName
 +</​file>​
  
 You might need to logout/​login your user, or reboot the computer, to apply the new group ownership You might need to logout/​login your user, or reboot the computer, to apply the new group ownership
Line 56: Line 65:
   newgrp GroupName   newgrp GroupName
 ===Mount the remote share=== ===Mount the remote share===
 +
 * by the command line * by the command line
 +
 Once the share is created, then on the remote allowed client, we need to mount the share Once the share is created, then on the remote allowed client, we need to mount the share
 <​file>​ <​file>​
Line 77: Line 88:
 </​file>​ </​file>​
  
-===custom ​rules===+* by the fstab 
 + 
 +mount the network share in the [[https://​access.redhat.com/​documentation/​en-US/​Red_Hat_Enterprise_Linux/​7/​html/​Storage_Administration_Guide/​nfs-clientconfig.html#​s2-nfs-fstab|fstab]] 
 + 
 +If you want to get mounted the NFS remote share at boot, you can add it in your fstab 
 + 
 +Eg 
 + 
 +<​file>​ 
 +server:/​usr/​local/​pub ​   /pub   ​nfs ​   defaults 0 0 
 +</​file>​ 
 + 
 +Using fstab is useful for a server which is always on, and the NFS shares are available whenever the client boots up. Edit /etc/fstab file, and add an appropriate line reflecting the setup. Again, the server'​s NFS export root is omitted. 
 + 
 +Note: Consult the NFS and mount man pages for more mount options. Some additional mount options to consider are include: 
 + 
 +* NFS Timeout 
 + 
 +Nfs can have a really long timeout in case if the remote host is not reachable, if you want to avoid it you can do 
 + 
 +<​file>​ 
 +mount -t nfs -o nolock,​timeo=30,retrans=1,retry=0 192.168.xx.xxx:/​home/​e-smith/​files /​mnt/​partage 
 +</​file>​ 
 + 
 +**timeo** 
 + 
 +The -o timeo option allows designation of the length of time, in tenths of seconds, that the client will wait until it decides it will not get a reply from the server, and must try to send the request again. The default value is 7 tenths of a second  
 + 
 +**retrans** 
 + 
 +The -o retrans option allows designation of the number of timeouts allowed before the client gives up, and displays the Server not responding message. The default value is 3 attempts.  
 + 
 +**retry** 
 + 
 +The number of minutes that the mount command retries an NFS mount operation in the foreground or background before giving up. If a value of zero is specified, the mount command exits immediately after the first failure. If this option is not specified, the default value for foreground mounts is 2 minutes, and the default value for background mounts is 10000 minutes (80 minutes shy of one week).  
 + 
 +====Custom ​rules====
 Nfs offers a lot of parameters and you may need some specific settings that it would be difficult or dangerous to let them in all hands. So for some cases you can enable by db command your nfs shares Nfs offers a lot of parameters and you may need some specific settings that it would be difficult or dangerous to let them in all hands. So for some cases you can enable by db command your nfs shares
  
 but you cannot : but you cannot :
 +
 +<​file>​
 * use the wildcard '​*'​ * use the wildcard '​*'​
-* open your shares to ip(s) outside of your local network(s) 
 * use a domain to define your shares, the ip or the network are a mandatory * use a domain to define your shares, the ip or the network are a mandatory
 * use the root '/'​ * use the root '/'​
 * let a space between the ip and its share definition * let a space between the ip and its share definition
 +</​file>​
  
 IF you want to do all these dangerous things, then you need to do them by custom templates. IF you want to do all these dangerous things, then you need to do them by custom templates.
Line 113: Line 162:
  ​sync ​           Specifies that all changes must be written to disk before a command completes  ​sync ​           Specifies that all changes must be written to disk before a command completes
  ​no_wdelay ​      ​Forces the writing of changes immediately  ​no_wdelay ​      ​Forces the writing of changes immediately
-</​file>​ 
  ​root_squash ​    ​Prevents root users  ​root_squash ​    ​Prevents root users
  ​no_root_squash ​ Allow root users  ​no_root_squash ​ Allow root users
 +</​file>​
 ====Documentation==== ====Documentation====
  
 +[[https://​access.redhat.com/​documentation/​en-US/​Red_Hat_Enterprise_Linux/​7/​html/​Storage_Administration_Guide/​ch-nfs.html|Redhat Storage_Administration_Guide]]
  
 +[[https://​wiki.archlinux.org/​index.php/​NFS|Archlinux NFS]]
 ====Admin'​s feedbacks==== ====Admin'​s feedbacks====
 FIXME FIXME
 ==== Issues ==== ==== Issues ====
  
-Please raise Issues on [[https://​github.com/​stephdl/​nethserver-nfs/​issues|github]]+Please raise Issues on [[https://​github.com/​stephdl/​dev/​issues|github]]
  
 ====Sources==== ====Sources====
 source are [[https://​github.com/​stephdl/​nethserver-nfs/​tree/​ns7|available]] ​ source are [[https://​github.com/​stephdl/​nethserver-nfs/​tree/​ns7|available]] ​
-{{tag>​module}}+{{tag>​module}}{{tag>​stephdl}}