Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Sep 2010 14:45:27 -0700
From:      Phillip Nordwall <phillip.nordwall@gmail.com>
To:        freebsd-fs@freebsd.org
Subject:   ZFS mount_unionfs or ZFS overlay
Message-ID:  <AANLkTimFTBJGsGitgT%2Bs6fHuczQ=QY_RV7yxELDxAYUz@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
I'm trying to do a mount_unionfs of a zfs file system over another
filesystem and am getting an Operation not supported. If I try to do a zfs
mount -O (for an overlay) I get the following error: no overlay mounts
support on FreeBSD, ignoring.

I'm thinking about digging into the code (guided by The Design and
Implementation of the FreeBSD Operating Sytem) to find out how to make zfs
union mounts work, but I figured I should ask here if there is a good reason
why it is not currently implemented.

My goal is to have the following mount setup.

tank0/base on /zmnts/base (zfs, local)
tank0/www on /zmnts/www (zfs, local)
tank0/web0 on /zmnts/web0 (zfs, local)
tank0/web1 on /zmnts/web1 (zfs, local)
.
.
.
tank0/webn on /zmnts/webn (zfs, local)
/zmnts/base on /jails/base (nullfs, local)
/jails/base on /jails/www (nullfs, local, read-only)
<above>:/zmnts/www on /jails/www (unionfs, local)

/jails/www on /jails/web0 (nullfs, local, read-only)
<above>:/zmnts/web0 on /jails/web0 (unionfs, local)
/jails/www on /jails/web1 (nullfs, local, read-only)
<above>:/zmnts/web1 on /jails/web1 (unionfs, local)
.
.
.

/jails/www on /jails/webn (nullfs, local, read-only)
<above>:/zmnts/webn on /jails/webn (unionfs, local)


This would allow me to have a hierarchy of "inherited" jails where I could
update any level and the levels below it would be updated, but also allow
each level to override any or all files from a higher level.  It also would
allow for snapshotting any level, cloning it, performing a union mount below
another level followed by the unmounting of a level it is now over. This
gives much more power than just using a single nullfs layer.

If you have any reason why I shouldn't do this, please let me know.

Philip Nordwall
Senior Systems Analyst/Programmer
Computer Science Department
Western Washington University

On Thu, Sep 2, 2010 at 2:04 AM, Pawel Jakub Dawidek <pjd@freebsd.org> wrote:

> On Thu, Sep 02, 2010 at 01:55:51AM -0700, Rob Farmer wrote:
> > On Tue, Aug 31, 2010 at 2:59 PM, Pawel Jakub Dawidek <pjd@freebsd.org>
> wrote:
> > >
> > > Ok, now that I know you read everything carefully, here is the patch:
> > >
> > >        http://people.freebsd.org/~pjd/patches/zfs_20100831.patch.bz2<http://people.freebsd.org/%7Epjd/patches/zfs_20100831.patch.bz2>;
> > >
> >
> > buildworld on i386 (yes I know ZFS isn't ideal there):
> [...]
>
> Yes, I know about this problem, You can use attached patch or wait for
> full patch, which I'll be sending later today.
>
> --
> Pawel Jakub Dawidek                       http://www.wheelsystems.com
> pjd@FreeBSD.org                           http://www.FreeBSD.org
> FreeBSD committer                         Am I Evil? Yes, I Am!
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimFTBJGsGitgT%2Bs6fHuczQ=QY_RV7yxELDxAYUz>