How to mount network file system (NFS) on SP7021

The aim of the document is to illustrate how to mount network file system (NFS). That is, mount a remote file folder which is exported by NFS server in remote host. Please follow the following steps.

1. Install NFS server

To mount a folder-system from a remote folder, you need to install a NFS server in your Linux PC or server. There are five sub-steps to complete this:

First, use apt command to install NFS server. For example, install package nfs-kernel-server by issuing command:

wells@wells-linux:~/q628/sdc$ sudo apt install nfs-kernel-server

Second, modify NFS configuration file, /etc/exports, to export the folders for NFS service.

/home/nfs/aaa 192.168.1.0/24(rw,no_subtree_check,no_root_squash)

where 192.168.1.0/24 is address of sub-net. Adding the line listed above will create the NFS share folder, /home/nfs/aaa.

Third, notify the NFS sever that the settings has changed by issuing command:

wells@wells-linux:~/q628/sdc$ sudo exportfs -a -v exporting 192.168.1.0/24:/home/nfs/aaa

where “-a” means export all folders listed in the configuration file. “-v” means be verbose.

You can use showmount command to list folders which have been exported by NFS server. For example, issue command as:

where “-e” means show export list of NFS server.

Finally, re-start NFS server by issuing commands:

2. Up net interface

Use ifup command to turn on (up) the net interface eth0. Issue command as:

udhcpc gets IP addresses of localhost (itself), gateway and DNS server. In this example, IP address of localhost is 192.168.0.101.

Please skip this step if your net interface has been up.

3. Mount network file system (file folder exported by NFS)

Use mount command to mount network file system. Issue command as:

where “-t nfs” means mount network file-system. “-o nolock” means does not lock file system. This is necessary when you are using Busybox because Busybox does not support portmap and cannot support 'lock' function. “192.168.0.100“ is IP address of NFS server. “/home/nfs/aaa“ is folder exported by NFS. “/mnt“ is mount point.

Refer to report of ll command for the contents of remote file-system mounted on /mnt:

Refer to report of df command for remote file-system mounted on /mnt: