pxeboot and /boot filesystem, share /boot/kernel

Martin Cracauer cracauer at cons.org
Sun Jul 1 21:35:43 UTC 2007


Bernd Walter wrote on Sun, Jul 01, 2007 at 09:36:41PM +0200: 
> On Sun, Jul 01, 2007 at 02:13:34PM -0400, Martin Cracauer wrote:
> > I want to tighten up my spaces for diskless machines and I came across
> > this puzzle with pxeboot:
> > 
> > I can share /usr and most other filesystems, but my individual roots
> > for the machine each have to have the full kernel.  But /boot/kernel
> > is rather large these days and totally identical, so I'd rather share
> > it.
[...]
> > I think I have three paths to go here:
> > 
> > 1) make pxeboot understand a separate "boot-path" dhcp option.
> > 
> > 2) make loader.4th able to use NFS or tftp.  IP is already up by the
> >    time it is started.
> > 
> > 3) only share /boot/kernel/kernel and share a NFS mount for the
> >    modules, but that's very messy.
> 
> 4) Use different / on the same server filesystem with hardlinked /boot.

Hmm, directory hardlinks through NFS server? But might do.

I also considered hacking up the NFS server code to resolve individual
symlinks of my choice.  I like this feature a lot when serving samba
shares to Windows clients to make stupid applications actually place
stuff where I want it.  But this solution is bad news if you rebase
your NFS server.

%%

It has been pointed out to me that BSD used to have
/etc/fstab.<hostname> back in the day.  That seems to be easy enough
to re-introduce given that pxeboot already set the IP address.

However, it is somewhat hackey since in effect your first root
filesystem (common for all clients) gets used only once for /etc/fstab
and is only used to redirect to a new (indivual) root filesystem.

> 5) Use two / - one common for booting and a client specific.
>    loader.rc in common will overwrite rootfs.
>    But I'm unshure if you can get host specific data, e.g. MAC from net
>    interface.

That is somewhat similar to /etc/fstab.<host> but would require the
4th to know about networking.

> 6) Don't install *.symbols and live with multiple file space usage for
>    the rest.

Right but not sportish :-)

%%

Overall, I also need to keep in mind that some but but all of my
diskless clients will have individual kernels and that I want the most
elegant way to express this.  

The most elegant way to do this would either be a per-host /boot
filesystem mount (which I would want to be used both at kernel load
time and during runtime).

Or a per-host kernel setting in loader.rc which normally points to the
common kernel but can point to an individual one.  But as mentioned
earlier, this is difficult to do if you / is already unshared, unless
the loader can deal with NFS or tftp to load from a
address:/boot/... location. 

Martin
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <cracauer at cons.org>   http://www.cons.org/cracauer/
FreeBSD - where you want to go, today.      http://www.freebsd.org/


More information about the freebsd-hackers mailing list