Brad Stewart

What is a NSF (Network File System)? -- Part 2

Discussion created by Brad Stewart Employee on Jun 17, 2010

CLIENT SETUP

 

First thing to do is check if you have a connection.  On the client, ping the host over Ethernet.

 

            $ ping <host_ip_address>

 

Where host_ip_address is the address of your host you found by typing ifconfig on the host (192.168.69.140 in my case).

 

With a successful connection, you now need to install the client software on the i.MX51.  There is a chance it’s already running.  You can test this by typing

 

$ rpcinfo –p <host_ip_address>

 

You should see the same printout that was displayed on the host when you typed rpcinfo –p.

 

If you DO NOT get the same information, you need to install the nfs client software.  Make sure the i.MX51 is connected to the Internet.  Then install nfs-common program by typing

 

$ sudo aptitude install nfs-common

 

note: if this doesn’t work, you can try this

 

$ sudo aptitude download nfs-common

$ sudo aptitude install nfs-common

 

After this, you may need to reboot the client.

 

With the client software up and running, you are ready to mount the host file system onto the client.  First, determine the mount point.  This could be directory somewhere on your file system.  In my case, I created a directory called /home/ubuntu/sysroot in user-space.

 

You can create this directly by typing

 

$ cd /home/ubuntu

$ mkdir sysroot

 

Tip:  You can use the “Nautilus” program to create folders.  Nautilus is the Ubuntu file manager (found by clicking “Places” at the top of the screen then click on “Home Folder” then right-click to create a new folder—just like with Windows.  Note that sudo is not needed as you are creating a directory in the user-space (home) and not in the root file system. 

 

So to mount, you use the format “mount –t nfs <host_ip_address>:remote_location local_location”, or in my case

 

$ sudo mount –t nfs 192.168.69.140:/home/brad /home/ubuntu/sysroot

 

Note the space between …/brad/ and /home…  This is very important!

 

The “-t nfs” tells Linux that you are mounting a type nfs file system.

 

You can mount to the root file system, for example, /mnt/nfs, where “nfs” is a directory you created using “sudo mkdir /mnt/nfs”.  But for general use, I prefer to mount to the home directory.  That way, you can use the Nautilus GUI to move, copy, delete, etc, as this is considered user space.  Plus, as an added benefit, when you mount to user space, Ubuntu will place an icon on the desktop showing you the mounted system (just like when you insert a MMC card).  And it shows up in the left panel of Nautilus.  Sweet.

 

To un-mount (remove) the remote file system, simply type

 

$ sudo umount /home/ubuntu/sysroot

 

The icon should then disappear from the desktop.

 

TIP:  If you have the screen saver enabled in Ubuntu, it can shut down the connection.  I recommend you set the SystemàPreferencesàScreensaver to the maximum idle time and uncheck “Activate screen saver when computer is idle”

 

TIP:  For Freescale employees:  If you are behind the Freescale firewall you will need to export the http proxy on the client and host.

 

$ export http_proxy=http://wwwgate0.freescale.net:1080

 

 

To summarize:

 

1.      Install nfs server on host (if not there)

2.      Edit /etc/exports to tell the host what directories to share.

3.      Restart the host nfs server.

4.      Install nfs client on iMX (if not there)

5.      Create a mount point in user-space (a directory in /home) on the client.

6.      Mount the server to the client mount point on the client.

 

Enjoy.

Outcomes