From c6fd08797f69b39fc06419f824d94f9663b8943d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Wed, 16 Mar 2022 18:43:33 +0100 Subject: [PATCH] man: zfs-clone.8: import examples from zfs.8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia ZiemiaƄska Closes #13228 --- man/man8/zfs-clone.8 | 28 +++++++++++++++++++++++++++- man/man8/zfs.8 | 1 + 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/man/man8/zfs-clone.8 b/man/man8/zfs-clone.8 index 0640244f20..305748a8cd 100644 --- a/man/man8/zfs-clone.8 +++ b/man/man8/zfs-clone.8 @@ -29,7 +29,7 @@ .\" Copyright 2018 Nexenta Systems, Inc. .\" Copyright 2019 Joyent, Inc. .\" -.Dd May 27, 2021 +.Dd March 16, 2022 .Dt ZFS-CLONE 8 .Os . @@ -65,6 +65,32 @@ If the target filesystem or volume already exists, the operation completes successfully. .El . +.Sh EXAMPLES +.\" These are, respectively, examples 9, 10 from zfs.8 +.\" Make sure to update them bidirectionally +.Ss Example 1 : No Creating a ZFS Clone +The following command creates a writable file system whose initial contents are +the same as +.Ar pool/home/bob@yesterday . +.Dl # Nm zfs Cm clone Ar pool/home/bob@yesterday pool/clone +. +.Ss Example 2 : No Promoting a ZFS Clone +The following commands illustrate how to test out changes to a file system, and +then replace the original file system with the changed one, using clones, clone +promotion, and renaming: +.Bd -literal -compact -offset Ds +.No # Nm zfs Cm create Ar pool/project/production + populate /pool/project/production with data +.No # Nm zfs Cm snapshot Ar pool/project/production Ns @ Ns Ar today +.No # Nm zfs Cm clone Ar pool/project/production@today pool/project/beta + make changes to /pool/project/beta and test them +.No # Nm zfs Cm promote Ar pool/project/beta +.No # Nm zfs Cm rename Ar pool/project/production pool/project/legacy +.No # Nm zfs Cm rename Ar pool/project/beta pool/project/production + once the legacy version is no longer needed, it can be destroyed +.No # Nm zfs Cm destroy Ar pool/project/legacy +.Ed +. .Sh SEE ALSO .Xr zfs-promote 8 , .Xr zfs-snapshot 8 diff --git a/man/man8/zfs.8 b/man/man8/zfs.8 index 8d97eb6f27..b7385edded 100644 --- a/man/man8/zfs.8 +++ b/man/man8/zfs.8 @@ -301,6 +301,7 @@ if invalid command line options were specified. .Sh EXAMPLES .\" Examples 1, 4, 6, 14, 16 are shared with zfs-set.8. .\" Examples 5 are shared with zfs-list.8. +.\" Examples 9, 10 are shared with zfs-clone.8. .\" Examples 12, 13 are shared with zfs-send.8. .\" Examples 12, 13 are also shared with zfs-receive.8. .\" Examples 17, 18, 19, 20, 21 are shared with zfs-allow.8.