zfs promote

Martin Simmons martin at lispworks.com
Wed Apr 1 16:47:39 UTC 2020


>>>>> On Wed, 1 Apr 2020 10:09:55 -0400, mike tancsa said:
> 
> On 4/1/2020 7:02 AM, Martin Simmons wrote:
> >
> > Were you intending to keep both nfs3zroot/cyclenet and nfs3zroot/cyclenetlive?
> 
> No, just nfs3zroot/cyclenetlive

OK, that simplifies things.


> > Not quite.  Beware this from the documentation:
> >
> > "The clone parent-child dependency relationship is reversed, so that the
> > origin file system becomes a clone of the specified file system."
> >
> > and
> >
> > "The snapshot that was cloned, and any snapshots previous to this snapshot,
> > are now owned by the promoted clone."
> >
> > Therefore doing zfs promote nfs3zroot/cyclenetlive will cause
> > nfs3zroot/cyclenet to become a clone of nfs3zroot/cyclenetlive at clean3.  If you
> > then want to destroy nfs3zroot/cyclenetlive at clean3, you will first need to
> > destroy nfs3zroot/cyclenet.
> 
> Hmm, I am trying to get my head around this. I should first simulate
> this in a test environment of course.  What you wrote however seems
> reversed, but perhaps my perspective is backwards to what is written ?

Yes, promote is a snapshot twister :-)


> ie Originally I did a
> 
> 
> zfs clone nfs3zroot/cyclenet at clean3 nfs3zroot/cyclenetlive
> 
> so I read that as I made a clone called cyclenetlive of the snapshot
> nfs3zroot/cyclenet at clean3 ?

Correct.

I.e. before promote, nfs3zroot/cyclenet and nfs3zroot/cyclenetlive share data
with the @clean3 snapshot of nfs3zroot/cyclenet:

nfs3zroot/cyclenet at clean3
^   ^
|   |
|   nfs3zroot/cyclenetlive
|
nfs3zroot/cyclenet


>                             So if promote reverses that, so
> nfs3zroot/cyclenet at clean3 becomes a clone of nfs3zroot/cyclenetlive ? 
> so I can then delete nfs3zroot/cyclenet at clean3 ?

No, that is confused, at least in the names of things:
nfs3zroot/cyclenet at clean3 is a snapshot so it cannot itself be a clone.

What happens is that the @clean3 snapshot is transferred from
nfs3zroot/cyclenet to nfs3zroot/cyclenetlive, so it now called
nfs3zroot/cyclenetlive at clean3.  ("The snapshot that was cloned, and any
snapshots previous to this snapshot, are now owned by the promoted clone.")
In addition, nfs3zroot/cyclenet ("the origin file system") becomes a clone of
nfs3zroot/cyclenetlive ("the specified file system"), joined at the
transferred @clean3 snapshot.

I.e. after promote, nfs3zroot/cyclenet and nfs3zroot/cyclenetlive share data
with the @clean3 snapshot of nfs3zroot/cyclenetlive:

nfs3zroot/cyclenetlive at clean3
^   ^
|   |
|   nfs3zroot/cyclenet
|
nfs3zroot/cyclenetlive

That is why you would then need to destroy nfs3zroot/cyclenet before you can
destroy nfs3zroot/cyclenetlive at clean3.

__Martin


More information about the freebsd-fs mailing list