<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>clement&#039;s FreeBSD blog</title>
	<atom:link href="http://blogs.freebsdish.org/clement/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.freebsdish.org/clement</link>
	<description>...</description>
	<lastBuildDate>Sat, 20 Oct 2007 19:22:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>more on zfs&#8230;</title>
		<link>http://blogs.freebsdish.org/clement/2007/10/18/more-on-zfs/</link>
		<comments>http://blogs.freebsdish.org/clement/2007/10/18/more-on-zfs/#comments</comments>
		<pubDate>Thu, 18 Oct 2007 13:58:11 +0000</pubDate>
		<dc:creator>clement</dc:creator>
				<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://blogs.freebsdish.org/clement/2007/10/18/more-on-zfs/</guid>
		<description><![CDATA[This time I ran izone with a 8GB file on : UFS 2 (newfs defaults) over a gstripe (stripe size 64k) volume zfs with 3 disks stripped UFS 2 (newfs defaults) over a zvol (equal to zpool size) zfs over a gstripe (stripe size 64k) volume UFS2 async + gjournal over a gstripe (stripe size [...]]]></description>
				<content:encoded><![CDATA[<p>This time I ran izone with a 8GB file on :</p>
<ol>
<li>UFS 2 (newfs defaults) over a gstripe (stripe size 64k) volume</li>
<li>zfs with 3 disks stripped</li>
<li>UFS 2 (newfs defaults) over a zvol (equal to zpool size)</li>
<li>zfs over a gstripe (stripe size 64k) volume</li>
<li>UFS2 async  + gjournal  over a  gstripe  (stripe size 64k) volume</li>
</ol>
<p><img src="http://people.freebsd.org/~clement/iozone/zfs3/2d-read.png" alt="zfs -- read" height="480" width="450" /><br />
<img src="http://people.freebsd.org/~clement/iozone/zfs3/2d-write.png" alt="zfs --write" height="480" width="450" /></p>
<p>I&#8217;m confused about what to expect from these values&#8230;<br />
As usual complete  set of graphes are  <a href="http://people.freebsd.org/~clement/iozone/zfs2/" title="iozone results">here.</a> (note: I also splitted iozone results by record size).</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.freebsdish.org/clement/2007/10/18/more-on-zfs/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>clement vs 7.0-PRERELEASE</title>
		<link>http://blogs.freebsdish.org/clement/2007/10/16/clement-vs-70-prerelease/</link>
		<comments>http://blogs.freebsdish.org/clement/2007/10/16/clement-vs-70-prerelease/#comments</comments>
		<pubDate>Tue, 16 Oct 2007 12:42:21 +0000</pubDate>
		<dc:creator>clement</dc:creator>
				<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://blogs.freebsdish.org/clement/2007/10/16/clement-vs-70-prerelease/</guid>
		<description><![CDATA[No, I&#8217;m not dead (yet?). [Disclaimer]: I&#8217;m far from being an expert in VM or storage. Don&#8217;t use this post if you need to feed various trolls. To make the story short, I&#8217;m confused about my ZFS benchmarks &#8211; Yeah I know benchmark sucks &#8211; Write performances are quite impressive, but I feel uncomfortable with [...]]]></description>
				<content:encoded><![CDATA[<p>No, I&#8217;m not dead (yet?).</p>
<p>[Disclaimer]: I&#8217;m far from being an expert in VM or storage. Don&#8217;t use this post if you need to feed various trolls.</p>
<p>To make the story short, I&#8217;m confused about my ZFS benchmarks &#8211; Yeah I know benchmark sucks &#8211; Write performances are quite impressive,  but I feel uncomfortable with read performances when it reaches arc limits&#8230;</p>
<p>Most of my workstations and personal servers are running CURRENT and I was waiting for  RELENG_7 to test it on my test servers at work. Why? just because I&#8217;m lazy and I want to update my servers with my freebsd-update receipe (It _almost_ works ;)).<br />
I was also waiting for RELENG_7 because of zfs, to use it on the &#8220;low cost&#8221; storage server we received.<br />
It&#8217;s a HP DL 365 G1 dual core with 5GB of RAM. The storage part is a MSA 20  with 12 500GB disks attached to a Smart Array 4602 (ciss(4)) controller, 192MB of BBW cache (50/50). Due to limitations of the latter, volumes can&#8217;t exceed 2 TB. We splitted the disk pool into 3 RAID 5 volumes of 1.4To each. [<a href="http://people.freebsd.org/~clement/iozone/zfs/build7_dmesg.txt" title="dmesg">dmesg here</a>]</p>
<p>ZFS will strip volumes for us.<br />
<code># zpool create test da0 da1 da2</code></p>
<p>Out of the box, raid volumes speed are not that bad. Applying scottl@&#8217;s ciss patch helps a little.<br />
Once the zpool created, I was impressed by the &#8220;irrevelant dd benchmark&#8221;: read 180MB/s, write 110MB/s. I couldn&#8217;t resist to launch iozone. As expected it panic() :)<br />
All iozone runs are performed with the following command:<br />
<code># iozone -aRcWe -g 2G -f /test/testfile</code></p>
<p>I rose vm.kmem* to 1GB and kern.maxvnodes to 400000, I re-ran iozone and played with postmark. Few hours later, Yet Another Panic. I tried to set vm.kmem* up to 1.5GB or 2G with no luck. Anyway, I&#8217;ll investigate later. I decided to test without prefetch. No surprise. YAP.<br />
I thought it was time to give pjd&#8217;s vm_kern.c hack a chance. Once the kernel recompiled, I restarted iozone (without prefetch). 6 hours later, still no panic, great ! A lot of successfull rsync later, disappointing tar over nc transfers (it requires more investigation, I&#8217;ll &#8220;blog&#8221; about later), I felt uncomfortable with read performance.</p>
<p>I ran my bench with and without prefetch. Read performance was dissatisfied (compared to write performances).<br />
Last time I&#8217;ve seen kinds of dramatical performance hits, it was on linux, buffer cache starvation. I decided to check it compare it to a striped volume. I destroyed my zpool and create a gstripe with 64k stripe.<br />
<code># zpool destroy test<br />
# gstripe label -s 64k da0 da1 da2<br />
# newfs /dev/stripe/data</code></p>
<p>I finally got read performance I expected.</p>
<p><img src="http://people.freebsd.org/~clement/iozone/zfs/2d-read.png" alt="read" height="480" width="450" /></p>
<p><img src="http://people.freebsd.org/~clement/iozone/zfs/2d-write.png" alt="write" height="480" width="450" /></p>
<p>As you can see, the fall appears when arc gets full.<br />
Here are arc infos, except for the run where vfs.zfs.arc_{min,max} was set to 32MB<br />
<code>vfs.zfs.arc_min: 33554432<br />
vfs.zfs.arc_max: 805306368</code></p>
<p>Backing out pjd&#8217;s patch didn&#8217;t help. I&#8217;m currently running the same benchmark with a iozone file of 8GB.</p>
<p>You can get all the graph <a href="http://people.freebsd.org/~clement/iozone/zfs/" title="iozone output">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.freebsdish.org/clement/2007/10/16/clement-vs-70-prerelease/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FreeBSD, Apache 2.x and itk mpm</title>
		<link>http://blogs.freebsdish.org/clement/2006/11/05/freebsd-apache-2x-and-itk-mpm/</link>
		<comments>http://blogs.freebsdish.org/clement/2006/11/05/freebsd-apache-2x-and-itk-mpm/#comments</comments>
		<pubDate>Sun, 05 Nov 2006 18:17:06 +0000</pubDate>
		<dc:creator>clement</dc:creator>
				<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://blogs.freebsdish.org/clement/2006/11/05/freebsd-apache-2x-and-itk-mpm/</guid>
		<description><![CDATA[mpm-itk is a working alternative to the b0rked perchild mpm, but in prefork mode. It&#8217;s currently maintained by Steinar H. Gunderson. Please see: http://home.samfundet.no/~sesse/mpm-itk/ for more details. It has been developed for apache 2.0.x and been ported to apache 2.2 recently.Since I enjoy apache 2.2 this little howto is made under apache 2.2.x but works [...]]]></description>
				<content:encoded><![CDATA[<p>mpm-itk is a working alternative to the b0rked perchild mpm, but in<br />
prefork mode. It&#8217;s currently maintained by Steinar H. Gunderson. Please<br />
see: <a href="http://home.samfundet.no/%7Esesse/mpm-itk/">http://home.samfundet.no/~sesse/mpm-itk/</a><br />
for more details.<br />
It has been developed for apache 2.0.x and been ported to apache 2.2<br />
recently.Since I enjoy apache 2.2 this little howto is made under<br />
apache 2.2.x but works for apache 2.0.x too.</p>
<p>First of all CVSup your ports tree. Go to apache22 port and build<br />
apache with &#8220;itk&#8221; as MPM :</p>
<pre>$ cd /usr/ports/www/apache22
$ sudo make WITH_MPM=itk
&lt;...build output...&gt;
$ sudo make install clean</pre>
<p>Let&#8217;s check we have te good MPM.</p>
<pre>$ /usr/local/sbin/httpd -V | grep MPM
Server MPM:     ITK
-D APACHE_MPM_DIR="server/mpm/experimental/itk"</pre>
<p>Nice! We can now see how our apache22 reacts :)</p>
<pre>$ sudo /usr/local/etc/rc.d/apache22 forcestart
Performing sanity check on apache22 configuration:
Syntax OK
Starting apache22.
$ ps auxwww | grep httpd
root    92484  0.0  0.7 73452  7116  ?? Ss    4:18PM   0:00.09 /usr/local/sbin/httpd -DNOHTTPACCEPT
root    92485  0.0  0.7 73484  7132  ?? S     4:18PM   0:00.00 /usr/local/sbin/httpd -DNOHTTPACCEPT
root    92486  0.0  0.7 73484  7132  ?? S     4:18PM   0:00.00 /usr/local/sbin/httpd -DNOHTTPACCEPT
root    92487  0.0  0.7 73484  7132  ?? S     4:18PM   0:00.00 /usr/local/sbin/httpd -DNOHTTPACCEPT
root    92488  0.0  0.7 73484  7132  ?? S     4:18PM   0:00.00 /usr/local/sbin/httpd -DNOHTTPACCEPT
root    92489  0.0  0.7 73484  7132  ?? S     4:18PM   0:00.00 /usr/local/sbin/httpd -DNOHTTPACCEPT
</pre>
<p>Ohoh! apache is owned by root. No I didn&#8217;t put a backdoor ;) apache runs as root because until the request get parsed, we don&#8217;t know which virtual host is required and, so, the final user. Security risk exists: Any bug before request parsing can lead to root compromise. If there is a major flaw in mod_ssl, pray and update ASAP.</p>
<p>Still here? Not scared? you should be :)<br />
mpm-itk uses 2 Directives:<br />
<i>AssignUserID</i>, UID/GID assigned to child process and <i>MaxClientsVHost</i>, the maximum number of children alive at the same time for this virtual host</p>
<p>Don&#8217;t uncomment &#8216;#Include etc/apache22/extra/httpd-vhosts.conf&#8217; in<br />
${PREFIX}/etc/apache22/httpd.conf, the config file is b0rked (it&#8217;s on<br />
my ToDo list).</p>
<p>Instead edit ${PREFIX}/etc/apache22/Includes/100.NameVirtualHost.conf<br />
and put:</p>
<pre>NameVirtualHost *:80</pre>
<p>(I usually leave 0xx for modules configurations)</p>
<p>Add something like this to<br />
${PREFIX}/etc/apache22/Includes/101.DefaultVirtualHost</p>
<pre>&lt;VirtualHost *:80&gt;
    DocumentRoot /usr/local/www/apache22/data
    AssignUserID  nobody nogroup
    MaxClientsVHost 10
&lt;/VirtualHost&gt;</pre>
<p>Now add a different vhost. My vhost is &#8220;poubelle.cultdeadsheep.org&#8221;, So<br />
in ${PREFIX}/etc/apache22/Includes/poubelle.cultdeadsheep.org.conf I<br />
have:</p>
<pre>&lt;VirtualHost *:80&gt;
    ServerAdmin clement@poubelle.cultdeadsheep.org
    DocumentRoot /home/www/poubelle.cultdeadsheep.org
    ServerName poubelle.cultdeadsheep.org
    AssignUserID  clement clement
    MaxClientsVHost 50
    &lt;Directory /home/www/poubelle.cultdeadsheep.org&gt;
            Order allow,deny
            Allow from all
    &lt;/Directory&gt;
&lt;/VirtualHost&gt;</pre>
<p>I&#8217;ve also install PHP5 to perform some basic testing. Let&#8217;s restat<br />
apache.</p>
<pre>$ sudo /usr/local/etc/rc.d/apache22 forcerestart</pre>
<p>I run this simple script:</p>
<pre>&lt;?system("id");?&gt;</pre>
<p>We run _the_  *basic* test&#8230;</p>
<pre>$ fetch -q -o - http://192.168.0.6/test.php
uid=65534(nobody) gid=65534(nobody) egid=65533(nogroup) groups=65533(nogroup)
$ fetch -q -o - http://poubelle.cultdeadsheep.org/test.php
uid=1000(clement) gid=1000(clement) groups=1000(clement)
</pre>
<p>And it works! I don&#8217;t even have to keep the o+x bit on directories :)</p>
<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.freebsdish.org/clement/2006/11/05/freebsd-apache-2x-and-itk-mpm/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>(U&#124;Abu&#124;Misu)sing software to install and update FreeBSD</title>
		<link>http://blogs.freebsdish.org/clement/2006/10/02/uabumisusing-software-to-install-and-update-freebsd/</link>
		<comments>http://blogs.freebsdish.org/clement/2006/10/02/uabumisusing-software-to-install-and-update-freebsd/#comments</comments>
		<pubDate>Mon, 02 Oct 2006 21:00:50 +0000</pubDate>
		<dc:creator>clement</dc:creator>
				<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://blogs.freebsdish.org/clement/2006/10/02/uabumisusing-software-to-install-and-update-freebsd/</guid>
		<description><![CDATA[Last tuesday, I finally received few servers. We (my co-worker and I) have wasted 3 days waiting for hardware, sat next to datacenter door, playing Mario Kart DS. We added a new rack and put into it a cisco 2970 switch, 3 HP DL360, and 1 DL380 (all are G4). We configured iLO and went [...]]]></description>
				<content:encoded><![CDATA[<p>Last tuesday, I finally received few servers.  We (my co-worker and I) have wasted 3 days waiting for hardware, sat next to datacenter door, playing Mario Kart DS. We added a new rack and put into it a cisco 2970 switch, 3 HP DL360, and 1 DL380 (all are G4). We configured iLO and went away. Oh, I forgot to tell you we also plugged back our beloved &#8220;bob&#8221;, our build machine (lame joke, isn&#8217;t it?).</p>
<p>I couldn&#8217;t resist to play with them.</p>
<p>I wanted to see how FreeBSD-update can deal with branches and not releases, even if it&#8217;s not designed for. Important note: I DON&#8217;T USE IT IN PRODUCTION IT&#8217;S FOR TESTING PURPOSE ONLY. But if it works&#8230; why not :-) I won&#8217;t describe how to use tinderbox to build packages. It&#8217;s quite easy: build packages, build INDEX, create subdirectories in ftp root, copy packages, and it&#8217;s done. iLO allows you to grab remote video/keyboard. Perfect to install FreeBSD over PXE, comfortably sat in my working chair.</p>
<p>Here&#8217;s what I have:</p>
<ul>
<li>a build server with free CPU cycles and disk space</li>
<li>an up-to-date copy of  FreeBSD  CVS</li>
<li>test servers</li>
<li>few hours</li>
<li>coffee, beer and cigarettes</li>
</ul>
<p>First part of the job is to make a base release. I decided to use a vanilla release, to avoid conflicts later. Since I want to play with FreeBSD-update, let I make a release just after it gets committed.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>More <a href="http://www.cotds.org/~clement/pflsa-0.0.1-alpha/blog-entry.txt">here</a>&#8230; because I didn&#8217;t manage to make it look &#8220;nice&#8221; in wp.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.freebsdish.org/clement/2006/10/02/uabumisusing-software-to-install-and-update-freebsd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PXE for lazy sysadmins (part II &#8211; pflsa-0.0.1-alpha)</title>
		<link>http://blogs.freebsdish.org/clement/2006/07/29/pxe-for-lazy-sysadmins-part-ii-pflsa-001-alpha/</link>
		<comments>http://blogs.freebsdish.org/clement/2006/07/29/pxe-for-lazy-sysadmins-part-ii-pflsa-001-alpha/#comments</comments>
		<pubDate>Sat, 29 Jul 2006 18:31:23 +0000</pubDate>
		<dc:creator>clement</dc:creator>
				<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://blogs.freebsdish.org/clement/2006/07/29/pxe-for-lazy-sysadmins-part-ii-pflsa-001-alpha/</guid>
		<description><![CDATA[I finally got time and motivation to start writing pflsa. Code is pretty ugly. My PHP skills suck and it seems it prevents me from putting some decent logic in it. I will surely be rewritten, it&#8217;s still in proof-of-concept-mode. What did change? pxe_conf_url became pxe.conf.url and pxe_post_install_script_url is no longer used, moved to &#8220;${pxe.conf.url}?getscript&#8221;. [...]]]></description>
				<content:encoded><![CDATA[<p>I finally got time and motivation to start writing pflsa. Code is pretty ugly. My PHP skills suck and it seems it prevents me from putting some decent logic in it. I will surely be rewritten, it&#8217;s still in proof-of-concept-mode.</p>
<p>What did change?</p>
<ul>
<li>pxe_conf_url became pxe.conf.url  and pxe_post_install_script_url is no longer used, moved to &#8220;${pxe.conf.url}?getscript&#8221;.</li>
<li>The configuration format changed too:
<ol>
<li>It&#8217;s splitted in 3 parts %sysinstall, %packages and %post (a la kickstart ;-))</li>
<li>in %sysinstall nothing changed. Except you can use ${size}K/M/G/T/P/E to define partition sizes, instead of number of sectors. installCommit is automatically added. If you have wishes about this part, ping me.</li>
<li>%package target is just a list of packages. pflsa translates it into sysintall format.</li>
<li>%post is actually a list of shell commands. When script is retrivied, pflsa will preprend shebang and few ready-to-go functions (to set timezone, enable services, set root password). I plan to add more functions: gmirror, adding users, etc. Here again, if you have ideas, ping me.</li>
</ol>
</li>
<li>Per IP config support, with fallback to default.conf</li>
<li>Brownser friendly viewing (not yet finished  and lamely based on User Agent).</li>
<li>I also add to pxe_crunch gdi (grab disk infos), with libdisk. I don&#8217;t really know if I&#8217;ll keep, do you need to inform pflsa about disk names/sizes?</li>
</ul>
<p>If you want to have a look at pflsa files (source are not released yet, it&#8217;s too ugly ;)) it&#8217;s <a href="http://www.cotds.org/~clement/pflsa-0.0.1-alpha/">here</a>.</p>
<p>Now it&#8217;s time for me to prepare dinner ;-) after that I&#8217;ll review gabor&#8217;s DESTDIR patch, and update apache ports.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.freebsdish.org/clement/2006/07/29/pxe-for-lazy-sysadmins-part-ii-pflsa-001-alpha/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PXE for lazy sysadmins (part I &#8211; proof of concept)</title>
		<link>http://blogs.freebsdish.org/clement/2006/07/27/pxe-for-lazy-sysadmins-part-i-proof-of-concept/</link>
		<comments>http://blogs.freebsdish.org/clement/2006/07/27/pxe-for-lazy-sysadmins-part-i-proof-of-concept/#comments</comments>
		<pubDate>Thu, 27 Jul 2006 13:20:53 +0000</pubDate>
		<dc:creator>clement</dc:creator>
				<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://blogs.freebsdish.org/clement/2006/07/27/pxe-for-lazy-sysadmins-part-i-proof-of-concept/</guid>
		<description><![CDATA[In few weeks, I&#8217;ll have to upgrade our 2 clusters from old customised redhat 7.3 linux to FreeBSD 6-STABLE. The preliminary tasks are already done: applications are now FreeBSD friendly, they have been ports-ified too, config files are ready to be deployed. It sounds really good doesn&#8217;t it? But I have a big constraint: I [...]]]></description>
				<content:encoded><![CDATA[<p>In few weeks, I&#8217;ll have to upgrade our 2 clusters from old customised redhat 7.3 linux to FreeBSD 6-STABLE.  The preliminary tasks are already done: applications are now FreeBSD friendly, they have been ports-ified too, config files are ready to be deployed.  It sounds really good doesn&#8217;t it? But I have a big constraint: I have to install one of the clusters in 3 hours. The only way to install ten servers in this timeframe is to use PXE. I already use PXE for basic installations, but here I must install ready-to-go servers. The cluster is also made of 3 different kinds of servers. I need to support different NICs, types of disk and even set up software RAID on one box.  How can I do with our PXE stuff? I was dreaming of kickstart for FreeBSD ;-) I was thinking about patching sysinstall, but I&#8217;m too lazy :-)  Let&#8217;s cheat!</p>
<p>(you can download a tarball with files and scripts <a href="http://www.cotds.org/~clement/PXE/part1/pxe.tar.gz">here</a>. Warning ! it&#8217;s quick and dirty !)</p>
<p>Prerequires:</p>
<ul>
<li>FreeBSD source of the desired version</li>
<li>A FreeBSD ISO image</li>
<li>a Web and a FTP servers</li>
<li>a working PXE installation (<a href="http://typo.submonkey.net/articles/2006/02/12/">Ceri&#8217;s post on PXE)</a></li>
</ul>
<p>Basically, the idea is the to fetch a configuration file at the begining of sysinstall process, load it into sysinstall, commit install, fetch a post-install script and finally run it.</p>
<ol>
<li><b>Cook mfsroot</b> (please read Ceri&#8217;s post to know how to play with it)<br />
First of all we have modify the mfsroot image to add fetch(1), our install.cfg and a simple script to fetch/configure our sysinstall.<br />
To add fetch, we need to regenerate boot_crunch to support fetch, like this one: <a href="http://www.cotds.org/~clement/PXE/part1/pxe_crunch.conf">pxe_crunch.conf</a>.<i><br />
mkdir crunch</i><br />
<i> cd crunch</i><br />
<i> fetch http://www.cotds.org/~clement/PXE/part1/pxe_crunch.conf</i><br />
<i> crungen pxe_crunch.conf</i><br />
<i> make -f pxe_crunch.mk</i><br />
<i> cd ..</i><br />
Mount mfsroot in a directory called mfsfd. Now we repopulate /stand with our new binary.cd mfsfd/stand<br />
<i> rm *<br />
install 755 ../../crunch/pxe_crunch .<br />
for i in $(crunchgen -l ../../pxe_crunch.conf); do ln pxe_crunch ${i} ; done<br />
install -m 755 /sbin/dhclient-script .</i>Now we install our small <a href="http://www.cotds.org/~clement/PXE/part1/install.cfg">install.cfg </a>and the <a href="http://www.cotds.org/~clement/PXE/part1/fetch_config.sh">fetch_config.sh</a> script<i> fetch http://www.cotds.org/~clement/PXE/part1/install.cfg<br />
fetch http://www.cotds.org/~clement/PXE/part1/fetch_config.sh<br />
chmod +x fetch_config.sh<br />
cd ..<br />
mkdir -p var/db tmp var/run</i><br />
Umount mfsroot and copy it in you boot/ directory in your nfs share.</li>
<li><b>Populate web server<br />
</b>On your webserver, install pxe.conf and pxe.sh<br />
<i>mkdir ${DOCUMENTROOT}/pxeinstall<br />
cd </i><i>${DOCUMENTROOT}/pxeinstall</i><br />
<i> fetch  http://www.cotds.org/~clement/PXE/part1/pxe.conf<br />
fetch http://www.cotds.org/~clement/PXE/part1/pxe.sh<br />
</i><br />
Edit those files to suit your needs.<br />
<i> vi pxe.conf pxe.sh<br />
</i><br />
If you want to install FreeBSD via the interface PXE used, keep %%IFNAME%% as netDev value.<br />
Currently disk support is not yes available. It will be supported soon.<br />
pxe.sh is executed in post-install stage so you can use previously installed stuff, like perl or so. It&#8217;s a live system so beware :)<br />
<b>Note:</b> don&#8217;t put stuff in /etc/rc.conf, it will be commented out. Use /etc/rc.conf.local instead.<br />
<b>Note 2:</b> you can put those file on the FTP server instead.</li>
<li><b>Populate FTP server</b><br />
<i>mkdir ${FTPROOT}/pub/FreeBSD/releases/i386/<br />
tar xvf /path/to/6.1-RELEASE-i386-disc1.iso 6.1-RELEASE ${FTPROOT}/pub/FreeBSD/releases/i386/</i></li>
<li><b>Edit boot/loader.rc</b><br />
We use loader.rc to set 2 variables: pxe_conf_url and pxe_post_install_script_url.<br />
Your loader.rc shoud look like this:<br />
<i>load /boot/kernel/kernel<br />
load -t mfs_root /boot/mfsroot<br />
set vfs.root.mountfrom=&#8221;ufs:/dev/md0c&#8221;<br />
set pxe_conf_url=&#8221;http://www.yourwebserver.org/pxeinstall/pxe.conf&#8221;<br />
set pxe_post_install_script_url=&#8221;http://www.yourwebserver.org/pxeinstall/pxe.sh&#8221;<br />
boot</i></li>
<li><b>The end</b><br />
Boot your machine via PXE and it should be ok :-)</li>
</ol>
<p>The future is to replace hard-coded pxe.conf et pxe.sh for a php script to generation config file/script on the fly. pxe.sh should be improved to make gmirror configuration, nss stuff, and more (like data restoration via bacula for example). I&#8217;ll surely add more functions when it get rewriten.</p>
<p>FYI, I use my own FreeBSD release, packages are built in marcuscom tinderbox and a script to generate INDEX file. I also use a meta-port to avoid polluting pxe.conf.</p>
<p>See ya for part II&#8230; if any :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.freebsdish.org/clement/2006/07/27/pxe-for-lazy-sysadmins-part-i-proof-of-concept/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
