Using NFS Mounting to Copy Files

This page describes how to configure the DT7837 as an NFS client and a development Linux host computer as an NFS server so that the contents of a directory on the Linux computer are visible on the DT7837 module.  

Once mapped, you have local access on the DT7837 module to all files in the development computer's nfs exported subdirectory. This mapped file system is fully read-write by both devices. Any changes to the files in this tree by either the development computer or the DT78xx module are reflected immediately to the other end by NFS.

To set up NFS mounting, following these steps:

  1.  Set up the Linux development  host computer as an NFS server

  2.  Set up the DT7837 module as an NFS client
     

Notes:

References:

Set Up the Linux Development Host Computer as an NFS Server

On the Linux host computer, perform the following steps to set up the host computer as an NFS server:

  1. Install the required packages by entering the following command:

    # apt-get install nfs-kernel-server  

  2. Create an export file system by entering the following command. Note that in this example, the directory is named DT78XX-NFS but you can change it to a different name, if desired (remember to substitute your chosen name in all steps that follow!).

    # mkdir -p /export/DT78XX-NFS 

  3. Make sure the permissions for the exported directory are 777 by entering this command:

    # chmod 777 /export/DT78XX-NFS  

  4. Mount the directory that you want to map into the export file system using the following command. In this example, the DT78xx example directory under the TI SDK directory is mounted, and the TI SDK is installed under /opt/ti-sdk-am335x-evm-07.00.00.00:

    # mount --bind /opt/ti-sdk-am335x-evm-07.00.00.00/example-applications/dt78xx-examples /export/DT78XX-NFS  

  5. Edit the file /etc/default/nfs-kernel-server (use these steps as an example of editing future files):

    1. Open the file:

# vi /etc/default/nfs-kernel-server

    1. Verify that following entry in the /etc/default/nfs-kernel-server directory is either blank or "no"

 NEED_SVCGSSD="no"

    1. Save the file.

  1. Edit the file /etc/idmapd.conf, and ensure that the following lines are added to the file:

 Nobody-User = nobody
 Nobody-Group = nogroup

  1. Edit the file /etc/exports, and add the following line to the file, substituting the correct netmask for the 1.2.3 placeholder below (and in all steps that follow):

 /export/DT78XX-NFS 1.2.3.0/255.255.255.0(rw,sync,no_root_squash,no_subtree_check)

  1. Restart the NFS server by entering the following command:

# /etc/init.d/nfs-kernel-server restart

  1. Edit the file /etc/hosts, and add the following line to the file to allow the DT78xx module's IP address:

 rcpbind mountd nfsd statd lockd rquotad : 1.2.3.0/255.255.255.0 127.0.0.1

  1. Restart the NFS server a second time by entering this command:

# /etc/init.d/nfs-kernel-server restart

  1. Edit the file /etc/fstab, and add the following line (note the two trailing zeroes) to the file so that the exported file system is mounted automatically on boot-up:

 # DT78xx examples mapped for NFS
  /opt/ti-sdk-am335x-evm-07.00.00.00/example-applications/dt78xx-examples /export/DT78XX-NFS none bind 0 0

  1. Verify exports by entering this command

# showmount -e  

At this point, the development Linux host computer is prepared to serve the contents of the /opt/ti-sdk-am335x-evm-07.00.00.00/example-applications/dt78xx-examples subdirectory to any NFS client in the same subnet as the host. The next task is to set up an NFS Client on the DT78xx module, described below.

Set Up the DT78xx Module as an NFS Client

On the DT78xx module, perform the following steps to set up the DT78xx module as an NFS client:

  1. Install the NFS client by entering this command:

    # apt-get install nfs-common

  2. Make a mount point for the NFS drive mapped from the development computer by entering the following command (note that you can choose any directory name below):

    # mkdir /usr/local/dt78xx-nfs

  3. Mount the exported NFS drive using the following command. Note that the IP address 1.2.3.4 is the address of the Linux development host computer; substitute the correct IP address of the host computer for the 1.2.3.4 placeholder below and in all steps that follow:

    # mount -t nfs 1.2.3.4:/export/DT78XX-NFS /usr/local/dt78xx-nfs  

  4. List the /usr/local/dt78xx-nfs directory using the following command. It should list the file system that exists in the Linux development host computer's exported directory ( /opt/ti-sdk-am335x-evm-07.00.00.00/example-applications/dt78xx-examples):

    # ls -l /usr/local/dt78xx-nfs

  5. (Optional)  Edit the file /etc/fstab, and add the following line (note the two trailing zeroes) so that the mapped filesystem is mounted automatically on boot-up:

 # nfs mount development PC mapped directory
  1.2.3.4:/export/DT78XX-NFS /usr/local/dt78xx-nfs nfs rw,hard,intr 0 0