Diskless (PXE) boot stuck

What I'm trying to do:

One computer running FreeBSD 14.3 that hosts a TFTP server, an NFS server and a DHCP server that provides all the over-the-network data needed to boot another machine whose BIOS has been set to boot over the built-in network adapter.

What I've Done

I've read the handbook instructions on diskless, I've read the section on mwl's Absolute FreeBSD on diskless, and I've read the excellent comments in /etc/rc.initdiskless.

I enabled tftpd via inetd and confirmed it works from a third machine.
I installed and configured isc-dhcpd to serve as the DHCP server. Also confirmed that this works.
I created a separate ZFS dataset to hold data served by NFS.
I've enabled nfsd and pointed to the new data set. In the exports, I have this directory as read-only.
I'll un-tar'd base.txz and kernel.txz to this new dataset.
I've done my best to hand edit the ./config/w.x.y.z/etc folder with configuration specifics for the target machine.

Pressed the power button with fingers crossed.

How It's Going So Far ...

On the target machine, I see the boot loader menu. Great!

I press 3 to drop the loader prompt and use the 'ls' command to look around. The contents of the NFS share are where I expect them to be. Also great!

I type 'boot' to resume the boot process. I see text fly on the console as numerous devices are discovered and configured as the kernel loads. There's a pause followed by:

em0: link state changed to UP

After this - nothing. The capslock and numlock lights work on the keyboard but keypresses are not echoed back to the console.

From the third machine, I can ping this new host so the IP stack is up and running.

I am so close but clearly something is missing that prevents the target host from reaching multiuser (or even single) mode.
 
In an attempt to gain some visibility into the target machine, I configured the host to also accept syslog connections from the diskless target. The diskless target was given a suitable syslog.conf file. No log messages from the target appear on the host.
 
I've enabled nfsd and pointed to the new data set. In the exports, I have this directory as read-only.
...
I've done my best to hand edit the ./config/w.x.y.z/etc folder with configuration specifics for the target machine.
You didn't mention whether ${NFSROOTDIR}/etc/ and ${NFSROOTDIR}/var/ are compressed archives when ${NFSROOTDIR} is read-only as described in the handbook 34.10.1. Setting Up the PXE Environment chapter.

If this is not the case, this could be the reason why the PXE boot process gets stuck:

When booting from an NFS root volume, /etc/rc detects the NFS boot and runs /etc/rc.initdiskless. In this case, /etc and /var need to be memory backed file systems so that these directories are writable but the NFS root directory is read-only:

Code:
# chroot ${NFSROOTDIR}
# mkdir -p conf/base
# tar -c -v -f conf/base/etc.cpio.gz --format cpio --gzip etc
# tar -c -v -f conf/base/var.cpio.gz --format cpio --gzip var

When the system boots, memory file systems for /etc and /var will be created and mounted and the contents of the cpio.gz files will be copied into them. By default, these file systems have a maximum capacity of 5 megabytes. If the archives do not fit, which is usually the case for /var when binary packages have been installed, request a larger size by putting the number of 512 byte sectors needed (e.g., 5 megabytes is 10240 sectors) in ${NFSROOTDIR}/conf/base/etc/md_size and ${NFSROOTDIR}/conf/base/var/md_size files for /etc and /var file systems respectively.
 
Thanks T-Daemon. Are you saying the etc template must be a compressed archive?
Yes, /etc and /var need to be compressed archives (at least when $NFSROOTDIR is read-only, I haven't tried $NFSROOTDIR read-write).

Some time ago I experimented PXE diskless booting a system to re-root a geli(8) encryted whole disk (GPT table inside the provider). I've noticed after making changes to $NFSROOTDIR/etc/rc.conf that they had no effect, unless /etc is gziped.

This observation confirmed that /etc must be a compressed archive. As a reminder: /etc contains all the necessary rc(8) scripts to boot into multi-user mode and start necessary services.
 
This is a bust. The cpio.gz files did not work. Stuck in same place.

This is on 15.0-RELEASE. Some changes took place after 12.x-RELEASE so some online examples may be out of date.
 
I've narrowed the scope a bit. pxeboot loads the kernel. This works by nfs or tftp. However, the stage that handles vfs.root.mountfrom seems to not handle nfs.

I can override it in loader.conf but I get either a hang or a parse error.

I think it weird that the loader accepts the DHCP option root-path just fine but the final mount root does not.

Side note: tftp is much slower but it logs each file name so you see exactly what the loader fetches.
 
Back
Top