Setup a NFS Server/Client on RaspberryPi 3
Setup the Server Side - Disks and Directories
Prepare the directories:
1 2 3 |
|
For demonstration, I will be using the same disk as my OS, but if you have other disks that you would like to mount, mount them like the following:
1 2 3 4 5 |
|
If you mounted the disk, and you would like to mount the disk on boot, we need to add it to our /etc/fstab
. We can get the disk by running either:
1 2 3 |
|
Populate the /etc/fstab
with your disk info, it will look more or less like:
1
|
|
Append rootdelay=10
after rootwait
in /boot/cmdline.txt
, then reboot for the changes to become active.
Setup the Server Side - Installing NFS Server
Install the NFS Server packages:
1
|
|
Configure the paths in /etc/exports
, we need to uid gid for the user that owns permission that we need to pass to the NFS Client. To get that:
1 2 |
|
Setup our path that we would like to be accessible via NFS:
1
|
|
If you would like to have open access:
1
|
|
Export the config, enable the services on boot and start NFS:
1 2 3 4 5 6 7 |
|
Setup the NFS Client
On the client install the NFS Client packages:
1
|
|
Create the mountpoint of choice and change the ownership:
1
|
|
Setup the /etc/idmapd.conf
to match the user:
1 2 3 |
|
Mount the NFS Share to your local mount point:
1
|
|
Enable mount on boot via /etc/fstab
:
1
|
|