Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
home_server:home_server_setup:other_services:nfs [2022-01-16 Sun wk02 11:21] baumkphome_server:home_server_setup:other_services:nfs [2024-10-20 Sun wk42 15:20] (current) – [NFS Client] baumkp
Line 1: Line 1:
-{{tag>linux debian ubuntu nfs fstab server}}+{{tag>linux debian nfs fstab server}}
 ======NFS====== ======NFS======
 There are a lot of resources online for NFS (Network File System).  Nevertheless I decided to place my notes here to help me with my configuration, as there are a number of nuances that such notes will potentially assist with in the future. Sadly a number of resources I use seem out of date, not updated and/or possible subject to disappearance. There are a lot of resources online for NFS (Network File System).  Nevertheless I decided to place my notes here to help me with my configuration, as there are a number of nuances that such notes will potentially assist with in the future. Sadly a number of resources I use seem out of date, not updated and/or possible subject to disappearance.
Line 11: Line 11:
   *die.net [[https://linux.die.net/man/5/exports|exports(5) - Linux man page]]   *die.net [[https://linux.die.net/man/5/exports|exports(5) - Linux man page]]
   *[[https://www.golinuxcloud.com/unix-linux-nfs-mount-options-example/|NFS mount options | NFS exports options | Beginners Guide]]   *[[https://www.golinuxcloud.com/unix-linux-nfs-mount-options-example/|NFS mount options | NFS exports options | Beginners Guide]]
 +  *[[https://www.quora.com/What-are-the-differences-between-bind-mounts-and-symlink-on-Unix|What is a bind mount?]]
 +  *[[https://www.quora.com/What-are-the-differences-between-bind-mounts-and-symlink-on-Unix|What are the differences between bind mounts and symlink on Unix?]]
 +  *[[https://www.techtarget.com/searchenterprisedesktop/definition/Network-File-System|NFS]]
 +  *[[https://shape.host/resources/how-to-set-up-and-configure-an-nfs-server-on-debian-12|How to Set Up and Configure an NFS Server on Debian 12]]
 +  *[[http://linux-nfs.org]]
  
 Some other interesting nfs related commands: Some other interesting nfs related commands:
Line 19: Line 24:
 ---- ----
 =====NFS Server===== =====NFS Server=====
-  *''sudo apt install nfs-kernel-server'' to install+  *''sudo apt install nfs-kernel-server nfs-common'' to install
   *Create share directories on host ''sudo mkdir -p /export/storage'' (-p also creates higher level directories if necessary.)   *Create share directories on host ''sudo mkdir -p /export/storage'' (-p also creates higher level directories if necessary.)
 ''sudo vim /etc/exports'' - edit the exports file as required ''sudo vim /etc/exports'' - edit the exports file as required
Line 52: Line 57:
 </code> </code>
  
-The base server configurations options are given in: ''sudo vim /etc/default/nfs-kernel-server''.  //However the current base options meet our needs and do not need to be modified.//+The base server configurations options are given in: ''sudo vim /etc/default/nfs-kernel-server''.   
 +  * Add or modify the following to allow only NFSv4: 
 +     * ''%%RPCNFSDOPTS="-N 2 -N 3"%%'' 
 +     * ''%%RPCMOUNTDOPTS="--manage-gids -N 2 -N 3"%%''
  
-To apply configuration changes ''sudo systemctl restart nfs-server.service''+The NFS configuration file ''sudo vim /etc/default/nfs-common'': 
 +  * Add or modify the following: 
 +    *''%%NEED_STATD="no"%%'' 
 +    *''%%NEED_IDMAPD="yes"%%''
  
 +To apply configuration changes: ''sudo systemctl restart nfs-server.service''
 +
 +''sudo cat /proc/fs/nfsd/versions'' to check the server supported running versions
  
 =====NFS Client===== =====NFS Client=====
Line 66: Line 80:
   *<fs smaller>NEED_STATD=no :(default) we do not need to change the standard port number used </fs>   *<fs smaller>NEED_STATD=no :(default) we do not need to change the standard port number used </fs>
   *<fs smaller>NEED_GSSD=no  :(default) we do not use kerebos security</fs>   *<fs smaller>NEED_GSSD=no  :(default) we do not use kerebos security</fs>
-  *<fs smaller>NEED_IDMAPD=no:(default) we do not need to map gid and uid with names </fs>+  *<fs smaller>NEED_IDMAPD=no :(no default) we do not need to map gid and uid with names </fs>
  
 Mounting the nfs client manually: Mounting the nfs client manually:
-  *''sudo mount -t nfs -o rw,vers=4 192.168.1.5:/export/storage /mnt/storage'' to mount just the specific directory.+  *''sudo mount -t nfs -o rw,vers=4 192.168.1.5:/storage /mnt/storage'' to mount just the specific directory.
   *''sudo mount -t nfs -o rw,vers=4 192.168.1.5:/export /mnt'' to mount all the defined exports.   *''sudo mount -t nfs -o rw,vers=4 192.168.1.5:/export /mnt'' to mount all the defined exports.
   *''sudo unmount /mnt/storage'' to unmount   *''sudo unmount /mnt/storage'' to unmount