NSLU2-Linux
view · edit · print · history

HowTo.LoadRootfsFromNFS History

Hide minor edits - Show changes to markup

November 19, 2007, at 04:37 PM by fcarolo -- removed false wikilink
Changed line 99 from:

linux nfs server (or -maproot on FreeBSDs? nfs server).

to:

linux nfs server (or -maproot on FreeBSDs nfs server).

November 17, 2007, at 12:32 PM by greg --
Changed lines 64-65 from:

cd / wget http://www.openembedded.org/repo/org.openembedded.oz354x/packages/nslu2-binary-only/unslung-rootfs/linuxrc

to:
 cd /
 wget http://www.openembedded.org/repo/org.openembedded.oz354x/packages/nslu2-binary-only/unslung-rootfs/linuxrc
November 17, 2007, at 12:32 PM by greg --
Added line 63:

(:cell:)

November 17, 2007, at 12:31 PM by greg -- added info for 6.8 beta
Added lines 57-98:

For the Unslung-6.8 beta firmware:

The linuxrc shipped with Unslung-6.8 beta does not support root file systems on nfs. So first you need to install a new linuxrc. Connect to the NSLU2 and execute the following commands:

(:table border=0 width=100% bgcolor=#eeffee:) cd / wget http://www.openembedded.org/repo/org.openembedded.oz354x/packages/nslu2-binary-only/unslung-rootfs/linuxrc (:tableend:)

Then you need to tell switchbox about the nfs root file system. Assuming that your nfs server is 11.22.33.44 and you exported /home/slugroot, the following commands will do it:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 echo "nfsrootloc=11.22.33.44:/home/slugroot" > /.nfsroot
 echo 'nfsrootopts="-o nolock"' >> /.nfsroot

(:tableend:)

Watch out for the quotes in the last command! It's different from the command used in version 4.x!

Now it's time to copy the root file system to the nfs mount:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 mount -o nolock 11.22.33.44:/home/slugroot /mnt/tmpmnt
 (cd / ; find . -print0 -mount | cpio -p -0 -d -m -u /mnt/tmpmnt)
 cd /mnt/tmpmnt
 rmdir dev
 rmdir var
 mv dev.state dev
 mv var.state var
 cd usr/bin
 rm ipkg
 ln -s ipkg-cl ipkg
 cd ../../etc
 rm motd
 ln -s motd-un motd

(:tableend:)

If you're getting errors while copying /dev.state to the nfs mount, you're probably using root_squash on your linux nfs server (or -maproot on FreeBSDs? nfs server).

February 23, 2006, at 11:07 AM by hepp -- corrected the turnup line(missins an -i)
Changed line 6 from:
  1. as described in turnup help, run turnup nfs <hostname>:<export_name>.
to:
  1. as described in turnup help, run turnup nfs -i <hostname>:<export_name>.
November 11, 2005, at 10:29 AM by hs -- typo
Changed lines 11-12 from:

Note that the NFS root will not be used if there is a file .recover in the exported directory (see /boot/nfs). OpenSlug may create this file in error conditions, or you may with to put it there to force a boot into flash.

to:

Note that the NFS root will not be used if there is a file .recover in the exported directory (see /boot/nfs). OpenSlug may create this file in error conditions, or you may wish to put it there to force a boot into flash.

October 21, 2005, at 09:22 AM by JimmyFergus --
Changed lines 1-2 from:

This is applicable to the Unslung-4.x family of firmware.

to:

For OpenSlug 2.7, on first Initialization

After installing the firmware, and running turnup init to set up the network:

  1. Ensure you have an NFS server running with an empty directory exported with the options rw,no_root_squash.
  2. as described in turnup help, run turnup nfs <hostname>:<export_name>.
  3. shutdown -r now. It should come up in the new nfs area.

Check that you are running from the NFS export by creating a file on the slug, and checking the exported directory on the exported machine.

Note that the NFS root will not be used if there is a file .recover in the exported directory (see /boot/nfs). OpenSlug may create this file in error conditions, or you may with to put it there to force a boot into flash.

For the Unslung-4.x family of firmware. To transfer the system to an NFS drive

June 20, 2005, at 06:12 PM by tman --
Changed lines 5-10 from:
 1/ a NFS Server and exported directory for the rootfs to be stored.
 2/ Using the web interface; fully configured network settings including gateway.

Then, you will need to copy the jffs2 rootfs to the new NFS rootfs. If your NFS Server is 11.22.33.44; the steps are similar to this on the nslu2.

to:
  1. a NFS Server and exported directory for the rootfs to be stored.
  2. Using the web interface; fully configured network settings including gateway.

Then, you will need to copy the jffs2 rootfs to the new NFS rootfs. If your NFS Server is 11.22.33.44; the steps are similar to this on the nslu2.

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

Changed lines 19-20 from:
to:

(:tableend:)

Added lines 23-24:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

Changed lines 27-29 from:
 OR
to:

(:tableend:)

Or

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

Changed lines 35-36 from:
to:

(:tableend:)

Changed lines 39-42 from:
 My fstab looks like this:
to:

My fstab looks like this:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

Changed lines 44-45 from:
to:

(:tableend:)

May 27, 2005, at 07:32 PM by gerald_clark --
Changed lines 27-28 from:
 touch .nfsroot
to:
 touch /.nfsroot
May 27, 2005, at 07:29 PM by gerald_clark --
Changed lines 21-24 from:
 cat > /.nfsroot
 nfsrootloc=11.22.33.44:/home/slugroot
 nfsrootopts=nolock
to:
 echo "nfsrootloc=11.22.33.44:/home/slugroot" > /.nfsroot
 echo "nfsrootopts=nolock" >> /.nfsroot

 OR

 echo "11.22.33.44:/home/slugroot /mnt nfs nolock 0 0" >> /etc/fstab
 touch .nfsroot
Changed lines 31-34 from:
to:
 My fstab looks like this:
 192.168.0.63:/home/link2 /mnt nfs rsize=4096,wsize=4096,intr,nolock,noatime,hard,nfsvers=2 0 0
February 24, 2005, at 11:28 AM by dyoung --
Changed lines 1-27 from:

Describe LoadRootfsFromNFS here.

to:

This is applicable to the Unslung-4.x family of firmware.

To prepare for this you will need to have setup a few things.

 1/ a NFS Server and exported directory for the rootfs to be stored.
 2/ Using the web interface; fully configured network settings including gateway.

Then, you will need to copy the jffs2 rootfs to the new NFS rootfs. If your NFS Server is 11.22.33.44; the steps are similar to this on the nslu2.

 mount -o nolock 11.22.33.44:/home/slugroot /mnt/tmpmnt
 (cd / ; find . -print0 -mount | cpio -p -0 -d -m -u /mnt/tmpmnt)
 cd /mnt/tmpmnt
 rmdir dev
 rmdir var
 mv dev.state dev
 mv var.state var

Then you'll need to tell switchbox that you wish to use the nfsroot option.

 cat > /.nfsroot
 nfsrootloc=11.22.33.44:/home/slugroot
 nfsrootopts=nolock

Other nfs options might be desireable, but this is the bare minimum required to make it work.

view · edit · print · history · Last edited by fcarolo.
Based on work by greg, hepp, hs, JimmyFergus, tman, and gerald_clark.
Originally by dyoung.
Page last modified on November 19, 2007, at 04:37 PM