Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Mar 2014 18:48:53 -0700
From:      David Christensen <dpchrist@holgerdanske.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: FreeBSD 10 installer and ZFS root
Message-ID:  <531E6B85.6030903@holgerdanske.com>
In-Reply-To: <1cb801cf3c9a$2c7e7970$857b6c50$@FreeBSD.org>
References:  <53197EF6.4070902@holgerdanske.com> <5319913D.4040207@infracaninophile.co.uk> <10334f5b74b05d9445d071bd08f73a24@dweimer.net> <531A0A0B.3010902@holgerdanske.com> <eca03739afb425884241ed23c4202a7b@dweimer.net> <531D51EF.1080804@holgerdanske.com> <531D6737.4020708@infracaninophile.co.uk> <531E0287.6060907@holgerdanske.com> <1cb801cf3c9a$2c7e7970$857b6c50$@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?531E6B85.6030903>