From owner-freebsd-current@FreeBSD.ORG Thu Jan 29 22:41:48 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 0D6C610657BB for ; Thu, 29 Jan 2009 22:41:48 +0000 (UTC) (envelope-from cryx-freebsd@h3q.com) Received: from mail.h3q.com (mail.h3q.com [213.73.89.199]) by mx1.freebsd.org (Postfix) with ESMTP id 92D4A8FC1E for ; Thu, 29 Jan 2009 22:41:47 +0000 (UTC) (envelope-from cryx-freebsd@h3q.com) Received: (qmail 33060 invoked from network); 29 Jan 2009 22:41:46 -0000 Received: from unknown (HELO goa.local) (smtpsend@85.179.24.35) by mail.h3q.com with AES256-SHA encrypted SMTP; 29 Jan 2009 22:41:46 -0000 Message-ID: <498230AA.8080803@h3q.com> Date: Thu, 29 Jan 2009 23:41:46 +0100 From: Philipp Wuensche User-Agent: Thunderbird 2.0.0.19 (Macintosh/20081209) MIME-Version: 1.0 To: das@FreeBSD.ORG References: <4981EBC6.1000907@h3q.com> <20090129215720.GA2889@zim.MIT.EDU> In-Reply-To: <20090129215720.GA2889@zim.MIT.EDU> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-current@FreeBSD.ORG Subject: Re: Solaris live upgrade like FreeBSD ZFS-rootfs update 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: Thu, 29 Jan 2009 22:41:49 -0000 David Schultz wrote: > > But since both ZFS and UFS support snapshots now, it would be > great if the process were something like: > > - drop to single user mode > - take snapshots of / and /usr > - install everything > - reboot > > But if something goes wrong, only ZFS has the ability to roll back > to the last snapshot, and even then I'm not sure if you can > actually boot from that snapshot in order to recover. You can't boot from a snapshot, but you can boot off a cloned filesystem and that is more or less what this script does. - It creates a snapshot of your known-good root-filesystem - It clones this snapshot into a new root-filesystem (requiring no additional disc-space!) which you then update to the new freebsd version - It configures the zpool to boot from the new root-filesystem The known-good root-filesystem is not touched in any way and in case anything goes wrong you can still boot from it. As of now we can't select a root-filesystem in the loader to load kernel and userland from, so it still involves two reboots to be able to go back to the known-good root-filesystem without getting stuck in a broken kernel or userland. This is due to the fact that the loader currently blindly loads the kernel from the root-filesystem configured in the zpool bootfs property and if this kernel is broken or the userland you would boot from this filesystem is damaged, you are screwed as you are not able to set the bootfs property back to the known-good root-filesystem. If we could select a root-filesystem in the loader it would be down to one reboot without any drop to single-user or risk getting stuck in an unusable system. greetings, Philipp