This is an old revision of the document!
NFS server
Used version
- Ubuntu 10.04 x86 in vmware player
- Ubuntu 12.04 x86 in vmware player
Installation
user@ubuntu:~$ sudo apt-get install nfs-kernel-server
Configuration
To access rootfs via NFS the following line must be added to the file /etc/exports
.
<Rootfs path on host system> <permitted IPs>/<subnet>(<comma separated options>)
For example
/opt/eldk-4.2/ppc_4xx 192.168.0.0/255.255.0.0(rw,no_root_squash,sync,no_subtree_check)
This path must match the variable rootpath
of the U-Boot on the target. This variable is added to the boot parameter nfsroot=
and defines the source for the NFS rootfs.
<note> After this file was changed the NFS server should be restarted:
user@ubuntu:~$ sudo service nfs-kernel-server restart
</note>
Test the configuration
With the command showmount
you can see the exported directories if the NFS client programs (sudo apt-get install nfs-common
) are installed on the system.
user@ubuntu:~$ showmount -e 192.168.0.5 Export list for 192.168.0.5: /opt/eldk/ppc_6xx 192.168.0.0/255.255.0.0
Troubleshooting
If the root file system cannot be mounted via NFS the log file of the NFS server should be checked. In Ubuntu the log is written to the file /var/log/syslog
.
An example of such a log entry looks like:
Nov 14 02:30:57 ubuntu mountd[8667]: refused mount request from 172.21.10.157 for /opt/ltib_iMX35/ltib/rootfs (/opt/ltib_iMX35/ltib/rootfs): unmatched host
In this case the server rejects the connection because the host does not match the one in the file /etc/exports
.
Configuration firewall / host system (NAT)
NFS uses port TCP 2049. The configuration of Windows-XP as host system is descibed here: vm.