From owner-freebsd-stable@FreeBSD.ORG Fri May 27 14:16:52 2011 Return-Path: Delivered-To: freebsd-stable@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3C55106564A; Fri, 27 May 2011 14:16:52 +0000 (UTC) (envelope-from tzim@tzim.net) Received: from orlith.tzim.net (unknown [IPv6:2001:41d0:2:1d32:21c:c0ff:fe82:92c6]) by mx1.freebsd.org (Postfix) with ESMTP id 516618FC08; Fri, 27 May 2011 14:16:52 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=secure.tzim.net) by orlith.tzim.net with esmtp (Exim 4.76 (FreeBSD)) (envelope-from ) id 1QPxqN-000Ew8-A7; Fri, 27 May 2011 16:16:51 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 27 May 2011 16:16:51 +0200 From: Arnaud Houdelette To: Andriy Gapon In-Reply-To: <4DDF8E02.4060108@FreeBSD.org> References: <63454684d7d46c2ef76cfcc979500612@tzim.net> <4DDF8E02.4060108@FreeBSD.org> Message-ID: X-Sender: tzim@tzim.net User-Agent: RoundCube Webmail/0.5.2 Cc: freebsd-stable@FreeBSD.org Subject: Re: zfs-root and "safe" atomic updates X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 14:16:52 -0000 On Fri, 27 May 2011 14:41:54 +0300, Andriy Gapon wrote: > on 27/05/2011 14:08 tzim@tzim.net said the following: >> I use zfs on / for quite some time now on 8-stable. >> >> Each time I want to update base, I use those steps : >> >> - zfs snapshot tank/root@old >> - zfs clone tank/root@old tank/root.old >> - csup / Rebuild world and kernel >> - install world & kernel >> - reboot >> - (mergemaster and all usual post-update stuff) >> >> This way, if I unfortunately can't boot, I can revert to old >> userland & kernel by : >> >> - dropping into loader prompt >> - setting vfs.root.mountfrom to zfs:tank/root.old >> - booting kernel.old > > Just for the records, I would like to poin out that kernel.old would > be loaded > from zfs:tank/root. > Yes indeed. (...) >> Also, world is updated "in place". >> >> I think it should be possible to do the installworld & installkernel >> on a root >> clone then boot into it (changing tank bootfs property), but then : >> how to revert >> to previous state in case of failure ? Is there a "nextboot" thing >> planed for zfs ? > > I am not aware of any plans to implement nextboot for zfs as it would > require at > least some write support for zpool and there is none (for boot code) > at the moment. > Could'nt the loader use a bit flag in the loader sector ? Nextboot (or something equivalent) missing is the sole thing keeping me from removing ufs boot partition for remote servers. >> What do you think ? How do you address the problem ? > > I have some patches that allow to boot a different loader or a kernel > from a > different (non-bootfs) ZFS dataset: > http://lists.freebsd.org/pipermail/freebsd-fs/2010-July/008976.html > But that still requires access to zfs boot and/or loader command > interface. Interesting though. Thanks. Does the mentionned patch still works with latest 8-stable loader ? And do you still have to change vfs.root.mountfrom once currdev set ?