nfs

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 21:02]
Stephane de Labrusse [Settings]
nfs [2020/12/21 18:42] (current)
Stephane de Labrusse [Usage]
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
  
 * Use the server UID/GID server **(access control by GID and IP)**  * Use the server UID/GID server **(access control by GID and IP)** 
- 
 In this mode the users of the remote client must be in the same GID that the owning group of the samba share. In this mode the users of the remote client must be in the same GID that the owning group of the samba share.
 You must add manually to all users the GID as a secondary group You must add manually to all users the GID as a secondary group
- 
 Any root users of any remote clients can overwrite this GID limitation, hence the option root squash to restrict the root power. Any root users of any remote clients can overwrite this GID limitation, hence the option root squash to restrict the root power.
- 
 In clear you have two access control (GID and IP) In clear you have two access control (GID and IP)
  
 * Lazzy mode **(access control by IP)** * Lazzy mode **(access control by IP)**
- 
 Uncheck the option above, then you don't need to set a second gid on users, the only access control is at the IP level Uncheck the option above, then you don't need to set a second gid on users, the only access control is at the IP level
- 
 If you want you can allow quickly a read access to all your local network (you must respect the gid if checked) If you want you can allow quickly a read access to all your local network (you must respect the gid if checked)
  
 ====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 86:
 * 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 93:
  
 <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 104:
 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**
  
 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  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+**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.  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+**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).  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===+====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 164: Line 158:
  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}}