# Force PXE Boot Without BIOS Change?



## mdt (Aug 31, 2010)

Hello!

I need to reimage a few thousand FreeBSD hosts remotely.  Unfortunately these hosts have boot order settings that don't consistently attempt PXE booting before booting from disk, so I can neither rely on the BIOS nor afford the time to console into each host to change the boot order. Is there a method to make the FreeBSD kernel on the hard disk attempt a PXE boot?

Thanks very much in advance,

Marshall


----------



## aragon (Aug 31, 2010)

If they have IPMI controllers you can usually set the boot device with IPMI requests to each system.

Otherwise boot0 can boot via PXE, but unless you modify its source and rewrite every system's MBR someone will need to press F6 during bootup to initiate it.


----------



## aragon (Aug 31, 2010)

You should look at alternative approaches too.  If the systems have unused disk space you could create another root file system on them, have loader(8) boot that instead, and from there update the primary file systems.


----------



## mdt (Sep 1, 2010)

Aragon,

Thanks for the speedy response.  I played a bit with ipmitool.  It appears that the boxes that I need to pxe boot don't have the supporting ipmi modules available to load for that to work.  Therefore I suspect I'd need to first upgrade the kernel before going this route.  Also, I've read that lots of pre-2007 Dells, of which we have many, don't properly implement IPMI.  

The free space solution requires unpartitioned disk space, right?  If I had unpartitioned space, I could partition it as a boot disk that could presumably load pxeboot.

If I come up with what works for me, then I'll post it here.  

Thanks again and Stay Tuned!


----------



## wblock@ (Sep 1, 2010)

Maybe it's possible to create a ramdisk with a FreeBSD pxeboot or Etherboot image and reboot from it.  But it still would need to be set up on all the systems.

Edit: a modification of nextboot(8) might do it.  (Read that as "there's a nasty-looking switch on the wall over here, but I'm not going to be the first.")


----------



## aragon (Sep 2, 2010)

mdt said:
			
		

> The free space solution requires unpartitioned disk space, right?


Unpartitioned or unsliced.

Or maybe you could temporarily repurpose swap space.


----------



## Terry_Kennedy (Sep 3, 2010)

mdt said:
			
		

> I need to reimage a few thousand FreeBSD hosts remotely.  Unfortunately these hosts have boot order settings that don't consistently attempt PXE booting before booting from disk, so I can neither rely on the BIOS nor afford the time to console into each host to change the boot order. Is there a method to make the FreeBSD kernel on the hard disk attempt a PXE boot?


Do you have to boot from PXE? If not, would a FreeBSD system running from a memory disk do everything you need (since then you can "pave over" the existing on-disk install)?

Take a look at the Depenguinator. Obviously, the Linux-specific parts aren't relevant, but the concept of booting a memory disk image from a swap partition should be useful.


----------

