From owner-freebsd-ports@FreeBSD.ORG Sun Apr 21 01:13:02 2013 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D6D3469F for ; Sun, 21 Apr 2013 01:13:02 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [IPv6:2607:f678:1010::34]) by mx1.freebsd.org (Postfix) with ESMTP id 9647C1618 for ; Sun, 21 Apr 2013 01:13:02 +0000 (UTC) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id r3L1Cq1W025275 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 20 Apr 2013 18:12:52 -0700 (PDT) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.14.2/Submit) with UUCP id r3L1CqsV025274; Sat, 20 Apr 2013 18:12:52 -0700 (PDT) (envelope-from perryh@pluto.rain.com) Received: from fbsd81 ([192.168.200.81]) by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA13024; Sat, 20 Apr 13 18:03:39 PDT Date: Sat, 20 Apr 2013 18:03:17 -0700 From: perryh@pluto.rain.com (Perry Hutchison) To: d@delphij.net Subject: Re: non-destructive ports/packages update Message-Id: <51733ad5.jgrImeJZdbQoq4dt%perryh@pluto.rain.com> References: <517236fe.7AoqFIleDJvljza6%perryh@pluto.rain.com> <51723A51.20401@delphij.net> In-Reply-To: <51723A51.20401@delphij.net> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 01:13:02 -0000 Xin Li wrote: > On 4/19/13 11:34 PM, Perry Hutchison wrote: > > I'm looking for a way to move everything connected with ports and > > packages aside, so that I can start fresh but with the ability to > > easily roll it back when things go badly (as they surely will). > > > > I have in mind to something like this: > > > > # cd /usr > > # mkdir old > > # mv ports local old > > # mkdir ports local > > # cd /var/db > > # mkdir old > > # mv ports pkg old > > # mkdir ports pkg > > > > Is there anything else that needs to be saved before fetching a > > new ports tree and starting to build things (or install prebuilt > > packages)? > > If you use ZFS, it's possible to take snapshot, then install new > ports, then if something blows up, you can rollback. > > With UFS, it's still possible to take snapshot but rollback is not > atomic. I'm aware of filesystem snapshots, but I only want to checkpoint the ports and packages, not the whole filesystem -- a rollback needs to be fast, easy, and obviously correct; preserve the failure logs; and not undo changes that may have been made elsewhere in the meantime. (BTW I don't use ZFS: the machine doesn't have enough memory, and to me ZFS -- especially on 8.x -- doesn't yet seem sufficiently proven.) > If you use portmaster, it can save packages (I think portupgrade > can do it too). But this approach depends on the fact that the > port is well written, and is not atomic in terms of package set. And then a rollback requires re-installing the saved packages, which is surely slower than moving a few directories and/or files around. The question is, what (if anything) else -- besides /usr/ports, /usr/local, /var/db/ports, and /var/db/pkg -- needs to be checkpointed?