xref: /freebsd/sys/contrib/openzfs/man/man8/zfs-promote.8 (revision 61145dc2b94f12f6a47344fb9aac702321880e43)
1.\" SPDX-License-Identifier: CDDL-1.0
2.\"
3.\" CDDL HEADER START
4.\"
5.\" The contents of this file are subject to the terms of the
6.\" Common Development and Distribution License (the "License").
7.\" You may not use this file except in compliance with the License.
8.\"
9.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10.\" or https://opensource.org/licenses/CDDL-1.0.
11.\" See the License for the specific language governing permissions
12.\" and limitations under the License.
13.\"
14.\" When distributing Covered Code, include this CDDL HEADER in each
15.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16.\" If applicable, add the following below this CDDL HEADER, with the
17.\" fields enclosed by brackets "[]" replaced with your own identifying
18.\" information: Portions Copyright [yyyy] [name of copyright owner]
19.\"
20.\" CDDL HEADER END
21.\"
22.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
23.\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
24.\" Copyright (c) 2011, 2019 by Delphix. All rights reserved.
25.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
26.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
27.\" Copyright (c) 2014 by Adam Stevko. All rights reserved.
28.\" Copyright (c) 2014 Integros [integros.com]
29.\" Copyright 2019 Richard Laager. All rights reserved.
30.\" Copyright 2018 Nexenta Systems, Inc.
31.\" Copyright 2019 Joyent, Inc.
32.\"
33.Dd March 16, 2022
34.Dt ZFS-PROMOTE 8
35.Os
36.
37.Sh NAME
38.Nm zfs-promote
39.Nd promote clone dataset to no longer depend on origin snapshot
40.Sh SYNOPSIS
41.Nm zfs
42.Cm promote
43.Ar clone
44.
45.Sh DESCRIPTION
46The
47.Nm zfs Cm promote
48command makes it possible to destroy the dataset that the clone was created
49from.
50The clone parent-child dependency relationship is reversed, so that the origin
51dataset becomes a clone of the specified dataset.
52.Pp
53The snapshot that was cloned, and any snapshots previous to this snapshot, are
54now owned by the promoted clone.
55The space they use moves from the origin dataset to the promoted clone, so
56enough space must be available to accommodate these snapshots.
57No new space is consumed by this operation, but the space accounting is
58adjusted.
59The promoted clone must not have any conflicting snapshot names of its own.
60The
61.Nm zfs Cm rename
62subcommand can be used to rename any conflicting snapshots.
63.
64.Sh EXAMPLES
65.\" These are, respectively, examples 10 from zfs.8
66.\" Make sure to update them bidirectionally
67.Ss Example 1 : No Promoting a ZFS Clone
68The following commands illustrate how to test out changes to a file system, and
69then replace the original file system with the changed one, using clones, clone
70promotion, and renaming:
71.Bd -literal -compact -offset Ds
72.No # Nm zfs Cm create Ar pool/project/production
73  populate /pool/project/production with data
74.No # Nm zfs Cm snapshot Ar pool/project/production Ns @ Ns Ar today
75.No # Nm zfs Cm clone Ar pool/project/production@today pool/project/beta
76  make changes to /pool/project/beta and test them
77.No # Nm zfs Cm promote Ar pool/project/beta
78.No # Nm zfs Cm rename Ar pool/project/production pool/project/legacy
79.No # Nm zfs Cm rename Ar pool/project/beta pool/project/production
80  once the legacy version is no longer needed, it can be destroyed
81.No # Nm zfs Cm destroy Ar pool/project/legacy
82.Ed
83.
84.Sh SEE ALSO
85.Xr zfs-clone 8 ,
86.Xr zfs-rename 8
87