Diskless FreeBSD (PXE/NFS)

Prepare the host system

by ross at 10:30:49 on October 6, 2012

Prepare NFS

If you need help activating NFS support refer to the Handbook.

I export the entire /share directory (it contains other stuff needed by clients). Because of that I need -alldirs parameter (so the client can mount /share/lanboot/FreeBSD-9.0 as /).

For UFS filesystem add to /etc/exports:

/share          -ro -alldirs -maproot=root -network=192.168.10.0 -mask=255.255.255.0

For ZFS run this command (replace poolname with your pool):

# zfs set \
  sharenfs="-ro -alldirs -maproot=root -network 192.168.10.0 -mask 255.255.255.0" \
  poolname/share

Apply the changes:

# service mountd onereload

You can test if it's exported by running showmount -e command.

Prepare TFTP

Add to /etc/rc.conf:

# Enable inetd
inetd_enable="YES"

Uncomment and edit the tftp line in /etc/inetd.conf:

tftp    dgram   udp     wait    root    /usr/libexec/tftpd      tftpd -l -s /share/lanboot

Start inetd:

# service inetd start

Prepare DHCP

Install the dhcpd server, add to /usr/local/etc/dhcpd.conf to your subnet section:

# IP address of TFTP server:
next-server 192.168.10.1;
# The path relative to TFTP root (-s parameter in inetd.conf):
filename "FreeBSD-9.0/boot/pxeboot";
# NFS path to be mounted as root fs:
option root-path "192.168.10.1:/share/lanboot/FreeBSD-9.0/";

Restart the daemon:

# service isc-dhcpd restart 

 

Comments
Hi!

I'm testing the diskless, but in the client boot return this error in server.

tftpd[94164]: Got ERROR packet: TFTP Aborted

And the client don't complete boot process.

Help me.

Thanks,
-- Felipe
Friday, March 15, 2013, 18:34:34
Sorry, I've never seen this error on my diskless machines. Are you sure you do everything strictly as described in the article?
-- ross
Saturday, March 16, 2013, 4:55:03
Yes,

I debuged the tftp and the nfs, everything ok.

But the diskless machine don't break boot.
-- Felipe
Monday, March 18, 2013, 18:24:45
Sorry,

"don't break boot"

*break boot
-- Felipe
Monday, March 18, 2013, 18:26:11
Solved, thanks
-- Felipe
Friday, April 12, 2013, 20:07:42