Setting Up NFS
The objective is to set up NFS for Open MPI and development use. There will be one device being the server and all the others being the clients.
Prerequisites
- Set the IP of the server device to be
192.168.0.100
in the router. - Server and client devices are in the same local area network. IP ranges from
192.168.0.1
to192.168.0.254
.
Set Up NFS (Automatic)
Use the script.
Set Up NFS (Manual)
First, switch the workplace to the Jetson devices by either ssh
or IO devices.
Install on Server
Install nfs-kernel-server
for server by running:
sudo apt-get update
sudo apt-get install nfs-kernel-server
Install on Client
Install nfs-common
for server by running:
sudo apt-get update
sudo apt-get install nfs-common
For more details, see Setting Up NFS.
Static Post-Configuration
First, switch the workplace to the Jetson devices by either ssh
or IO devices.
Server
- Make sure the directory
/home/nvidia/cloud
exists. - Set the file content
/etc/exports
on the server:/home/nvidia/cloud 192.168.0.0/24(rw,sync,no_subtree_check,no_root_squash)
- Run the following for the changes to take effect:
sudo exportfs -ra sudo service nfs-kernel-server restart
Client
- Make sure the directory
/home/nvidia/cloud
exists. - Set the file content
/etc/fstab
on the client:192.168.0.100:/home/nvidia/cloud /home/nvidia/cloud auto noauto,x-systemd.automount 0 0
- Run the following for the changes to take effect:
sudo mount -a
NOTE: mount -a
might not work, you should reboot the system.
Combining options noauto
and x-systemd.automount
is a trick to make Systemd not to set up mount point on boot, instead do it later when trying to access.
Restart the machines to see whether the configuration works. Make sure the server is ready before restarting the clients. Both server and client mount will be ready after each machine startup.
Uninstall
Run the following to uninstall NFS:
sudo apt-get --purge autoremove nfs-kernel-server
sudo apt-get --purge autoremove nfs-common
Test
See mount information on a server:
showmount -e
It should print a line with:
/home/nvidia/cloud 192.168.0.0/24
See mount information on a client:
mount | grep /cloud
It should print a line with:
systemd-1 on /home/nvidia/cloud type autofs (rw,relatime,...
Troubleshooting
- The server doesn't mount the filesystem:
- Make sure the primary IP address is as described in Prerequisites by running:
ifconfig
- The client doesn't mount the filesystem:
- Make sure you follow Prerequisites.
- Run NFS command manually to check how things fail:
mount 192.168.0.100:/home/nvidia/cloud /home/nvidia/cloud
- My filesystem hangs/freezes after client tries to mount/My system won't boot!
- I found out it's caused by disconnected network when client tries to mount. Still not sure what causes it. Be sure the Ethernet connection is up before trying to mount.