21744 Install over PXE - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Base System > Installing & Upgrading

Installing & Upgrading Installing and upgrading FreeBSD.

Reply
 
Thread Tools Display Modes
  #1  
Old February 25th, 2011, 21:21
recus recus is offline
Junior Member
 
Join Date: Dec 2009
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
Default Install over PXE

Is it possible to boot a computer with PXE and go directly to sysinstall? The documentation I find is only on diskless clients, and demands a lot of work (building own root on a NFS-mount etc).
Reply With Quote
  #2  
Old February 26th, 2011, 02:58
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,724
Thanks: 432
Thanked 1,762 Times in 1,459 Posts
Default

A boot loader will have to load a memstick or CD image into memory on the target machine. You'll still have to have a PXE server, with at least TFTP and preferably HTTP for speed. And of course the target machine has to have enough RAM to hold the image and leave enough free to run the installer.

Syslinux seems to have filename length problems, so I renamed FreeBSD-8.2-RELEASE-i386-bootonly.iso to bootonly.iso. Otherwise, this just worked for me:
Code:
label freebsd-install
  menu label FreeBSD Install
  linux memdisk
  initrd http://192.168.1.1/images/freebsd-install/bootonly.iso
  append iso raw
Change that initrd line to use tftp if that's all you have.

This was just thrown into the default menu file as shown in PXE Booting Utilities With FreeBSD.
Reply With Quote
  #3  
Old February 28th, 2011, 01:33
recus recus is offline
Junior Member
 
Join Date: Dec 2009
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Can this be done without involving Syslinux? I'm able to boot using PXE and fetching the file /boot/pxeboot (as configured in dhcpd) from the server using TFTP. But from there NFS is need, or am I mistaking?
Reply With Quote
  #4  
Old February 28th, 2011, 02:13
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,724
Thanks: 432
Thanked 1,762 Times in 1,459 Posts
Default

pxeboot(8) says it needs NFS.
Reply With Quote
  #5  
Old February 28th, 2011, 08:42
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,725
Thanks: 47
Thanked 2,023 Times in 1,862 Posts
Default

Quote:
Originally Posted by recus View Post
Is it possible to boot a computer with PXE and go directly to sysinstall? The documentation I find is only on diskless clients, and demands a lot of work (building own root on a NFS-mount etc).
FreeBSD Jumpstart Guide
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #6  
Old February 28th, 2011, 10:37
recus recus is offline
Junior Member
 
Join Date: Dec 2009
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by SirDice View Post
Ok, I wanted to get around the whole compiling of a new kernel and the most in chapter 3 of that link. So I copied the 8.2-install CD into /usr/tftpboot. The whole idea was to just boot over PXE and get sysinstall working and installing over network, since the machine doesn't have a CDROM. When booting now I got:

Code:
Lookup of /dev for devfs, error: 2
init: not found in path
/sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/init:/stand/sysinstall
After some grey hairs I found that telling the loader this made it work:

Code:
load /boot/kernel/kernel
load -t mfs_root /boot/mfsroot
set vfs.root.mountfrom="ufs:/dev/md0"
boot
But - my goal is to get all this done without having to use NFS. Do you think it's possible?

Last edited by DutchDaemon; February 28th, 2011 at 19:31.
Reply With Quote
  #7  
Old February 28th, 2011, 11:53
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,725
Thanks: 47
Thanked 2,023 Times in 1,862 Posts
Default

It may be possible if you use the old floppy boot but I'm not sure if that's supplied anymore. The installer itself is able to install from FTP, HTTP etc.

In theory you may be able to PXE boot those install floppies and do the rest of the installation via FTP or HTTP.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #8  
Old February 28th, 2011, 17:06
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,724
Thanks: 432
Thanked 1,762 Times in 1,459 Posts
Default

Quote:
Originally Posted by recus View Post
But - my goal is to get all this done without having to use NFS. Do you think it's possible?
Well, yes, did it in post #2. But if you insist on pxeboot(8), it's going to take some work. The pxeboot man page says
Quote:
The pxeboot bootloader retrieves the kernel, modules, and other files either via NFS over UDP or by TFTP, selectable through compile-time options.
Maybe you can configure it to retrieve an mfsroot image via TFTP.
Reply With Quote
  #9  
Old February 28th, 2011, 19:31
jem jem is offline
Member
 
Join Date: Oct 2009
Location: United Kingdom
Posts: 325
Thanks: 17
Thanked 51 Times in 41 Posts
Default

