From owner-freebsd-stable@FreeBSD.ORG Fri Nov 14 19:41:13 2008 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B2C91065672 for ; Fri, 14 Nov 2008 19:41:13 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.9.129]) by mx1.freebsd.org (Postfix) with ESMTP id 2BE638FC21 for ; Fri, 14 Nov 2008 19:41:13 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 346A173098; Fri, 14 Nov 2008 20:45:34 +0100 (CET) Date: Fri, 14 Nov 2008 20:45:34 +0100 From: Luigi Rizzo To: stable@freebsd.org Message-ID: <20081114194534.GA64986@onelab2.iet.unipi.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: Subject: diskless+pxe notes X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Nov 2008 19:41:13 -0000 Hi, i finally decided to try and use pxeboot to replace the etherboot method I was using so far for diskless setups. The goal is to fully share the server's root and /usr directories, as documented in diskless(8). I'd like to share the following notes, hopefully to go in the manpage. cheers luigi -------------- root path configuration ----------------- There seems to be a well known problem in pxeloader, see kern/106493 , where pxeloader defaults to using a root path of /pxeroot when offered "/" . The patch suggested in http://www.freebsd.org/cgi/query-pr.cgi?pr=106493 is trivial and judging from it I believe this is addressing a true bug and not a feature. Fortunately there is a workaround (suggested in the PR) which is using "//" as a root path. ------------- sharing /boot with the server --------------- I believe it is quite useful to share the whole root partition between the server and the diskless client. This would require at a minimum some conditional code in loader.conf (or loader.rc, etc) so that at least you point to different kernels. A minimalistic approach can be adding this line to /boot/loader.conf bootfile="kernel\\${loaddev};kernel" The variable $loaddev contains the name of the load device, which is "pxe0" in the case of pxeboot, and disk* in other cases when loading from the local disk. If you make sure that there is no 'kernel.disk*' on the directory, and instead there is a kernel.pxe0 in the same directory, then the diskless machines and the server will boot from the proper file. Unfortunately i don't know how to implement a conditional in /boot/loader.conf -- otherwise one could do much nicer things such as differentiate which modules to load and so on. --------------- pxeloader bug in 7.x --------------------------- Also worth mentioning is an annoying bug in pxeloader as compiled on 7.x, see http://www.freebsd.org/cgi/query-pr.cgi?pr=118222 i.e. the pxeloader in 7.x fails to proceed and prints a message "can't figure out which disk we are booting from". The workaround is using a pxeloader from FreeBSD6 works. I guess this is a compiler-related problem (given that 6.x uses gcc 3.4 as a compiler, while 7.x uses gcc 4.2). -----------------------------------------------------------------