Skip to content

How to set up a NFS root filesystem for embedded Linux development

Although ssh and friends work really well for embedded systems, occasionally you want to set up a NFS root for development.  One of the scenarios where nfsroot is useful is if you are making a lot of rootfs changes, and you don’t want to spend the time to reprogram the flash on the target system.  Fortunately, the Linux kernel includes complete support for NFS root, and does not require any userspace changes.  This setup assumes the following:

  1. the target system has Ethernet support built into the kernel
  2. the target system is on the same network as a Linux workstation
  3. said network includes a DHCP server

This configuration emphasises “simple” and does not require you to spend 4 hours trying to get a bootp server configured on a test network.

Kernel Support

Make sure you have the following options turned on in the kernel:


Then, add the following to your kernel CMDLINE:

  • ip=dhcp root=/dev/nfs nfsroot=<nfs server IP>:/path/to/nfsroot

Workstation Setup

The following setup is for Ubuntu.

apt-get install nfs-user-server

(edit /etc/exports to contain something like the following)


/etc/init.d/nfs-user-server restart

If you are using OpenEmbedded, then instruct OE to generate a rootfs tar image, and extract to your nfsroot directory:

cd /path/to/nfsroot
sudo tar -xvf <path to OE images dir>/Angstrom-image...rootfs.tar

And the result

eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
Sending DHCP requests ., OK
IP-Config: Got DHCP answer from, my address is
IP-Config: Complete:
     device=eth0, addr=, mask=, gw=,
     host=,, nis-domain=(none),
     bootserver=, rootserver=, rootpath=
Looking up port of RPC 100003/2 on
Looking up port of RPC 100005/1 on
VFS: Mounted root (nfs filesystem) readonly.
Freeing unused kernel memory: 220k freed
Write protecting the kernel text: 2792k
Write protecting the kernel read-only data: 788k
INIT: version 2.86 booting