How to mount your host computer from an Embedded SBC running Linux

|

Instead of using some other file transfer tool to move files from and to your embedded board it's much easier to use the Network File System (NFS). Here are the few easy steps needed to get this working.


Step 1 Install your network cards and give them IP address. You can use ifconfig for this, for example ifconfig 192.168.42.1 netmask 255.255.255.0. The IPv4 address use 32-bit integers so the address are broken down to 11111111.11111111.11111111.11111111. Each section consisting of 8-bits. Part of the address is used as the network identifier and the other used as the host identifier, so 192.168.42.2 with a netmask of 255.255.255.0 is on 192.168.42 network with the host ID 2 and the broadcast address would be 192.168.42.255. There's more to network address, but we don't need to use it here.

Step 2 Ping your embedded board after the network addresses are setup on both computers. This should have been easy, but if there is a problem you could have a device connected to the network that is using the same network address as one of computers we just setup, like a modem for example. Make sure your drivers are loaded using lsmod and verify the network address on both machines, they must be using the same network identifier and the host number must be unique on the network.

Step 3 The Network File System ( NFS ) must be installed on the host machine and the embedded board must have the NFS client installed in order to mount the host machine. Check for the client software on the embedded board by typing 'mount' at the shell prompt or try 'find usr pipe-symbol grep mount' if the later does not work. If you cannot find it like this download and install it. I don't cover the install here, but it is not difficult.

Step 4 Add the names of your machines to the /etc/hosts file using the format given in the same as an example. These are the names that will be used by NFS to identify your machine when you mount the host machine. Now ping your machines using the names you just put in the host file.

Step 5 After NFS is installed and working, make a directory available through the exports file. The export file will look something like this /mount/sbc/ arm_sbc(rw,no_root_squash). The directory shown here may not exist on your computer, you can create your own directory to export. Make sure the permissions on the directory are correct so, the SBC board can mount the shared directory. You can mount as root, try mount host_pc:/mnt/sbc /mnt/host where host_pc is the name you gave to your host computer in the host file and /mnt/sbc is the directory you created on your host machine and /mnt/host is were you are going to mount the shared directory.

You can add your host computer name to the export file for trouble shooting, if you can't get the SBC to mount try to mount the host computer on itself through its network address. You my get some errors about the version of mount being different or something like that but you should still mount successfully from the embedded board. If you have problems check the mount every time you issue the command to see if you mounted successfully. Sometimes the terminal messages can make you think you did not mount when you actually did. Use the log file under /var/log on the host machine to get the messages from the NFS server, use tail -f /var/log were log is the log file the NFS server writes to. Also use tcpdump to monitor the NFS client and server communications, you may notice problems with your machine name resolution.

0 comment:

Post a Comment

 

©2009 computer technology World | Template Blue by TNB