Date: Wed, 1 Apr 2020 15:30:33 -0400 From: mike tancsa <mike@sentex.net> To: Martin Simmons <martin@lispworks.com> Cc: freebsd-fs@freebsd.org Subject: Re: zfs promote Message-ID: <efe10d3e-ef38-8493-6ac4-da0bf8c953e9@sentex.net> In-Reply-To: <202004011647.031GlHqa011166@higson.cam.lispworks.com> References: <c86e4b80-664d-1ebe-7f50-c59b3c78421d@sentex.net> <202004011102.031B2an5008896@higson.cam.lispworks.com> <42019eac-4211-8265-e73e-d3b418b870fe@sentex.net> <202004011647.031GlHqa011166@higson.cam.lispworks.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 4/1/2020 12:47 PM, Martin Simmons wrote: > > I.e. before promote, nfs3zroot/cyclenet and nfs3zroot/cyclenetlive share data > with the @clean3 snapshot of nfs3zroot/cyclenet: > > nfs3zroot/cyclenet@clean3 > ^ ^ > | | > | nfs3zroot/cyclenetlive > | > nfs3zroot/cyclenet > > >> So if promote reverses that, so >> nfs3zroot/cyclenet@clean3 becomes a clone of nfs3zroot/cyclenetlive ? >> so I can then delete nfs3zroot/cyclenet@clean3 ? > No, that is confused, at least in the names of things: > nfs3zroot/cyclenet@clean3 is a snapshot so it cannot itself be a clone. OK, I think I clarified things for myself with a minimal example of how it works how I got to the place I am at, and what the end result is 0(cage)# zfs create test1/base 0(cage)# touch /test1/base/first-file-on-base 0(cage)# touch /test1/base/second-file-on-base 0(cage)# zfs snapshot test1/base@clean 0(cage)# touch /test1/base/file-that-only-exists-on-base-and-not-clone 0(cage)# zfs clone test1/base@clean test1/clone-of-base 0(cage)# touch /test1/clone-of-base/file-only-on-clone 0(cage)# ls -l /test1/base/ total 6 drwxr-xr-x 2 root wheel uarch 5 Apr 1 15:26 . drwxrwxrwx 14 root wheel uarch 21 Apr 1 15:26 .. -rw-r--r-- 1 root wheel uarch 0 Apr 1 15:26 file-that-only-exists-on-base-and-not-clone -rw-r--r-- 1 root wheel uarch 0 Apr 1 15:25 first-file-on-base -rw-r--r-- 1 root wheel uarch 0 Apr 1 15:26 second-file-on-base 0(cage)# ls -l /test1/clone-of-base/ total 4 drwxr-xr-x 2 root wheel uarch 5 Apr 1 15:26 . drwxrwxrwx 14 root wheel uarch 21 Apr 1 15:26 .. -rw-r--r-- 1 root wheel uarch 0 Apr 1 15:26 file-only-on-clone -rw-r--r-- 1 root wheel uarch 0 Apr 1 15:25 first-file-on-base -rw-r--r-- 1 root wheel uarch 0 Apr 1 15:26 second-file-on-base 0(cage)# zfs list -t snapshot | grep clean test1/base@clean 19.4K - 34.4K - 0(cage)# zfs promote test1/clone-of-base 0(cage)# zfs list -t snapshot | grep clean test1/clone-of-base@clean 20.9K - 34.4K - 0(cage)# zfs destroy -r test1/base 0(cage)# ls -l /test1/clone-of-base/ total 4 drwxr-xr-x 2 root wheel uarch 5 Apr 1 15:26 . drwxrwxrwx 13 root wheel uarch 20 Apr 1 15:27 .. -rw-r--r-- 1 root wheel uarch 0 Apr 1 15:26 file-only-on-clone -rw-r--r-- 1 root wheel uarch 0 Apr 1 15:25 first-file-on-base -rw-r--r-- 1 root wheel uarch 0 Apr 1 15:26 second-file-on-base 0(cage)# zfs destroy test1/clone-of-base@clean 0(cage)# ls -l /test1/clone-of-base/ total 4 drwxr-xr-x 2 root wheel uarch 5 Apr 1 15:26 . drwxrwxrwx 13 root wheel uarch 20 Apr 1 15:27 .. -rw-r--r-- 1 root wheel uarch 0 Apr 1 15:26 file-only-on-clone -rw-r--r-- 1 root wheel uarch 0 Apr 1 15:25 first-file-on-base -rw-r--r-- 1 root wheel uarch 0 Apr 1 15:26 second-file-on-base 0(cage)# Thanks for helping me work this through. I will do a zfs send|zfs recv onto another pool to be on the safe side, but I think I know what I need to do now! ---Mike
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?efe10d3e-ef38-8493-6ac4-da0bf8c953e9>