# The kernel is trying to mount root via nfs for diskless operation on my Linksys NSLU2



## rusma (Aug 16, 2011)

Hello. 

I'm sooo close to a successful boot of 8.2-STABLE on my Linksys NSLU2  I've built the world and kernel (standard NSLU) as root, and installed them in a folder where nfsd can find them. I've got dhcpd/tftpd working a little. Here's what I do to boot:

power on
enter redboot (Ctrl+C)
in RedBoot prompt: ip -h 10.0.0.1 -l 10.0.0.3; load -b 0x200000 kernel-slug.nfs;go
the kernel boots for a while until it stops here:
	
	



```
uhub1: 2 ports with 2 removable, self powered
uhub0: 3 ports with 3 removable, self powered
uhub2: 5 ports with 5 removable, self powered
npe0: link state changed to UP
Received DHCP Offer packet on npe0 from 10.0.0.1 (accepted) (no root path)
Sending DHCP Request packet from interface npe0 (00:00:00:00:00:00)
Received DHCP Ack packet on npe0 from 10.0.0.1 (accepted) (got root path)
npe0 at 10.0.0.3 server 10.0.0.1 boot file kernel-slug.nfs
subnet mask 255.255.255.0 router 10.0.0.1 rootfs 10.0.0.1:/data1/nslu2 
Adjusted interface npe0
Trying to mount root from nfs:
NFS ROOT: 10.0.0.1:/data1/nslu2
```

To this point I've survived by following some guides regarding booting from the net, these are:
http://bsdimp.blogspot.com/2008/08/nslu2-support-committed-to-freebsdarm.html
http://wiki.freebsd.org/FreeBSDSlug
http://jdc.parodius.com/freebsd/pxeboot_serial_install_8.html
http://www.openbsd.org/faq/faq6.html#PXE
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-diskless.html

Here is the output of `# showmount -e`:
	
	



```
Exports list on localhost:
/data1/nslu2                       10.0.0.0
```

My /etc/exports look like this:
	
	



```
/data1/nslu2 -maproot=0 -network 10.0.0.0 -mask 255.255.255.0
```

I have a specific entry for the nslu2 in /usr/local/etc/dhcpd.conf:
	
	



```
host angrist {
#                       option root-opts code 130 = string; # NFS / mount options
                        hardware ethernet 00:00:00:00:00:00;
                        fixed-address 10.0.0.3;
                        next-server 10.0.0.1;
                        filename "kernel-slug.nfs";
                        option root-path "10.0.0.1:/data1/nslu2";
#                       option root-opts "nolockd";
                }
```
Note: The hardware ethernet is the real mac address of the npe0 on my slug (the hostname of my slug is angrist (a legendary weapon from The Silmarillion)).

dhcp/tftp is really working flawlessly up to the point where nfs would kick in, but it does not. Also, I've never really used nfs so this is a new thing to me (I'm a fairly new user). I really hope someone has an idea on this.


----------



## SirDice (Aug 16, 2011)

rusma said:
			
		

> My /etc/exports look like this:
> 
> 
> 
> ...


This seems to be missing the -alldirs directive. Not sure if it's really needed but it's mentioned in the FreeBSD article.


----------



## rusty (Aug 16, 2011)

Sorry for the off-topic but is there a reason for using a /24 netmask on a /8 subnet?


----------



## kpa (Aug 16, 2011)

The whole 10/8 network can be used for private addresses and there are no rules how it should be split or not split into smaller subnets. You can use whatever mask you want as long as it is /8 or narrower. A /24 usually is the most convinient for a small LAN.


----------



## rusty (Aug 17, 2011)

I see, thanks for the explanation.


----------



## SirDice (Aug 17, 2011)

rusty said:
			
		

> Sorry for the off-topic but is there a reason for using a /24 netmask on a /8 subnet?



The old class based subnetting went out the door many years ago.

http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing


----------



## rusma (Aug 18, 2011)

I have to get back to this later because I did some more soldering on the board to strengthen the 4-pin-male offset uart offset. It seems i got some extra solder where it should not be any ... have to get a desoldering tool and try to fix this first. 

I'm not very used to writing dhcp configs, so that may be the reason for the subnet being too small. I don't know really.


----------



## SirDice (Aug 18, 2011)

rusma said:
			
		

> I'm not very used to writing dhcp configs, so that may be the reason for the subnet being too small. I don't know really.


Don't worry, there's nothing wrong with it.


----------



## rusma (Aug 18, 2011)

Unfortunately, I can't get any life back to my NSLU2. It starts but nothing more. 

From now on I focus my "arm efforts" on the more powerful Sheevaplug. I'll try diskless booting.


----------

