From owner-freebsd-doc@FreeBSD.ORG Mon Sep 5 23:08:49 2011 Return-Path: Delivered-To: freebsd-doc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63B71106564A; Mon, 5 Sep 2011 23:08:49 +0000 (UTC) (envelope-from kaduk@mit.edu) Received: from dmz-mailsec-scanner-6.mit.edu (DMZ-MAILSEC-SCANNER-6.MIT.EDU [18.7.68.35]) by mx1.freebsd.org (Postfix) with ESMTP id E02D58FC1C; Mon, 5 Sep 2011 23:08:48 +0000 (UTC) X-AuditID: 12074423-b7b31ae000000a3c-70-4e6556821c60 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP id 2E.FE.02620.286556E4; Mon, 5 Sep 2011 19:08:50 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id p85N8lnW011136; Mon, 5 Sep 2011 19:08:47 -0400 Received: from multics.mit.edu (MULTICS.MIT.EDU [18.187.1.73]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id p85N8jwV026891 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 5 Sep 2011 19:08:47 -0400 (EDT) Received: (from kaduk@localhost) by multics.mit.edu (8.12.9.20060308) id p85N8ivW002915; Mon, 5 Sep 2011 19:08:44 -0400 (EDT) Date: Mon, 5 Sep 2011 19:08:44 -0400 (EDT) From: Benjamin Kaduk To: Craig Rodrigues In-Reply-To: <20110903000815.GA72769@glenbarber.us> Message-ID: References: <20110903000815.GA72769@glenbarber.us> User-Agent: Alpine 1.10 (GSO 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHIsWRmVeSWpSXmKPExsUixCmqrNsUlupn8GCelMWpM12sFvubD7BZ fNg9i8mB2eP67fXMHjM+zWcJYIrisklJzcksSy3St0vgyjgw9yJjwWnrig+Nb5kaGCfqdzFy ckgImEg833qNCcIWk7hwbz1bFyMXh5DAPkaJd087GCGc9YwS+x6fgsrsZ5JovX2QBaRFSKBe om36ITCbRUBL4vG388wgNpuAisTMNxvZQGwRAR2Jr7/WMoLYzAJWEqu2LgSzhQVMJW60z2Hv YuTg4BQwlri4ih0kzCvgIPHk3DRmiF1bmSQWbesAmy8KNGf1/iksEEWCEidnPmGBmGkp8W/t L9YJjIKzkKRmIUktYGRaxSibklulm5uYmVOcmqxbnJyYl5dapGuml5tZopeaUrqJERS07C7K Oxj/HFQ6xCjAwajEw/tgZbKfEGtiWXFl7iFGSQ4mJVHeH6GpfkJ8SfkplRmJxRnxRaU5qcWH GCU4mJVEeOd9TvET4k1JrKxKLcqHSUlzsCiJ88rsdPATEkhPLEnNTk0tSC2CycpwcChJ8P4C GSpYlJqeWpGWmVOCkGbi4AQZzgM0/ANIDW9xQWJucWY6RP4Uoy7HlbNLjjMKseTl56VKifMe AykSACnKKM2DmwNLNq8YxYHeEub9CFLFA0xUcJNeAS1hAlriapUEsqQkESEl1cB4tFbBvNxn Vl3Zhc9e3cfXJfEtWXUg6CL7tPIVl8V12BzeWxslrs/5zVf49w9zj9kMhmfKRj9K7i2csdzt yLlnrBtefuzetv+r2+y9YWkyGy+d4yqz5Et2STdb9NfkxMz//s8XcUTqxH++/mXToYmmU9c/ eC/5Oadzc37QUvdfH8+WTRGMk31Xp8RSnJFoqMVcVJwIAJ8imYIRAwAA Cc: freebsd-doc@freebsd.org Subject: Re: PXE Booting with an NFS root file system X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Sep 2011 23:08:49 -0000 Sorry for jumping in late; mail backed up this week while meeting a deadline for work. On Fri, 2 Sep 2011, Glen Barber wrote: > Craig Rodrigues wrote: >> Hi, >> >> I have incorporated more feedback from Glen Barber and Ryusuke Suzuki. >> > > Hi Craig, > > Comments are in-line (not many): > > Index: en_US.ISO8859-1/books/handbook/advanced-networking/chapter.sgml > =================================================================== > RCS file: /home/dcvs/doc/en_US.ISO8859-1/books/handbook/advanced-networking/chapter.sgml,v > retrieving revision 1.436 > diff -u -r1.436 chapter.sgml > --- en_US.ISO8859-1/books/handbook/advanced-networking/chapter.sgml 18 Feb 2011 18:10:36 -0000 1.436 > +++ en_US.ISO8859-1/books/handbook/advanced-networking/chapter.sgml 2 Sep 2011 21:19:42 -0000 > @@ -4171,6 +4175,304 @@ > > > > + > + > + > + > + Craig > + Rodrigues > + > +
rodrigc@FreeBSD.org
> +
> + Written by > +
> +
> +
> + PXE Booting with an NFS root file system > + > + The &intel; Preboot eXecution Environment (PXE) > + allows booting the operating system over the network. > + PXE support is usually provided in the > + BIOS of modern motherboards, where > + it can be enabled in the BIOS settings > + which enable booting from the network. A fully functioning > + PXE setup also requires properly configured > + DHCP and TFTP servers. > + > + When the host computer boots, it receives information over > + DHCP about where to obtain the initial boot > + loader via TFTP. After the host computer receives this information, > + it downloads the boot loader via TFTP, and then > + executes the boot loader. This is documented section 2.2.1 of the "in section 2.2.1" > + Preboot Execution Environment (PXE) Specification. > + In &os;, the boot loader retrieved during the PXE > + process is /boot/pxeboot. After > + /boot/pxeboot executes, the &os; kernel is > + loaded, and the rest of the &os; bootup sequence proceeds. > + Refer to The FreeBSD Booting Process > [...] > +myhost.example.com:/b/tftpboot/FreeBSD/install / nfs ro 0 0 > + > + > + Replace myhost.example.com > + with the hostname or IP address of your NFS > + server. In this example, the root file system is mounted > + "read-only" in order to prevent NFS > + clients from potentially deleting the contents of the root > + file system. > + > + > + > + &prompt.root; chroot ${NFSROOTDIR} > +&prompt.root; passwd This is setting the root password for the client machine which is PXE booting? It is probably worth mentioning explicitly. > + > + > + > + Enable ssh root logins in > + ${NFSROOTDIR}/etc/ssh/sshd_config > > There is a missing "." after . It might be worth also mentioning the name of the configuration option, PermitRootLogin. > > + > + > + > + Customize the ${NFSROOTDIR} by using &man.chroot.8;. In the > + chroot environment, the ${NFSROOTDIR} can be > + customized by doing things like adding packages with > + pkg_add, editing the password file with > + &man.vipw.8;, editing &man.amd.conf.5; maps for automounting, > + etc. For example: > + > + > +&prompt.root; chroot ${NFSROOTDIR} > +&prompt.root; pkg_add -r bash > + > + > + > + > + > + Configuring Memory File Systems used by <filename>/etc/rc.initdiskless</filename> > + > + If you boot from an NFS root volume, > + /etc/rc > + detects that you booted over NFS and runs > + /etc/rc.initdiskless. > + Read this script to understand what is going on. We need to make > + /etc and /var memory backed > + file systems because these directories need to be writable, but > + the NFS root directory is read-only. > + > + > +&prompt.root; chroot ${NFSROOTDIR} > +&prompt.root; mkdir -p conf/base > +&prompt.root; tar -c -v -f conf/base/etc.cpio.gz --format cpio --gzip etc > +&prompt.root; tar -c -v -f conf/base/var.cpio.gz --format cpio --gzip var > + > + When system boots, memory file systems for Missing "the" before "system boots". > + /etc and /var > + will be created and mounted, and the contents of the > + cpio.gz files will be copied into them. > + > + > + > + Setting up the DHCP Server > + > + PXE requires a TFTP server and a > + DHCP server to be set up. The > + DHCP server does not necessarily need > + to be the same machine as the TFTP server, > + but it needs to be accessible in your network. > + > + > + > + Install the DHCP server by following > + the instructions documented at > + Installing and Configuring a DHCP Server > + in the &os; Handbook. Make sure that /etc/rc.conf > + and /usr/local/etc/dhcpd.conf > + are correctly configured. > + > + > + > + In /usr/local/etc/dhcpd.conf, configure > + the next-server, filename, > + and option root-path settings, > + to specify your TFTP server IP address, > + the path to /boot/pxeboot in > + TFTP, and the path to NFS "the NFS root file system" (add 'the') Thanks a lot for putting this together; it will be really helpful! -Ben Kaduk > + root file system. Here is a sample dhcpd.conf > + setup: > + > + > +subnet 192.168.0.0 netmask 255.255.255.0 { > + range 192.168.0.2 192.168.0.3 ; > + option subnet-mask 255.255.255.0 ; > + option routers 192.168.0.1 ; > + option broadcast-address 192.168.0.255 ; > + option domain-name-server 192.168.35.35, 192.168.35.36 ; > + option domain-name "example.com";