4 .\" The contents of this file are subject to the terms of the
5 .\" Common Development and Distribution License (the "License").
6 .\" You may not use this file except in compliance with the License.
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 .\" or https://opensource.org/licenses/CDDL-1.0.
10 .\" See the License for the specific language governing permissions
11 .\" and limitations under the License.
13 .\" When distributing Covered Code, include this CDDL HEADER in each
14 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 .\" If applicable, add the following below this CDDL HEADER, with the
16 .\" fields enclosed by brackets "[]" replaced with your own identifying
17 .\" information: Portions Copyright [yyyy] [name of copyright owner]
21 .\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
22 .\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
23 .\" Copyright (c) 2011, 2019 by Delphix. All rights reserved.
24 .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
25 .\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
26 .\" Copyright (c) 2014 by Adam Stevko. All rights reserved.
27 .\" Copyright (c) 2014 Integros [integros.com]
28 .\" Copyright 2019 Richard Laager. All rights reserved.
29 .\" Copyright 2018 Nexenta Systems, Inc.
30 .\" Copyright 2019 Joyent, Inc.
38 .Nd clone snapshot of ZFS dataset
43 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns …
44 .Ar snapshot Ar filesystem Ns | Ns Ar volume
52 The target dataset can be located anywhere in the ZFS hierarchy,
53 and is created as the same type as the original.
55 .It Fl o Ar property Ns = Ns Ar value
56 Sets the specified property; see
60 Creates all the non-existing parent datasets.
61 Datasets created in this manner are automatically mounted according to the
63 property inherited from their parent.
64 If the target filesystem or volume already exists, the operation completes
69 .\" These are, respectively, examples 9, 10 from zfs.8
70 .\" Make sure to update them bidirectionally
71 .Ss Example 1 : No Creating a ZFS Clone
72 The following command creates a writable file system whose initial contents are
74 .Ar pool/home/bob@yesterday .
75 .Dl # Nm zfs Cm clone Ar pool/home/bob@yesterday pool/clone
77 .Ss Example 2 : No Promoting a ZFS Clone
78 The following commands illustrate how to test out changes to a file system, and
79 then replace the original file system with the changed one, using clones, clone
80 promotion, and renaming:
81 .Bd -literal -compact -offset Ds
82 .No # Nm zfs Cm create Ar pool/project/production
83 populate /pool/project/production with data
84 .No # Nm zfs Cm snapshot Ar pool/project/production Ns @ Ns Ar today
85 .No # Nm zfs Cm clone Ar pool/project/production@today pool/project/beta
86 make changes to /pool/project/beta and test them
87 .No # Nm zfs Cm promote Ar pool/project/beta
88 .No # Nm zfs Cm rename Ar pool/project/production pool/project/legacy
89 .No # Nm zfs Cm rename Ar pool/project/beta pool/project/production
90 once the legacy version is no longer needed, it can be destroyed
91 .No # Nm zfs Cm destroy Ar pool/project/legacy