zfs promote

mike tancsa mike at sentex.net
Wed Apr 1 14:10:16 UTC 2020


On 4/1/2020 7:02 AM, Martin Simmons wrote:
>>>>>> On Tue, 31 Mar 2020 15:32:53 -0400, mike tancsa said:
>> Hi,
>>
>>     While doing some VM tests, I was making heavy use of clones from my
>> zfs server.  (clones are a super cool handy feature!)... However, when
>> we went live, I accidentally used a clone as the production file
>> system.
> I suggest giving some more details about your end goal.
>
> What was the intended file system structure (i.e. if you had not used a
> clone)?

We use zrepl to manage replication / backups. It keeps a defined amount
of local snapshots (a days worth), but has much more on the remote
server.  As this file system changes a lot, I dont want to eatup local
fast storage by keeping an increasingly older and divergent snapshot
around on the main file server.


>
> Were you intending to keep both nfs3zroot/cyclenet and nfs3zroot/cyclenetlive?

No, just nfs3zroot/cyclenetlive


         Now, I cannot delete those old snapshots.

> Why do you want to delete the old snapshots?  Is that multiple snapshots or
> just @clean3?

The file system will diverge significantly over time from that original
snapshot and will take up more and more space which I dont want locally.


> 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 ?
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 ? 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 ?

>
>
>> Also, how much impact on the disk IO will the promote command have ? Is
>> it long like a scrub, or quick like a snapshot ?
> It is much more like a snapshot than a scrub.

Thank you for the help!


    ---Mike


>
> __Martin
>


More information about the freebsd-fs mailing list