learnings

NFS server

1. Install

Arch based (Manjaro)

$ sudo pacman -S nfs-utils

Debian based (Ubuntu)

$ sudo apt install nfs-kernel-server

2. Configure

Create (or choose folder for share)

$ mkdir ~/shared

Change configuration file

$ vim /etc/exports
# add the following line, where <user> is a user folder
/home/<user>/shared *(rw,sync,no_subtree_check,no_root_squash)

To learn more about exports file, read man exports

3. Enable and start NFS

Arch based (Manjaro)

$ sudo systemctl enable nfs-server
$ sudo systemctl start nfs-server

Debian based (Ubuntu)

$ sudo systemctl enable nfs-kernel-server
$ sudo systemctl restart nfs-kernel-server

NFS client

1. Install

Arch based (Manjaro)

$ sudo pacman -S nfs-utils

Debian based (Ubuntu)

$ sudo apt install nfs-common

2. Configure

Create client mount point

mkdir ~/remote_share

Mount remote NFS

sudo mount -t nfs server_ip:/shared ~/remote_share

Note, on Arch based distros, you need to start (and optionaly enable) nfs client:

# On Arch
$ sudo systemctl enable nfs-client.target
$ sudo systemctl restart nfs-client.target

Optional: persistent mount

Fill the /etc/fstab file with the following

<server_ip>:/home/<user>/shared ~/remote_share  nfs  defaults,timeo=900,retrans=5   0 0

Replace <server_ip> and <user> with appropriate values.