using zfs and unionfs together, does zfs need to be extended?

Kris Kennaway kris at FreeBSD.org
Mon Jul 7 18:10:34 UTC 2008


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


More information about the freebsd-fs mailing list