110c9 [Solved] PXE TFTP network installations - 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 January 28th, 2012, 23:10
Max_nl Max_nl is offline
Junior Member
 
Join Date: Oct 2011
Posts: 4
Thanks: 0
Thanked 2 Times in 1 Post
Default PXE TFTP network installations

Did anyone succeed in performing a FreeBSD 9 network installation using PXE+TFTP (not NFS)? With previous versions of FreeBSD the installation CD contained a mfsroot ramdisk image, which could easily be modified for use in TFTP network installations. However I'm not sure how to transform the new FreeBSD 9 live cd format to a mfsroot image.

What I tried is simply creating a blank 200 mb mfsroot file with mdconfig, format it with newfs, mount it, and copy the contents of the CD with rsync. However FreeBSD doesn't seem to like the resulting image. The pxeboot stage goes fine, in the sense that it downloads the kernel files and the mfsroot:



But once it tries to boot I get a screen full of "page fault while in kernel mode" errors that are printed so fast they are hardly readable:



Also I'm not sure if my loader.rc is correct. I'm using this 5-line one which works fine with FreeBSD 8:

Code:
echo Loading Kernel...
load /boot/kernel/kernel
echo Loading MFS root...
load -t mfs_root /mfsroot
set autoboot_delay=0
Do I perhaps need additional boot options for FreeBSD 9?

Last edited by DutchDaemon; January 28th, 2012 at 23:26. Reason: Proper formatting: http://forums.freebsd.org/showthread.php?t=8816
Reply With Quote
  #2  
Old January 29th, 2012, 16:18
Max_nl Max_nl is offline
Junior Member
 
Join Date: Oct 2011
Posts: 4
Thanks: 0
Thanked 2 Times in 1 Post
Default

Turns out the kernel does not support large ramdisks by default.
Managed to solve the problem by increasing NPKT in /usr/src/sys/amd64/include/pmap.h
Reply With Quote
The Following 2 Users Say Thank You to Max_nl For This Useful Post:
bunnylover (February 10th, 2012), wblock@ (January 29th, 2012)
  #3  
Old February 7th, 2012, 10:59
techtonik's Avatar
techtonik techtonik is offline
Junior Member
 
Join Date: Nov 2011
Posts: 27
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Max_nl View Post
Turns out the kernel does not support large ramdisks by default.
Why?
Reply With Quote
  #4  
Old February 7th, 2012, 16:40
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,701
Thanks: 429
Thanked 1,757 Times in 1,456 Posts
Default

Because NKPT is too small, apparently.

Code:
116 /* Initial number of kernel page tables. */
117 #ifndef NKPT
118 #define NKPT            32
119 #endif
Reply With Quote
  #5  
Old February 8th, 2012, 14:16
techtonik's Avatar
techtonik techtonik is offline
Junior Member
 
Join Date: Nov 2011
Posts: 27
Thanks: 2
Thanked 0 Times in 0 Posts
Default

And how do kernel page tables affect inability to load over PXE TFTP?

Why there is a problem to create 200Mb RAM disk?
Reply With Quote
  #6  
Old February 8th, 2012, 18:50
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,701
Thanks: 429
Thanked 1,757 Times in 1,456 Posts
Default

I would guess it's not PXE specifically, but that a kernel image or memory allocation is larger than the default is built to allow. Best to ask on one of the mailing lists, like freebsd-hackers.
Reply With Quote
  #7  
Old February 10th, 2012, 18:28
bunnylover bunnylover is offline
Junior Member
 
Join Date: Feb 2012
Posts: 2
Thanks: 1
Thanked 1 Time in 1 Post
Default

As a sidenote to the original post, I'd like to mention that I had success in using mfsBSD from 9.0-RELEASE to create a 28 MB FreeBSD installer that can be sent using PXE+TFTP (without NFS). The CD appears to simply use /etc/rc.local to start the installer and this seems to work well if one puts in a little time to build a few shell scripts and create new bsdinstall targets.

Last edited by DutchDaemon; February 11th, 2012 at 06:01.
Reply With Quote
The Following User Says Thank You to bunnylover For This Useful Post:
wblock@ (February 10th, 2012)
  #8  
Old February 27th, 2012, 03:24
Schorschi Schorschi is offline
Junior Member
 
Join Date: Feb 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Anyone figure out how to use bootonly ISO as source for memdisk image? Trying to create a variant of FreeBSD that uses our existing Linux based SysLinux/PxeLinux based DHCP/TFTP environment for PXE. Unfortunately, we can't dedicated server for FreeBSD based PXE/TFTP/DHCP resources.

I created an img file that PXELinux can load, but after I got the boot loader successfully, and I added a referece to /dev/md0 in the loader.conf file, I get a failure.
Code:
mountroot: waiting for device /dev/md0, Mounting from ufs:/dev/md0 failed with error 19
?

