From owner-freebsd-questions@FreeBSD.ORG Tue Mar 11 01:48:56 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A708875 for ; Tue, 11 Mar 2014 01:48:56 +0000 (UTC) Received: from holgerdanske.com (holgerdanske.com [184.105.128.27]) by mx1.freebsd.org (Postfix) with SMTP id 9070BCF9 for ; Tue, 11 Mar 2014 01:48:56 +0000 (UTC) Received: from ::ffff:184.23.143.12 ([184.23.143.12]) by holgerdanske.com for ; Mon, 10 Mar 2014 18:48:53 -0700 Message-ID: <531E6B85.6030903@holgerdanske.com> Date: Mon, 10 Mar 2014 18:48:53 -0700 From: David Christensen User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20131104 Icedove/17.0.10 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: Re: FreeBSD 10 installer and ZFS root References: <53197EF6.4070902@holgerdanske.com> <5319913D.4040207@infracaninophile.co.uk> <10334f5b74b05d9445d071bd08f73a24@dweimer.net> <531A0A0B.3010902@holgerdanske.com> <531D51EF.1080804@holgerdanske.com> <531D6737.4020708@infracaninophile.co.uk> <531E0287.6060907@holgerdanske.com> <1cb801cf3c9a$2c7e7970$857b6c50$@FreeBSD.org> In-Reply-To: <1cb801cf3c9a$2c7e7970$857b6c50$@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 01:48:56 -0000 On 03/10/2014 12:51 PM, dteske@FreeBSD.org wrote: > The installer makes ada0s1a a mirrored vdev so that any disk in the pool > can be booted from. Imagine what would happen if you had only a single > boot partition that was not mirrored and you lost that drive? Okay. If/ when a second disk is added as a mirror, ZFS will maintain the mirror. But what about everything else -- partition table, boot manager/ loader(s), swap, root, whatever? > And the installer is scriptable. > Try executing the following command to see how it can be scripted... > awk '/GLOB/{exit}/CONFIG/,/GLOB/&&/^[A-Z]+=/{print}' \ > /usr/libexec/bsdinstall/scripts/zfsboot | less /usr/libexec/bsdinstall/scripts/zfsboot does not exist on my installation DVD: root@p43200:~ # mkdir /media/cdrom root@p43200:~ # mount_cd9660 /dev/cd0 /media/cdrom root@p43200:~ # ls /media/cdrom/usr/libexec/bsdinstall/scripts/zfsboot ls: /media/cdrom/usr/libexec/bsdinstall/scripts/zfsboot: No such file or directory But /media/cdrom/usr/libexec/bsdinstall/zfsboot does: root@p43200:~ # find /media/cdrom/usr/libexec/bsdinstall/ -name zfsboot /media/cdrom/usr/libexec/bsdinstall/zfsboot root@p43200:~ # less /media/cdrom/usr/libexec/bsdinstall/zfsboot It is clear that zfsboot is one piece in a much larger puzzle. >> If the installer boot loader creates a RAM disk, copies the installer >> suite to there, and then lights it off, I might be able to choose Shell >> early on, edit the right script, and then re-launch the installer. > Yes, or create a /etc/installerconfig that sets ZFSBOOT_* variables > before kicking off "bsdinstall zfsboot" (and later the distextract, etc.). > HINT: If /etc/installerconfig exits with failure status, nothing else is > performed before reboot (allowing you to control the install 100% by > calling the various parts to the installation). Setting variables in a text file is a possibility. But, not everything is controlled by a variable. I crawled through zfsboot and found the spot where the root partition is created for MBR (lines 757-758). Unfortunately, there is no size variable (gpart uses the rest of the disk). David