xref: /freebsd/sys/contrib/openzfs/man/man8/zfs-rename.8 (revision 2ccf8a827cce7e34e2063a3d33e5cce4b79799cc)
1.\"
2.\" CDDL HEADER START
3.\"
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.
7.\"
8.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9.\" or http://www.opensolaris.org/os/licensing.
10.\" See the License for the specific language governing permissions
11.\" and limitations under the License.
12.\"
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]
18.\"
19.\" CDDL HEADER END
20.\"
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 June 30, 2019
34.Dt ZFS-RENAME 8
35.Os
36.Sh NAME
37.Nm zfs Ns Pf - Cm rename
38.Nd Renames the given dataset (filesystem or snapshot).
39.Sh SYNOPSIS
40.Nm
41.Cm rename
42.Op Fl f
43.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
44.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
45.Nm
46.Cm rename
47.Fl p
48.Op Fl f
49.Ar filesystem Ns | Ns Ar volume
50.Ar filesystem Ns | Ns Ar volume
51.Nm
52.Cm rename
53.Fl u
54.Op Fl f
55.Ar filesystem
56.Ar filesystem
57.Sh DESCRIPTION
58.Bl -tag -width ""
59.It Xo
60.Nm
61.Cm rename
62.Op Fl f
63.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
64.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
65.Xc
66.It Xo
67.Nm
68.Cm rename
69.Fl p
70.Op Fl f
71.Ar filesystem Ns | Ns Ar volume
72.Ar filesystem Ns | Ns Ar volume
73.Xc
74.It Xo
75.Nm
76.Cm rename
77.Fl u
78.Op Fl f
79.Ar filesystem
80.Ar filesystem
81.Xc
82Renames the given dataset.
83The new target can be located anywhere in the ZFS hierarchy, with the exception
84of snapshots.
85Snapshots can only be renamed within the parent file system or volume.
86When renaming a snapshot, the parent file system of the snapshot does not need
87to be specified as part of the second argument.
88Renamed file systems can inherit new mount points, in which case they are
89unmounted and remounted at the new mount point.
90.Bl -tag -width "-a"
91.It Fl f
92Force unmount any file systems that need to be unmounted in the process.
93This flag has no effect if used together with the
94.Fl u
95flag.
96.It Fl p
97Creates all the nonexistent parent datasets.
98Datasets created in this manner are automatically mounted according to the
99.Sy mountpoint
100property inherited from their parent.
101.It Fl u
102Do not remount file systems during rename.
103If a file system's
104.Sy mountpoint
105property is set to
106.Sy legacy
107or
108.Sy none ,
109the file system is not unmounted even if this option is not given.
110.El
111.It Xo
112.Nm
113.Cm rename
114.Fl r
115.Ar snapshot Ar snapshot
116.Xc
117Recursively rename the snapshots of all descendent datasets.
118Snapshots are the only dataset that can be renamed recursively.
119.El
120