Code:
Download the FreeBSD boot only image to the virtual instance.
# cd /tmp
# wget ftp://ftp.freebsd.org/pub/FreeBSD/ISO-IMAGES-<architecture>/9.0/FreeBSD-9.0-RELEASE-<architecture>-bootonly.iso
Where <architecture> is i386 or x86_64.

# ls -al | grep Free
-rw-r--r--   1 root  wheel  134739968 Feb 25 08:25 FreeBSD-9.0-RELEASE-<architecture>-bootonly.iso

Establish memory disk for boot only disc, then mount boot only disc file to memory disk…
# mdconfig -a -t vnode -f FreeBSD-9.0-RELEASE-<architecture>-bootonly.iso -u1
# mkdir /tmp/iso
# mount -t cd9660 /dev/md1 /tmp/iso

Establish memory disk file for boot only image, be sure to size the file to allow for file system overhead…
# dd if=/dev/zero of=./bootonly.img bs=1m count=200
# ls -al | grep bootonly
-rw-r--r--   1 root  wheel  134739968 Feb 25 08:25 FreeBSD-9.0-RELEASE-i386-bootonly.iso
-rw-r--r--   1 root  wheel  209715200 Feb 26 16:10 bootonly.img

Initialize, label, and format memory disk for boot only image…
# mdconfig -a -t vnode -f bootonly.img -u0
# bsdlabel -w -B md0 auto
# bsdlabel -A md0
# /dev/md0:
type: unknown
disk: amnesiac
label:
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 406
sectors/unit: 409600
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # milliseconds
track-to-track seek: 0  # milliseconds
drivedata: 0
8 partitions:
#          size     offset    fstype   [fsize bsize bps/cpg]
  a:     409584         16    unused        0     0
  c:     409600          0    unused        0     0     # "raw" part, don't edit

Set file system for memory disk boot only image, and then mount memory disk boot only image…
# newfs -b 8192 -f 1024 /dev/md0a
/dev/md0a: 200.0MB (409584 sectors) block size 8192, fragment size 1024
        using 5 cylinder groups of 45.16MB, 5781 blks, 11584 inodes.
super-block backups (for fsck -b #) at:
 144, 92640, 185136, 277632, 370128
# mkdir /tmp/img
# mount /dev/md0a /tmp/img

Replicate boot specific files, from mounted boot only disc image to mounted boot only image…
# cp -vR /tmp/iso/* /tmp/img

Customize boot configuration…
# echo 'vfs.root.mountfrom="ufs:/dev/md0"' >> /tmp/img/boot/loader.conf

Release mounts and memory disk references…
# umount /tmp/iso
# umount /tmp/img
# mconfig –l
md1 md0
# mdconfig -d -u1
# mdconfig -d -u0
# mconfig –l
# rm -rf /tmp/iso
# rm -rf /tmp/img

Compress boot only memory disk image…
# gzip -c bootonly.img > bootonly.img.gz
# ls -al | grep bootonly
-rw-r--r--   1 root  wheel  134739968 Feb 25 08:25 FreeBSD-9.0-RELEASE-i386-bootonly.iso
-rw-r--r--   1 root  wheel  209715200 Feb 26 17:33 bootonly.img
-rw-r--r--   1 root  wheel   60502254 Feb 26 17:36 bootonly.img.gz
# rm –rf bootonly.img
# mv bootonly.img.gz bootonly.img

Stage compressed boot only image on TFTP boot server, and then within the PXELinux environment…
# scp bootonly.img.gz 192.168.1.36:/var/lib/tftpboot/images/FreeBSD/9.0/<architecture>/ bootonly.img.gz
Where <architecture> is i386 or x86_64.

# vi /var/lib/tftpboot/pxelinux.cfg/default
LABEL FreeBSD-9.0-i386-Installer
        MENU LABEL i386 Installer
        MENU INDENT 6
        KERNEL memdisk
        APPEND initrd=/images/FreeBSD/9.0/i386/initrd.img.gz raw

Last edited by DutchDaemon; February 27th, 2012 at 04:29. Reason: Proper formatting: http://forums.freebsd.org/showthread.php?t=8816
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
USB multiboot installations Jeppa Installing & Upgrading 3 December 7th, 2010 15:49
TFTP Server vnaveen198 Web & Network Services 2 November 26th, 2010 19:42
tftp-proxy broken? honk Firewalls 1 March 24th, 2010 09:10
LAN boot - PXE-E32 TFTP open timeout jenaniston Networking 4 January 23rd, 2010 05:38
tftp and dhcp server neo_leopard Networking 1 December 3rd, 2009 21:09


All times are GMT +1. The time now is 21:29.


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