1.1.2.1 NFS Debian 10 - sivasmartins/Documentos GitHub Wiki

Debian 10 - Server Install

> apt install nfs-kernel-server -y

vim /etc/exports

# Network
/media/nfs		192.168.1.0/24(rw,sync,no_subtree_check)
# Specific IPs
/media/nfs		192.168.1.10(rw,sync,no_subtree_check) 192.168.1.11(ro,sync,no_subtree_check)

Permitions

ro: read only
rw: read and write
no_root_squash: remote “root” users
subtree_check: a directory is exported instead of an entire filesystem
no_subtree_check: the host should not check the location
sync: this just ensures that the host keeps any changes uploaded to the shared directory in sync
async: ignores synchronization checks in favor of increased speed

Restart

systemctl restart nfs-kernel-server

Debian 10 - Client Install

> apt install nfs-common

Manual mount

> mount -t nfs4 192.168.1.10:/remote/share /local/share
# /remote/share: path on server | /local/share: local folder

Automatic mount

vim /etc/fstab

#Startup
192.168.1.10:/remote/share	/local/share	nfs4	defaults,user,exec	0 0

#After Startup
192.168.1.10:/remote/share	/media/share	nfs4	defaults,user,exec,noauto	0 0

> mount -a