PandaBoard NFS

From OMAPpedia

Jump to: navigation, search


[edit] What is NFS?

NFS stands for Network File System,  is a distributed file system protocol originally developed by Sun Microsystems in last century, allowing a user on a client computer to access files over a network in a manner similar to how local storage is accessed.

[edit] What is NFS-root?

In order to use a diskless system, it is necessary for the root filesystem to be present on a non-disk device. This may be an initramfs (see linux/Documentation/filesystems/ ramfs-rootfs-initramfs.txt), a ramdisk (see linux/Documentation/initrd.txt) or a filesystem mounted via NFS.

To allow your PandaBoard to mount the root filesystem over network, you should do the following things:

[edit] Enabling NFS-root capabilities on the PandaBoard

The following kernel options should be turned on:


[edit] Assign the IP address to the PandaBoard

The IP address could be assigned either dynamically or statically. If you are connecting the PandaBoard to the dedicated network card on your host, then probably dynamic IP (with DHCP daemon on the host) is the good idea. If you are connecting the PandaBoard to your office/home network where you already have the DHCP server, choose the dynamic IP address as well. Or, you can assign the IP address to your PandaBoard statically. BIG FAT WARNING – do not run your own DHCP server if you already have one in the same network! Ask your sysadmin why :)

In the samples below, it is assumed that network interface that is connected to the PandaBoard has the IP address

[edit] Dynamic IP address – host configuration

Install the dhcp daemon, if you have not done this yet

sudo apt-get install udhcpd

Then, edit the /etc/udhcpd.conf file:

interface	eth2			# edit this!
option		router
option 		subnet
option 		domain local
option		lease 86400

...and /etc/default/udhcpd:


Now, start your dhcpd server:

sudo service udhcpd restart

[edit] Dynamic IP address – PandaBoard configuration

Add ip=dhcp to the kernel boot arguments. Probably, boot arguments are in “setenv bootargs” statement in your boot.scr.txt

[edit] Static IP address – host configuration

You have nothing to do on the host if you choose the static IP address to the PandaBoard

[edit] Static IP address – PandaBoard configuration

Add the following ip= parameter to kernel bootargs:

ip=<panda-ip>:<server-ip>:<gw-ip>:<netmask>:<host name>:eth0:off

For example,


Here eth0 means the interface on the PandaBoard that you are configuring, and “off” means that it will not be autoconfigured using DHCP or BOOTP (or even RARP)

[edit] Export the root filesystem from the host

Install the nfs-server, if you have not done this yet:

sudo apt-get install nfs-server

Then, create the exported directory, for example:

sudo mkdir -p /exports/panda

...and copy all rootfs content to it:

sudo cp -a /your/rootfs/content /exports/panda

Now, add the following line to the /etc/exports file:

/exports/panda        *(rw,sync,no_root_squash,no_subtree_check)

Done! Start the nfs-server and make sure that the rootfs is exported:

sudo service nfs-kernel-server restart
sudo exportfs -rv

[edit] PandaBoard configuration

The remaining part is to tell the PandaBoard that root is in the network rather than on some local device. To do this, add the following options to the bootargs:

root=/dev/nfs nfsroot=

That's all. Now compile your boot script and copy it to the 1st (FAT) partition of boot SD card.

[edit] Nothing works! Help!

If root does not get mounted and kernel panics, check the following things:

If nothing still works, send the request to help – and attach console output of your PandaBoard and kernel .config file.

[edit] Will this work for Android rootfs ?

Yes, this works – with some tricks and limitations. Stay tuned, I'll update this page.

Personal tools