zfs promote

mike tancsa mike at sentex.net
Wed Apr 1 19:31:00 UTC 2020


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

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 at clean
0(cage)# touch /test1/base/file-that-only-exists-on-base-and-not-clone
0(cage)# zfs clone test1/base at 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 at 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 at 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 at 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



More information about the freebsd-fs mailing list