NFS Server

From BlueWiki

Jump to: navigation, search

If you want to mount the root file system on your board via NFS, you need to set up an NFS server on your workstation. It is very comfortable during development, since you can access the target's file system locally on your PC.

Install an NFS server

The following is tested on Ubuntu 9.04 and 10.04.

  • Install the package nfs-kernel-server.
  • Example configuration file /etc/exports:
# /etc/exports: the access control list for filesystems which may be exported
#		to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
#
/tftpboot/rootfs-mx6/ *(rw,no_root_squash,sync,no_subtree_check)
/tftpboot/rootfs-mx53/ *(rw,no_root_squash,sync,no_subtree_check)

The rootfs-xxx directories are symbolic links to the real directory containing the embedded target's root file system. E.g., for i.MX6, this symlink is created with the command

cd /tftpboot
ln -s /home/bluetechnix/imx/6/ltibinstall/ltib/rootfs rootfs-mx6

For each root directory you want to export via NFS, you have to add 1 entry to this configuration file. Of course you do not need to use a symbolic link; you can also insert the full path. But remember: You have to specify the full path on the target's kernel command line!

If you change the /etc/exports configuration file, or the symbolic links, you have to restart the NFS server afterwards:

sudo /etc/init.d/nfs-kernel-server restart
Personal tools