# Diskless client nfs? difficulties

## trigggl

I am configuring one computer (orthrus) as a diskless client server and am slowly moving past miscellaneous hurdles.  Naturally, it's hard to keep wikis updated as new changes to services come along.  Also, the more simple you try to make something, the harder it seems to be to find a clear example of what you want to do.  

I followed allong with the Diskless nodes - Wiki as best I could, but not quite there, yet.

Here's what I want to do:

server - orthrus (192.168.35.6 :Cool: 

targeted slave - inspiron (192.168.35.53)

I'm not trying to do a dhcp server.  I just want to use these two addresses.  So far, I seem to have gotten the master (orthrus) configured well enough to hear the slave and tell it who it is.  I've even managed to get the kernel sent to the slave and mostly booted up.  I don't think it is actually managing to connect to the nfs root folder, though it's requesting it and the syslog of orthrus shows that it's being requested. 

 *Quote:*   

> Jun 12 16:50:14 orthrus in.tftpd[25982]: RRQ from 192.168.35.53 filename pxelinux.cfg/default 
> 
> Jun 12 16:50:14 orthrus in.tftpd[25983]: RRQ from 192.168.35.53 filename kernel-4.1.15-gentoo-r1-inspiron 
> 
> Jun 12 16:50:21 orthrus dhcpd: DHCPDISCOVER from 00:1d:09:8a:8d:a7 via enp4s0
> ...

 

Once it gets to this point, this is what is shown on the slave's monitor.

 *Quote:*   

> IP-Config: Got DHCP answer from 192.168.35.68, my address is 192.168.35.53
> 
> IP-Config: Complete:
> 
>      device=eth0, hwaddr=<slave's_mac_address>, ipaddr=192.168.35.53, mask=255.255.255.0, gw=192.168.35.1
> ...

 

Perhaps this is a dhcpd.conf file misconfiguration (wouldn't surprise me).  Here are what I believe are the relevant files:

/etc/dhcp/dhcpd.conf

```
# Use this to enble / disable dynamic dns updates globally.

ddns-update-style none;

# Assume one default gateway for IP traffic will do

option routers 192.168.35.1;

# Provide DNS info to clients

option domain-name-servers 192.168.35.1;

#option domain-name "mydomain.com";

# Specify the TFTP server to be used

next-server 192.168.35.68;

# No service will be given on this subnet, but declaring it helps the 

# DHCP server to understand the network topology.

subnet 192.168.35.0 netmask 255.255.255.0 {

   host inspiron {

     hardware ethernet 00:1d:09:8a:8d:a7;

     fixed-address 192.168.35.53;

     filename "pxelinux.0";

     option root-path "192.168.35.68:/diskless/192.168.35.53";

   }

}
```

If I include the other ethernet card, it will sometimes run scripts off of that, but only after eth0(192.168.35.53) starts the kernel.  Perhaps the motherboard's card can only do nfs v2?  It looks like eth1(192.168.35.54) can mount the root-path, but can't apparently mount anything in /etc/fstab.  When I do manage to get a login prompt, it's the address of eth1 as the hostname and there is no ability to use the USB keyboard or mouse.  I do get a message on the screen when I pull and plug them back in...same with the ethernet wire on eth1.

 *Quote:*   

> Jun 12 21:37:19 orthrus in.tftpd[3834]: RRQ from 192.168.35.53 filename pxelinux.cfg/default 
> 
> Jun 12 21:37:19 orthrus in.tftpd[3835]: RRQ from 192.168.35.53 filename kernel-4.1.15-gentoo-r1-inspiron 
> 
> Jun 12 21:37:29 orthrus dhcpd: DHCPDISCOVER from 14:cc:20:04:5d:ad via enp4s0
> ...

 

Anyways, it's late and I'll try to clean up this posting after I've slept.

(maybe I can just simplify by doing a full install at /diskless/192.168.35.53/)

----------

## NeddySeagoon

trigggl,

The diskless node gets the kernel and perhaps the initrd from the server. That bit works.

Which version of nfs are you using to serve the rootfs?

I have had nfs v3 working but was defeated by nfs v4.  Only nfs v3 is enabled.  My pxelinux.cfg/default is

```
default New

prompt 0

timeout 300

ONTIMEOUT New

MENU TITLE Startup Menu

LABEL Radeon

        MENU LABEL 3.7.1-Gentoo

        KERNEL /3.7.1-gentoo

        APPEND ip=dhcp root=/dev/nfs rootfstype=nfs nfsroot=192.168.100.55:/var/mediaplayer rootpath=/var/mediaplayer radeon.audio=1

        TEXT HELP

        Choose this if you don't know what to do, or just wait  

        ENDTEXT
```

You can add in a parameter to the APPEND to tell it the nfs version to use if there is a choice.  Hmm 3.7.1-gentoo, that was a while ago.

----------

## trigggl

Since my troubles were apparently NFS related and I had the kernel loading part working, I installed a stage_3 and quit trying to connect to anything besides "/" by way of NFS.  I'm assuming my problem was rc based.  I probably had a chicken/egg problem being an nfs client, but not being able to connect to where important files were needed.  Maybe after getting a minimal install put together, can work my way back to connecting to other important folders via nfs.  

I managed to boot on the client after using the stage_3 on the root file system.  I am now emerging world.  Any services not being used on the minimal install will be safely removed, since I'll then know they're not needed.  Perhaps, I can work my way backwards to what is minimally needed to get closer to what the wiki is doing.

I did do some nfs mounts to portage and to a tmpfs for /var/tmp/portage after everything started up to help out with emerging the world.  I should be able to keep those as long as /usr isn't an nfs mount.

Ultimately, I just want a couple extra processors on the network to help out with updates and maybe some BOINC use.  Not trying to use it as any sort of desktop.  I figured that getting a box working without a disk or hard drive would be a good learning experience, especially since the board only takes SATA connections and I don't have any more of that type of drive to spare.

----------

## redwood

Your dhcpd and tftp servers are OK since your diskless client is getting an IP when booting and is downloading a kernel from your tftp server.

However, once linux is loaded on client, it is not able to nfs mount its root from your server. 

Have you compiled CONFIG_ROOT_NFS=y into the kernel which the client downloads?

Since the NFS server is not responding to the client's request to mount its root, I would check the NFS server's  /etc/hosts.allow and /etc/hosts.deny

as well as the firewall rules and /etc/exportfs 

In my NFS server's /etc/hosts.allow I have 

```

# tftpd: LOCAL : ALLOW

in.tftpd:   192.168.1.28 192.168.1.11 192.168.1.12 192.168.1.16 192.168.1.17 192.168.1.18 192.168.1.100

# rpcinfo -p <host>

# rpcbind mountd nfsd statd lockd rquotad : list of ip addresses

rpcbind:        192.168.1.0/255.255.255.0 : ALLOW

mountd:         192.168.1.0/255.255.255.0 : ALLOW

nfsd:           192.168.1.0/255.255.255.0 : ALLOW

statd:          192.168.1.0/255.255.255.0 : ALLOW

lockd:          192.168.1.0/255.255.255.0 : ALLOW

rquotad:        192.168.1.0/255.255.255.0 : ALLOW

portmap:        192.168.1.0/255.255.255.0 : ALLOW

rpc.mountd:     192.168.1.0/255.255.255.0 : ALLOW

```

And in my NFS server's /etc/exportfs

```

#NFSv3

#/tftpboot/diskless     192.168.1.28(rw,sync,no_subtree_check,no_root_squash)

# NFSv4

/export                 192.168.1.0/24(insecure,rw,sync,no_subtree_check,crossmnt,fsid=0)

/export/diskless        192.168.1.28(insecure,rw,sync,no_subtree_check,no_root_squash)

```

I assume your NFS server's firewall permits connections from your diskless client?

I run shorewall and  these are the NFS rules in my NFS server's  /etc/shorewall

```

# NFS / PORTMAP

ACCEPT                  loc             $FW             udp     111  # sunrpc portmap

ACCEPT                  loc             $FW             tcp     111  # sunrpc portmap

ACCEPT                  loc             $FW             udp     2049 # nfs

ACCEPT                  loc             $FW             tcp     2049 # nfs

ACCEPT                  loc             $FW             udp     4045 # lockd

ACCEPT                  loc             $FW             tcp     4045 # lockd

ACCEPT                  loc             $FW             tcp     32765:32769

ACCEPT                  loc             $FW             udp     32765:32769

ACCEPT                  $FW             loc             udp     111

ACCEPT                  $FW             loc             tcp     111

ACCEPT                  $FW             loc             tcp     2049

ACCEPT                  $FW             loc             udp     2049

ACCEPT                  $FW             loc             tcp     4045

ACCEPT                  $FW             loc             udp     4045

ACCEPT                  $FW             loc             tcp     32765:32769

ACCEPT                  $FW             loc             udp     32765:32769

```

----------

