Changes

Jump to navigation Jump to search
844 bytes added ,  17:01, 18 October 2018
Line 23: Line 23:  
/etc/exports
 
/etc/exports
 
  # Save all files with user:group = nobody:nogroup
 
  # Save all files with user:group = nobody:nogroup
  /home/client1          192.168.0.101(rw,sync,no_subtree_check)
+
  /home/client1          192.168.0.0/24 (rw,sync,no_subtree_check)
 
  # Preserve files ownership and permissions (no_root_squash allows root to access folder)
 
  # Preserve files ownership and permissions (no_root_squash allows root to access folder)
  /var/www        192.168.0.101(rw,sync,fsid=0,crossmnt,no_subtree_check,no_root_squash)
+
  /var/www        192.168.0.101/32 (rw,sync,fsid=0,crossmnt,no_subtree_check,no_root_squash)
    
Restart the nfs server
 
Restart the nfs server
Line 33: Line 33:  
== Install ==
 
== Install ==
 
  sudo apt install nfs-common
 
  sudo apt install nfs-common
 
+
== List available exports on NFS server ==
 +
sudo showmount -e 192.168.0.103
 
== Mount nfs volume ==
 
== Mount nfs volume ==
 
=== Create a directory to mount the volume ===
 
=== Create a directory to mount the volume ===
Line 44: Line 45:     
=== NFS Volume At Boot Time ===
 
=== NFS Volume At Boot Time ===
 +
==== via /etc/fstab ====
 
  sudo nano /etc/fstab
 
  sudo nano /etc/fstab
 
/etc/fstab
 
/etc/fstab
Line 51: Line 53:  
Mount  
 
Mount  
 
  mount -a
 
  mount -a
 +
 +
==== via SystemD ====
 +
sudo apt-get install nfs-client
 +
sudo modprobe nfs
 +
sudo echo NFS | tee -a /etc/modules
 +
 +
sudo nano /etc/systemd/system/mnt-things.mount
 +
* The file must match the mount path replacing '/' by '-'
 +
* If the path has '-' replace them with '\\x2d'
 +
* Example: /var/lib/transmission-daemon/downloads/HM_30 ---> var-lib-transmission\\x2ddaemon-downloads-HM_30.mount
 +
content:
 +
<nowiki>[Unit]
 +
Description=Things devices
 +
After=network.target
 +
 +
[Mount]
 +
What=172.16.24.192:/mnt/things
 +
Where=/mnt/things
 +
Type=nfs
 +
Options=_netdev,auto
 +
 +
[Install]
 +
WantedBy=multi-user.target</nowiki>
 +
 +
Start mount service
 +
systemctl daemon-reload
 +
systemctl start mnt-media.mount
 +
systemctl status mnt-things.mount
 +
systemctl enable mnt-media.mount

Navigation menu