I've been playing around with setting up FreeBSD PXE booting today as I'm also trying to create a boot environment that runs from RAM and simply presents me with a shell with all the tools available to manually set up a FreeBSD system. I've had a few stumbles along the way, and have worked out the following:
  1. The PXE ROM in the network card uses tftp to fetch the pxeboot loader.
  2. The pxeboot loader uses NFS to read /boot/loader.rc
  3. loader.rc and its includes tell pxeboto how to load the kernel, modules, mfsroot images etc. These will all be fetched using NFS also.
  4. By default, the kernel will attempt to mount the same filesystem it was loaded from as its root filesystem.

pxeboot is by default only an NFS client, but you can recompile it to add tftp support instead of NFS. This might be useful if you want to use an mfsroot, because you obviously can't mount a filesystem using tftp. See /usr/src/sys/boot/i386/loader/Makefile.


I've managed to get a host netbooting into sysinstall using the same mfsroot filesystem that the official installation media uses, but the Fixit option that I use for manual installs doesn't work as it expects the fixit environment to be on CD/DVD, USB or floppy.

My next step is to look into creating a custom mfsroot that boots to a shell, not to sysinstall.
__________________
http://www.b0rken.org/
Reply With Quote
The Following 2 Users Say Thank You to jem For This Useful Post:
recus (February 28th, 2011), wblock@ (February 28th, 2011)
  #10  
Old March 1st, 2011, 02:20
recus recus is offline
Junior Member
 
Join Date: Dec 2009
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Just a thought, wouldn't it be in the interest of security to be able to boot this way without NFS?
Reply With Quote
  #11  
Old March 2nd, 2011, 15:34
jem jem is offline
Member
 
Join Date: Oct 2009
Location: United Kingdom
Posts: 325
Thanks: 17
Thanked 51 Times in 41 Posts
Default

While continuing to work on this today, I discovered the following document:

http://www.locolomo.org/howto/pxeboot/article.html

This comment stood out:

Quote:
The main disadvantage of using tftp to fetch a memory file system is that all clients will fetch the same files, load the same kernel and memory file system, regardless of hardware, version of FreeBSD or the purpose of the client.
This eliminates tftp as a possibility for me, as I'll want to use different kernels and mfsroot images for amd64 and i386 respectively.


On another issue, I was able to find and use an alternative mfsroot image to the standard 'sysinstall' one from the FreeBSD install media.

I used mfsBSD to generate an image suitable for 'dd'ing to a disk, then opened it up with mdconfig+mount and took the mfsroot.gz file out of it. This one boots into a root shell environment and has all the tools available to set up a system manually.
__________________
http://www.b0rken.org/
Reply With Quote
  #12  
Old March 2nd, 2011, 16:55
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,724
Thanks: 432
Thanked 1,762 Times in 1,459 Posts
Default

Quote:
Originally Posted by jem View Post
This eliminates tftp as a possibility for me, as I'll want to use different kernels and mfsroot images for amd64 and i386 respectively.
pxeboot(8) only looks at the root-path provided by the DHCP server, so yes, you only get that one filesystem. Being able to provide an alternate path would be nice. I think some of the Linux loaders use optional DHCP fields for that.
Reply With Quote
  #13  
Old March 3rd, 2011, 09:51
jem jem is offline
Member
 
Join Date: Oct 2009
Location: United Kingdom
Posts: 325
Thanks: 17
Thanked 51 Times in 41 Posts
Default

Well, dhcp can always give out a different NFS root-path for each host so no problem there.

By default, when using tftp, the pxeboot loader will only look for /boot/loader.rc, but perhaps the Fourth language in the loader is flexible enough to use logic to determine which kernel file to load after that, basing it on the MAC address of the machine for example? That information is certainly exposed within the loader environment:

Code:
OK show
LINES=24
acpi_load=YES
autoboot_delay=NO
boot.netif.gateway=192.168.0.1
boot.netif.hwaddr=08:00:c0:a8:00:52
boot.netif.ip=192.168.0.82
...
kernelname=/boot/kernel/kernel
I can't imagine it would be too difficult to make pxeboot search for kernels to load in a similar way to pxelinux, by searching for ever less IP-address specific file names until it finds a match, e.g.
  • kernel.c0a80052
  • kernel.c0a800
  • kernel.c0a8
__________________
http://www.b0rken.org/

Last edited by DutchDaemon; March 3rd, 2011 at 23:16.
Reply With Quote
  #14  
Old March 3rd, 2011, 16:29
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,724
Thanks: 432
Thanked 1,762 Times in 1,459 Posts
Default

Using MAC works fine for diskless workstations, but it doesn't give you any runtime choice as to which kernel/filesystem is used. If pxeboot took an optional parameter, a path to a TFTP directory to boot from, it would be useful. No idea how hard that would be to implement.
Reply With Quote
  #15  
