Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Trouble with diskless boot/install - nfs root mount
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
gtwrek
n00b
n00b


Joined: 10 Mar 2017
Posts: 9

PostPosted: Fri Mar 10, 2017 4:58 pm    Post subject: Trouble with diskless boot/install - nfs root mount Reply with quote

I'm trying to setup a diskless server as documented here:
https://wiki.gentoo.org/wiki/Diskless_nodes

I don't think my trouble is gentoo specific, but am hoping some of the smart folks here can point me in the correct direction.

The PXE boot stuff seems to be working fine - the diskless node grabs the correct IP address, finds the kernel image, and the boot starts.
However, things die when the kernel tries to mount the nfs root partition.

My setup - same kernel used on the "server" as the "client". My "server" is serving dhcp, in.tftp, nfs, etc.

Kernel 4.4.26
Code:
% zgrep -i nfs /proc/config.gz
CONFIG_KERNFS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V2=y
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
# CONFIG_NFS_SWAP is not set
# CONFIG_NFS_V4_1 is not set
CONFIG_ROOT_NFS=y
# CONFIG_NFS_USE_LEGACY_DNS is not set
CONFIG_NFS_USE_KERNEL_DNS=y
CONFIG_NFSD=y
CONFIG_NFSD_V3=y
# CONFIG_NFSD_V3_ACL is not set
# CONFIG_NFSD_V4 is not set
CONFIG_NFS_ACL_SUPPORT=y
CONFIG_NFS_COMMON=y


pxeboot config:
Code:
% more /diskless/pxelinux.cfg/default
DEFAULT gentoo
LABEL gentoo
LINUX /bzImage
APPEND vga=EXTENDED_VGA rootwait ip=dhcp root=/dev/nfs nfsroot=192.168.1.1:/diskless/192.168.1.100 nfsrootdebug


server /etc/exports:
Code:
#/diskless/192.168.1.100 192.168.1.100(sync,rw,no_root_squash,no_all_squash)
#/diskless/192.168.1.100 192.168.1.0/24(sync,rw,no_root_squash,no_all_squash)
#/diskless/192.168.1.100 192.168.1.0/24(rw,nohide,insecure,no_subtree_check,async,no_root_squash)
/diskless/192.168.1.100 192.168.1.0/24(rw,nohide,insecure,no_subtree_check,async,no_root_squash,no_all_squash)


# common to all slaves
/opt   192.168.1.0/24(sync,ro,no_root_squash,no_all_squash,no_subtree_check)
/usr   192.168.1.0/24(sync,ro,no_root_squash,no_all_squash,no_subtree_check)
/home  192.168.1.0/24(sync,rw,no_root_squash,no_all_squash,no_subtree_check)


You can see, I've tried various nfs options - to no avail.

Slave /etc/fstab:
Code:
% more /diskless/192.168.1.100/etc/fstab
192.168.1.1:/diskless/192.168.1.100   /         nfs     sync,hard,intr,rw,nolock,rsize=8192,wsize=8192    0 0
192.168.1.1:/opt                     /opt      nfs     sync,hard,intr,ro,nolock,rsize=8192,wsize=8192    0 0
192.168.1.1:/usr                     /usr      nfs     sync,hard,intr,ro,nolock,rsize=8192,wsize=8192    0 0
192.168.1.1:/home                    /home     nfs     sync,hard,intr,rw,nolock,rsize=8192,wsize=8192    0 0
none                                 /proc     proc    defaults  0 0


I can nfs mount the root partition from another machine with no problems. I can check my /var/log/messages from the server, and see the client successfully authenticates the nfs mount during the boot:
Code:
Mar  8 19:36:22 sage rpc.mountd[29291]: authenticated mount request from 192.168.1.100:823 for /diskless/192.168.1.100 (/diskless/192.168.1.100)


/etc/hosts.(deny|allow) is all proper (both server and client), so I'm not preventing the connection anywhere. I've temporarily disabled iptables on the server to eliminate that variable.

The kernel boot on the diskless just always fails when trying to mount the nfs root. The kernel nfsrootdebug option doesn't appear to do anything.

I'm wavering on whether or not I want to wade into the kernel to try and figure this out. Be a learning experience I'm sure...

Any pointers appreciated.

Thanks,

Mark
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43213
Location: 56N 3W

PostPosted: Fri Mar 10, 2017 5:28 pm    Post subject: Reply with quote

gtwrek,

A long time ago I had a diskless root in /var/mediaplayer on my media server. The media player had to be silent to be allowed in the lounge
Now it has a SSD.

My /var/mediaplayer/boot/pxelinux.cfg/default contains
Code:
default New

prompt 0
timeout 300
ONTIMEOUT New

MENU TITLE Startup Menu

LABEL New
        MENU LABEL 3.8.7-Gentoo
        KERNEL /3.8.7-gentoo
        APPEND ip=dhcp root=/dev/nfs rootfstype=nfs nfsroot=192.168.100.55:/var/mediaplayer rootpath=/var/mediaplayer radeon.audio=1
        TEXT HELP
        New Kernel with swap support
        ENDTEXT

3.8.7-gentoo ... that long ago :)

Thats /boot/pxelinux.cfg/default once root is mounted diskless.

From your setup you might be trying to use CONFIG_NFS_V4=y.
I could not get that to work.
Try adding nfsvers=3 to your APPEND.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
gtwrek
n00b
n00b


Joined: 10 Mar 2017
Posts: 9

PostPosted: Sat Mar 11, 2017 2:43 am    Post subject: Reply with quote

Thanks Neddy.

I tried the nfsvers=3. No dice.

Tried adding a rootpath=/diskless/192.168.1.100 too (That kernel option doesn't seem to be documented anymore, but hey, can't hurt, and your example had a rootpath=)

No dice.

I do notice the console reports the IP-Config (one of the last things before trying to mount root). (I assume from the DHCP handshaking). It reports the correct hostname (assigned from the DHCP server), correct IP - no domain, nor nis-domain (I've none configured). It reports the bootserver=192.168.1.1, rootserver=192.168.1.1 (correct), but rootpath= (i.e. nothing).

I'm wondering - is there something in the DHCP exchange that set's "rootpath"? Am I missing some setup there?

I'm hesitant to upgrade to nfs4 (no reason other than the server is also serving to other clients, I just don't want to upgrade all at the moment).

It's frustrating, as it seems I'm 90% of the way there. I could go out, and buy a small SSD just for root fs, but I'm pigheaded, in that I want to make this work.
I'll give it another day or so of hacking. I'm not sure I'm to the point yet of reading the kernel hacking guide, and start inserting printk() statements. But I might....

If anyone else has any ideas, it'd be appreciated.

Regards,

Mark
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7071

PostPosted: Sat Mar 11, 2017 10:12 am    Post subject: Reply with quote

Have a look, could help https://forums.gentoo.org/viewtopic-t-989596.html
specially https://forums.gentoo.org/viewtopic-p-7592928.html#7592928
Back to top
View user's profile Send private message
gtwrek
n00b
n00b


Joined: 10 Mar 2017
Posts: 9

PostPosted: Fri Mar 17, 2017 5:39 pm    Post subject: Reply with quote

Thanks Krinn - that did the trick. Adding "vers=3" to my nfsroot enable my kernel to successfully mount root.

I've had many more "errors between keyboard and chair" this week while I've completed the installation on the diskless server. But its up and running now.

Thanks again to you and Neddy for your help.

--Mark
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum