xref: /freebsd/sys/contrib/openzfs/man/man8/zfs-rename.8 (revision 2c48331d28f16c0efce5a72a81e7d71668c4a158)
1eda14cbcSMatt Macy.\"
2eda14cbcSMatt Macy.\" CDDL HEADER START
3eda14cbcSMatt Macy.\"
4eda14cbcSMatt Macy.\" The contents of this file are subject to the terms of the
5eda14cbcSMatt Macy.\" Common Development and Distribution License (the "License").
6eda14cbcSMatt Macy.\" You may not use this file except in compliance with the License.
7eda14cbcSMatt Macy.\"
8eda14cbcSMatt Macy.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9eda14cbcSMatt Macy.\" or http://www.opensolaris.org/os/licensing.
10eda14cbcSMatt Macy.\" See the License for the specific language governing permissions
11eda14cbcSMatt Macy.\" and limitations under the License.
12eda14cbcSMatt Macy.\"
13eda14cbcSMatt Macy.\" When distributing Covered Code, include this CDDL HEADER in each
14eda14cbcSMatt Macy.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15eda14cbcSMatt Macy.\" If applicable, add the following below this CDDL HEADER, with the
16eda14cbcSMatt Macy.\" fields enclosed by brackets "[]" replaced with your own identifying
17eda14cbcSMatt Macy.\" information: Portions Copyright [yyyy] [name of copyright owner]
18eda14cbcSMatt Macy.\"
19eda14cbcSMatt Macy.\" CDDL HEADER END
20eda14cbcSMatt Macy.\"
21eda14cbcSMatt Macy.\"
22eda14cbcSMatt Macy.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
23eda14cbcSMatt Macy.\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
24eda14cbcSMatt Macy.\" Copyright (c) 2011, 2019 by Delphix. All rights reserved.
25eda14cbcSMatt Macy.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
26eda14cbcSMatt Macy.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
27eda14cbcSMatt Macy.\" Copyright (c) 2014 by Adam Stevko. All rights reserved.
28eda14cbcSMatt Macy.\" Copyright (c) 2014 Integros [integros.com]
29eda14cbcSMatt Macy.\" Copyright 2019 Richard Laager. All rights reserved.
30eda14cbcSMatt Macy.\" Copyright 2018 Nexenta Systems, Inc.
31eda14cbcSMatt Macy.\" Copyright 2019 Joyent, Inc.
32eda14cbcSMatt Macy.\"
33*2c48331dSMatt Macy.Dd September 1, 2020
34eda14cbcSMatt Macy.Dt ZFS-RENAME 8
35eda14cbcSMatt Macy.Os
36eda14cbcSMatt Macy.Sh NAME
37eda14cbcSMatt Macy.Nm zfs Ns Pf - Cm rename
38eda14cbcSMatt Macy.Nd Renames the given dataset (filesystem or snapshot).
39eda14cbcSMatt Macy.Sh SYNOPSIS
40eda14cbcSMatt Macy.Nm
41eda14cbcSMatt Macy.Cm rename
42eda14cbcSMatt Macy.Op Fl f
43eda14cbcSMatt Macy.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
44eda14cbcSMatt Macy.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
45eda14cbcSMatt Macy.Nm
46eda14cbcSMatt Macy.Cm rename
47eac7052fSMatt Macy.Fl p
48eac7052fSMatt Macy.Op Fl f
49eda14cbcSMatt Macy.Ar filesystem Ns | Ns Ar volume
50eda14cbcSMatt Macy.Ar filesystem Ns | Ns Ar volume
51eac7052fSMatt Macy.Nm
52eac7052fSMatt Macy.Cm rename
53eac7052fSMatt Macy.Fl u
54eac7052fSMatt Macy.Op Fl f
55*2c48331dSMatt Macy.Ar filesystem Ar filesystem
56*2c48331dSMatt Macy.Nm
57*2c48331dSMatt Macy.Cm rename
58*2c48331dSMatt Macy.Fl r
59*2c48331dSMatt Macy.Ar snapshot Ar snapshot
60eda14cbcSMatt Macy.Sh DESCRIPTION
61eda14cbcSMatt Macy.Bl -tag -width ""
62eda14cbcSMatt Macy.It Xo
63eda14cbcSMatt Macy.Nm
64eda14cbcSMatt Macy.Cm rename
65eda14cbcSMatt Macy.Op Fl f
66eda14cbcSMatt Macy.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
67eda14cbcSMatt Macy.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
68eda14cbcSMatt Macy.Xc
69eda14cbcSMatt Macy.It Xo
70eda14cbcSMatt Macy.Nm
71eda14cbcSMatt Macy.Cm rename
72eac7052fSMatt Macy.Fl p
73eac7052fSMatt Macy.Op Fl f
74eda14cbcSMatt Macy.Ar filesystem Ns | Ns Ar volume
75eda14cbcSMatt Macy.Ar filesystem Ns | Ns Ar volume
76eda14cbcSMatt Macy.Xc
77eac7052fSMatt Macy.It Xo
78eac7052fSMatt Macy.Nm
79eac7052fSMatt Macy.Cm rename
80eac7052fSMatt Macy.Fl u
81eac7052fSMatt Macy.Op Fl f
82eac7052fSMatt Macy.Ar filesystem
83eac7052fSMatt Macy.Ar filesystem
84eac7052fSMatt Macy.Xc
85eda14cbcSMatt MacyRenames the given dataset.
86eda14cbcSMatt MacyThe new target can be located anywhere in the ZFS hierarchy, with the exception
87eda14cbcSMatt Macyof snapshots.
88eda14cbcSMatt MacySnapshots can only be renamed within the parent file system or volume.
89eda14cbcSMatt MacyWhen renaming a snapshot, the parent file system of the snapshot does not need
90eda14cbcSMatt Macyto be specified as part of the second argument.
91eda14cbcSMatt MacyRenamed file systems can inherit new mount points, in which case they are
92eda14cbcSMatt Macyunmounted and remounted at the new mount point.
93eda14cbcSMatt Macy.Bl -tag -width "-a"
94eda14cbcSMatt Macy.It Fl f
95eda14cbcSMatt MacyForce unmount any file systems that need to be unmounted in the process.
96eac7052fSMatt MacyThis flag has no effect if used together with the
97eac7052fSMatt Macy.Fl u
98eac7052fSMatt Macyflag.
99eda14cbcSMatt Macy.It Fl p
100eda14cbcSMatt MacyCreates all the nonexistent parent datasets.
101eda14cbcSMatt MacyDatasets created in this manner are automatically mounted according to the
102eda14cbcSMatt Macy.Sy mountpoint
103eda14cbcSMatt Macyproperty inherited from their parent.
104eac7052fSMatt Macy.It Fl u
105eac7052fSMatt MacyDo not remount file systems during rename.
106eac7052fSMatt MacyIf a file system's
107eac7052fSMatt Macy.Sy mountpoint
108eac7052fSMatt Macyproperty is set to
109eac7052fSMatt Macy.Sy legacy
110eac7052fSMatt Macyor
111eac7052fSMatt Macy.Sy none ,
112eac7052fSMatt Macythe file system is not unmounted even if this option is not given.
113eda14cbcSMatt Macy.El
114eda14cbcSMatt Macy.It Xo
115eda14cbcSMatt Macy.Nm
116eda14cbcSMatt Macy.Cm rename
117eda14cbcSMatt Macy.Fl r
118eda14cbcSMatt Macy.Ar snapshot Ar snapshot
119eda14cbcSMatt Macy.Xc
120eda14cbcSMatt MacyRecursively rename the snapshots of all descendent datasets.
121eda14cbcSMatt MacySnapshots are the only dataset that can be renamed recursively.
122eda14cbcSMatt Macy.El
123