Old March 4th, 2011, 03:18
loop loop is offline
Junior Member
 
Join Date: Nov 2008
Posts: 52
Thanks: 5
Thanked 3 Times in 3 Posts
Default

Quote:
Originally Posted by recus View Post
Is it possible to boot a computer with PXE and go directly to sysinstall? The documentation I find is only on diskless clients, and demands a lot of work (building own root on a NFS-mount etc).
I'm installing 8.2 right now in fact, using this guide.

Still needs NFS though.
Reply With Quote
  #16  
Old December 27th, 2011, 13:28
recus recus is offline
Junior Member
 
Join Date: Dec 2009
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Can someone explain to me why NFS is preferred for this operation and not http, ftp or tftp? Would be far more secure and easier to administer.

Last edited by DutchDaemon; December 28th, 2011 at 06:05.
Reply With Quote
  #17  
Old December 27th, 2011, 17:08
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,724
Thanks: 432
Thanked 1,762 Times in 1,459 Posts
Default

Possibly because there's built-in support for using NFS, while there isn't anything for using a TFTP, FTP, or HTTP address as a filesystem. Adding support for that to pxeboot(8) would be really useful.
Reply With Quote
  #18  
Old January 15th, 2012, 23:25
recus recus is offline
Junior Member
 
Join Date: Dec 2009
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Got some response I can't figure out while trying to install 9.0-RELEASE over PXE.
Code:
Trying to mount root from nfs: []... 
fxp0: link state changed to DOWN 
NFS ROOT: 192.168.1.2:/usr/local/pxeboot 
fxp0: link state changed to UP 
Interface fxp0 IP-Address 192.168.1.3 Broadcast 192.168.1.255 
Entropy harvesting: interrupts ethernet point_to_point kickstart. 
Starting file system checks: 
mount_nfs: no <host>:<dirpath> nfs-name 
Mounting root filesystem rw failed, startup aborted 
ERROR: ABORTING BOOT (sending SIGTERM to parent!) 
Jan 15 21:44:45 init: /bin/sh on /etc/rc terminated abnormally, going to singel user mode 
Enter full pathname of shell or RETURN for /bin/sh:
Once in the shell I can type ls and df -h and see that the mounted bootonly iso is there over NFS. But what went wrong?
Reply With Quote
  #19  
Old January 16th, 2012, 04:06
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,724
Thanks: 432
Thanked 1,762 Times in 1,459 Posts
Default

Code:
mount_nfs: no <host>:<dirpath> nfs-name
Network or NFS server problem?
Reply With Quote
  #20  
Old January 16th, 2012, 12:53
recus recus is offline
Junior Member
 
Join Date: Dec 2009
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by wblock@ View Post
Code:
mount_nfs: no <host>:<dirpath> nfs-name
Network or NFS server problem?
Seems to me to be NFS. Network up, got pxeboot from tftp on same address as NFS. Tried 8.2-RELEASE to eliminate 9.0 issues, but same output.
Reply With Quote
  #21  
Old January 19th, 2012, 11:23
pbotanik pbotanik is offline
Junior Member
 
Join Date: Jan 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Good afternoon. Faced with a multiversions Freebsd FreeBSD. Is it possible to install version 8.2 amd64 and 8.2 i386 via pxeboot server do not use NFS server? Perhaps there is another way?

Last edited by DutchDaemon; January 19th, 2012 at 22:53.
Reply With Quote
  #22  
Old July 11th, 2012, 08:37
jhgorse jhgorse is offline
Junior Member
 
Join Date: Jul 2012
Posts: 1
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Perhaps consider using iPXE which has builtin support for http, SAN, and so on.
http://ipxe.org/

There are still some caveats regarding the "kernel memdisk" method for booting ISO files. I have only successfully been able to boot an mfsbsd and bootonly ISOs using this method. I presume this has something to do with the setup of the ISO or the lack of correct kernel/initrd/kernel flag arguments within the pxelinux.cfg menu item for the other ISOs.

Does anyone know what kernel file and flags the FreeBSD boot ISO requires (i)pxelinux to us in order to mount the ISO as root?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
pxe boot and exec install.cfg Tom-i Installing & Upgrading 1 July 1st, 2010 20:30
PXE boot install server electric Installing & Upgrading 4 June 2nd, 2010 19:37
[Solved] PXE troubles andrnils Installing & Upgrading 4 May 21st, 2010 14:51
Can't load kernel using pxe vbm Installing & Upgrading 5 May 11th, 2010 01:08
FreeBSD 8.0 headless pxe install loppefaaret Installing & Upgrading 4 February 28th, 2010 20:01


All times are GMT +1. The time now is 14:56.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0