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 16:04]
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 81: Line 90:
 * by the fstab * by the fstab
  
-mount the network share in 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 If you want to get mounted the NFS remote share at boot, you can add it in your fstab
Line 88: Line 97:
  
 <​file>​ <​file>​
-192.168.XX.205:/mirror/mirror/smeserver-repo ​ /​home/​build/​smeserver/ nfs rw  ​0 0+server:/usr/local/pub    ​/pub   nfs    ​defaults ​0 0
 </​file>​ </​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. 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.
- 
-/etc/fstab 
-servername:/​music ​  /​mountpoint/​on/​client ​  ​nfs4 ​  ​rsize=8192,​wsize=8192,​timeo=14,​_netdev 0 0 
  
 Note: Consult the NFS and mount man pages for more mount options. Some additional mount options to consider are include: Note: Consult the NFS and mount man pages for more mount options. Some additional mount options to consider are include:
- 
-**rsize and wsize** ​ 
- 
-The rsize value is the number of bytes used when reading from the server. The wsize value is the number of bytes used when writing to the server. The default for both is 1024, but using higher values such as 8192 can improve throughput. This is not universal. It is recommended to test after making this change, see #​Performance tuning. 
- 
-**timeo** ​ 
- 
-The timeo value is the amount of time, in tenths of a second, to wait before resending a transmission after an RPC timeout. After the first timeout, the timeout value is doubled for each retry for a maximum of 60 seconds or until a major timeout occurs. If connecting to a slow server or over a busy network, better performance can be achieved by increasing this timeout value. 
- 
-**_netdev** ​ 
- 
-The _netdev option tells the system to wait until the network is up before trying to mount the share. systemd assumes this for NFS, but anyway it is good practice to use it for all types of networked file systems Note: Setting the sixth field (fs_passno) to a nonzero value may lead to unexpected behaviour, e.g. hangs when the systemd automount waits for a check which will never happen. ​ 
  
 * NFS Timeout * NFS Timeout
Line 114: Line 108:
 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 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 mount -t nfs -o nolock,​timeo=30,​retrans=1,​retry=0 192.168.xx.xxx:/​home/​e-smith/​files /​mnt/​partage
 +</​file>​
  
 **timeo** **timeo**
Line 132: Line 128:
  
 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 164: 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}}