This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ~~NOTOC~~ ====== NFS server ====== ===== Tested with the following operating systems ===== * Ubuntu 10.04 x86 in VMware Player * Ubuntu 12.04 x86 in VMware Player * Ubuntu 14.04 x86_64 in VMware Player * Ubuntu 16.04 x86_64 in VMware Player ===== Installation ===== \\ <code bash> user@ubuntu:~$ sudo apt-get install nfs-kernel-server </code> \\ ---- ===== Example Configuration for NFS boot ===== \\ Create a directory on the host root filesystem. <code bash> user@ubuntu:~$ sudo mkdir /nfs user@ubuntu:~$ sudo chmod 777 /nfs </code> Extract the content of root.tgz to your nfs directory.\\ root.tgz is located in: * BSP download archive provided by TQ-Systems e.g. (TQMxx.BSP.SW.BIN.xxxx.tgz\TQMxx.BSP.SW.BIN.xxxx.tar\root.tgz) * After building the BSP sources with PTXdist e.g. (../TQMxx-BSP-REV.xxxx/platform-MBxx/images/root.tgz) <code bash> user@ubuntu:~$ cd /nfs user@ubuntu:~$ sudo tar -xvf ~/workspace/TQMaxx-BSP-REV.xxxx/platform-MBaxx/images/root.tgz </code> Next step is to configure the ''/etc/exports'' file. Create an entry that contains the path to your nfs folder created above. <code> <path/to/your/nfs/directory> <permitted IPs>/<subnet>(<comma separated options>) </code> ++++For example| <code> /nfs 192.168.0.0/255.255.0.0(rw,no_root_squash,async,no_subtree_check) </code> ++++ <WRAP round important> This path must match the U-Boot environment variable ''rootpath'' on the target and defines the source for the NFS rootfs. </WRAP> <WRAP round info> After the /etc/exports file was modified the NFS server need to be restarted: <code bash> user@ubuntu:~$ sudo service nfs-kernel-server restart </code> </WRAP> ---- ===== Test the configuration ===== \\ With the command ''showmount'' you can see the exported directories. <code bash> user@ubuntu:~$ showmount -e localhost Export list for localhost: /nfs 192.168.0.0/255.255.0.0 </code> =====Related Links===== \\ * [[en:tftp|How to setup a TFTP Server on your Host Computer]] * [[en:general_information:tutorial:nfs_boot|Using NFS boot]] ===== 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: <code> 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 </code> In this case the server rejects the connection because the host does not match the one in the file ''/etc/exports''. ===== Sources ===== \\ * https://help.ubuntu.com/community/SettingUpNFSHowTo * [[http://www.denx.de/wiki/view/DULG/SystemSetup#Section_4.8.|http://www.denx.de/wiki/view/DULG/SystemSetup#Section_4.8.]] * http://www.centos.org/docs/5/html/Deployment_Guide-en-US/ch-nfs.html Last modified: 2022/08/04 15:02