From owner-freebsd-current@FreeBSD.ORG Sat Oct 6 09:18:58 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C02E16A418 for ; Sat, 6 Oct 2007 09:18:58 +0000 (UTC) (envelope-from askbill@conducive.net) Received: from conducive.net (lindfield.ch [203.194.153.81]) by mx1.freebsd.org (Postfix) with ESMTP id D150713C47E for ; Sat, 6 Oct 2007 09:18:57 +0000 (UTC) (envelope-from askbill@conducive.net) Received: from cm218-253-81-177.hkcable.com.hk ([218.253.81.177]:59503 helo=pb.local) by conducive.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1Ie5oG-0009Ta-2N for freebsd-current@freebsd.org; Sat, 06 Oct 2007 09:18:56 +0000 Message-ID: <470752FF.3080100@conducive.net> Date: Sat, 06 Oct 2007 05:18:55 -0400 From: =?UTF-8?B?6Z+T5a625qiZIEJpbGwgSGFja2Vy?= User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.2) Gecko/20070221 SeaMonkey/1.1.1 MIME-Version: 1.0 To: freebsd-current@freebsd.org References: <124F2247-634C-4796-B69C-2920FA8326F5@ish.com.au> <47073894.6080205@FreeBSD.org> In-Reply-To: <47073894.6080205@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Installing a system onto ZFS X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Oct 2007 09:18:58 -0000 Stefan Esser wrote: > Aristedes Maniatis wrote: >> Yesterday I tried to install (using the August 2007 snapshot iso) a new >> FreeBSD system using ZFS. This is what I did: >> >> * boot from CD >> * type "load ZFS" on the boot loader prompt (could this be made default >> for FreeBSD 7 release?) >> * drop into the live CD shell and use fdisk, disklabel and zfs to create >> the appropriate partitions (/boot which is UFS2 and /usr /tmp /var / >> which are ZFS). ZFS volumes are created inside ad4s1d. >> >> A problem is then that the installer tries to mount the partitions and >> presumably knows nothing about the ZFS partitions I mounted within the >> live CD shell. Is there a way to do this, or am I expecting too much of >> the installer tool at this early stage of ZFS in FreeBSD? >> >> It appears that the only alternative is to install a full system onto >> UFS2 partitions, install a second disk with ZFS volumes, copy across the >> data and set up the boot loader on the second drive, then discard the >> first drive. Is that what others are doing? > > What I do is install a minimal system into the UFS root (ad4s1a or > whatever, to become the boot partition). Then I create the ZFS > volumes from within, mounted on a temporary mount-point and copy > over the whole contents of the minimum installation. After that, I > fix the fstab entry in ZFS and prepare mounting of the boot partition > on a directory in the ZFS root (fstab, mount point). Finally, I add > the boot_from entry to /boot/loader.conf (on the boot partition). > > After booting for the first time with a ZFS root (the temporary > mount point where the ZFS file system have been initially mounted > after creation is ignored, if a ZFS file system is accepted as the > root file system), I clean up the UFS boot partition to only hold > /boot, rescue (and for the time being /bin, /lib and /etc, which > allows to override the root partition from the loader and instead > boot with a minimal UFS root again ...) > > > In short: Minimal install to (e.g.) ad4s1a (where ad4s1 also has a > reasonably sized SWAP and the rest as ad4s1d for ZFS). Just select > to create a 512MB root FS in the installer, the swap partition and > use the rest for an UFS partition to be mounted on a dummy mount > point (which you are going to unmount before you start creating > ZFS file systems in that space). Then proceed as normal with the > installation, boot to single user, create ZFS pool and file systems, > copy over the contents of the UFS file system, patch fstab and > loader.conf and create a mount point for /boot reboot and you are > running on a ZFS root without the need for a second disk drive. > > > This does not take half as long as the text may suggest, and the > minimal installation is small enough to fit into a reasonably sized > boot partition (I use 512MB, since I often keep multiple old kernels, > but 256 should be enough and you might even get along with 128MB, > but I never tried that since it is too small to keep my kernels). > > Regards, STefan Your description, with perhaps a bit of editing, looks like something that might be a good addition to docs and howto's. Unless someone has an even faster, simpler more robust way? Bill