From owner-freebsd-current@FreeBSD.ORG Sun Sep 27 11:45:18 2009 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 204CB1065670 for ; Sun, 27 Sep 2009 11:45:18 +0000 (UTC) (envelope-from kraduk@googlemail.com) Received: from mail-fx0-f222.google.com (mail-fx0-f222.google.com [209.85.220.222]) by mx1.freebsd.org (Postfix) with ESMTP id 9ECA38FC1C for ; Sun, 27 Sep 2009 11:45:17 +0000 (UTC) Received: by fxm22 with SMTP id 22so3387838fxm.36 for ; Sun, 27 Sep 2009 04:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=6/EoqjZI7WnOOTC8nrmLnks0VaZXCMhKxsjlVGih2G4=; b=iDiUwbtqrZd85SDV/kWpSkq/kyI40SOGDPDIw/TmYKMHjWK1UEFw4tkka/P234qRlL 1UzocPcJXpfucgY2rsUVR3uyBItJRf7E84Z+AKfDwhbIWhm92st/+NHMXTk7HZc1BdKV NwrbcLBc6nXJ7dLEqOyNqh3X4MpHg/wyJ39Yo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=TS9uCxiDSMSuaayiLsornA5rxFjzJylxrcS8G9sl19wdLzOroZLLz8NChLHnvvT3rQ 5g10BuoIzTiCgfTDAPT+Ytkv6lI+d6RCRqqKg7SYCPzTCl+T1vMduxgY5IgGLg4diPDM fTjotNjdZuG6RUKvool3f5S6j3Eaz6QkW0IgI= MIME-Version: 1.0 Received: by 10.239.168.138 with SMTP id k10mr210432hbe.100.1254051916408; Sun, 27 Sep 2009 04:45:16 -0700 (PDT) Date: Sun, 27 Sep 2009 12:45:16 +0100 Message-ID: From: krad To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: make world on a zfs system 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: Sun, 27 Sep 2009 11:45:18 -0000 HI, I have a pure zfs system at home, and was interested in how most others are implementing theirs with regard to the os installation. Most of the guides I have seen have a zpool eg system made up of mirrored/raided vdevs, but they usually install the os on the root zfs fs for that pool, and have that in loader.conf eg vfs.root.mountfrom="zfs:system" I have done this slightly differently on my system. I initially installed onto /system/root. Therefore my loader.conf has the following line vfs.root.mountfrom="zfs:system/root" Nothing special there. However this next bit is the cool bit. Next time i want to upgrade the os i do one of the following zfs snapshot system/root@20090926 # if i want speed zfs clone system/root@20090926 system/root_20090926 # or better way but a bit slower (2-3 mins) zfs send system/root@20090926 | zfs receive system/root_20090926 I tend to use the send and receive, as disk space isn't really an issue and I dont like having the dependency that you clones as it makes it more complicated to delete old file systems. Now lets install the new os zfs set mountpoint=legacy system/root_20090926 mount -t zfs system/root_20090926 /mnt sed -i -e "system\/root\"/system\/root_20090926\"/" /mnt/boot/loader.conf export DESTDIR=/mnt cd /usr/src make installkernel && make installworld zpool set bootfs=system/root_20090926 system mergmaster init 6 The system will now boot onto the new filesystem. If there is a problem I can just boot in with my rescue usb stick and flip the bootfs flag back and bang im back in the old os. Why not just use snapshots I hear you say. Well if I roll back the os I have lost the new stuff I have installed. This is ok in terms of getting the os back up. However in terms of getting the new installation fixed this isn't much help. This way I can flip flop back and two between the installations. This could be ideal for people who want to have a quick look at current every now and again. It would be really cool if this type of thing could get integrated into the make world scripts. Before anyone points out I did steal this idea from opensolaris. Ideally I need to do is see if I can get something built into beastie, to choose the bootfs for the pool. I'm not sure this is viable, as once you have started to load the loader, you must have chosen the bootfs. Has anyone looked at this already and can they offer any advice?