From owner-freebsd-fs@FreeBSD.ORG Mon Jul 7 18:10:34 2008 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58F2D1065673 for ; Mon, 7 Jul 2008 18:10:34 +0000 (UTC) (envelope-from kris@FreeBSD.org) Received: from weak.local (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E91DA8FC22; Mon, 7 Jul 2008 18:10:32 +0000 (UTC) (envelope-from kris@FreeBSD.org) Message-ID: <48725C19.5040408@FreeBSD.org> Date: Mon, 07 Jul 2008 20:10:33 +0200 From: Kris Kennaway User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: hartzell@alerce.com References: <18546.20476.590665.29995@almost.alerce.com> <4872566C.6000206@FreeBSD.org> <18546.22908.193997.709865@almost.alerce.com> In-Reply-To: <18546.22908.193997.709865@almost.alerce.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-fs@freebsd.org Subject: Re: using zfs and unionfs together, does zfs need to be extended? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2008 18:10:34 -0000 George Hartzell wrote: > Kris Kennaway writes: > > George Hartzell wrote: > > > I'd like to be able to set up a large-ish number of very similar > > > jails, with a minimum of fuss and take advantage of zfs' cool > > > features. I'd like to use unionfs to do this, but zfs' lack of > > > whiteout support seems to make it impossible. [jump to the bottom if > > > you want to skip the setup and get to the questions] > > > > > > It seems like the most popular way to set up jails these days uses > > > read-only nullfs mounts of a base system and symbolic links into a > > > read-write nullfs mount for each jail's specific stuff (etc, > > > /usr/local, etc...). > > > > The "ZFS way" is to just clone your jail filesystem into each jail instance. > > Both the nullfs approach used by ezjail and described in the handbook > and the unionfs approach make updates *much* easier. A change/update > to the jail base is automatically visible in all of the jails. > > As I understand a zfs clones (and a quick test backs this up), they're > copies of the original filesystem, based on a snapshot. Once they're > cloned they no longer "see" updates to the base system. That's right. Keep in mind that depending on what you are changing, it can be dangerous to modify files that are in use. Anyway if you require this model then nullfs or unionfs is indeed required. > I'm not even sure that you get the space savings, I just did a zfs > snapshot and then a zfs clone and du -sH on the two filesystems > reports the same size. That seems odd though (with all the copy on > write stuff available), but.... They are copy-on-write, so if you interpret the data correctly you will see that they aren't using additional space until you write to them :) Kris