xref: /freebsd-src/sys/contrib/openzfs/man/man8/zfs-rollback.8 (revision 271171e0d97b88ba2a7c3bf750c9672b484c1c13)
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
9*271171e0SMartin Matuska.\" or https://opensource.org/licenses/CDDL-1.0.
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.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
22eda14cbcSMatt Macy.\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
23eda14cbcSMatt Macy.\" Copyright (c) 2011, 2019 by Delphix. All rights reserved.
24eda14cbcSMatt Macy.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
25eda14cbcSMatt Macy.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
26eda14cbcSMatt Macy.\" Copyright (c) 2014 by Adam Stevko. All rights reserved.
27eda14cbcSMatt Macy.\" Copyright (c) 2014 Integros [integros.com]
28eda14cbcSMatt Macy.\" Copyright 2019 Richard Laager. All rights reserved.
29eda14cbcSMatt Macy.\" Copyright 2018 Nexenta Systems, Inc.
30eda14cbcSMatt Macy.\" Copyright 2019 Joyent, Inc.
31eda14cbcSMatt Macy.\"
32da5137abSMartin Matuska.Dd March 16, 2022
33eda14cbcSMatt Macy.Dt ZFS-ROLLBACK 8
34eda14cbcSMatt Macy.Os
3516038816SMartin Matuska.
36eda14cbcSMatt Macy.Sh NAME
377877fdebSMatt Macy.Nm zfs-rollback
3816038816SMartin Matuska.Nd roll ZFS dataset back to snapshot
39eda14cbcSMatt Macy.Sh SYNOPSIS
407877fdebSMatt Macy.Nm zfs
41eda14cbcSMatt Macy.Cm rollback
42eda14cbcSMatt Macy.Op Fl Rfr
43eda14cbcSMatt Macy.Ar snapshot
4416038816SMartin Matuska.
45eda14cbcSMatt Macy.Sh DESCRIPTION
46eda14cbcSMatt MacyWhen a dataset is rolled back, all data that has changed since the snapshot is
47eda14cbcSMatt Macydiscarded, and the dataset reverts to the state at the time of the snapshot.
48eda14cbcSMatt MacyBy default, the command refuses to roll back to a snapshot other than the most
49eda14cbcSMatt Macyrecent one.
50eda14cbcSMatt MacyIn order to do so, all intermediate snapshots and bookmarks must be destroyed by
51eda14cbcSMatt Macyspecifying the
52eda14cbcSMatt Macy.Fl r
53eda14cbcSMatt Macyoption.
54eda14cbcSMatt Macy.Pp
55eda14cbcSMatt MacyThe
56eda14cbcSMatt Macy.Fl rR
57eda14cbcSMatt Macyoptions do not recursively destroy the child snapshots of a recursive snapshot.
58eda14cbcSMatt MacyOnly direct snapshots of the specified filesystem are destroyed by either of
59eda14cbcSMatt Macythese options.
60eda14cbcSMatt MacyTo completely roll back a recursive snapshot, you must roll back the individual
61eda14cbcSMatt Macychild snapshots.
62eda14cbcSMatt Macy.Bl -tag -width "-R"
63eda14cbcSMatt Macy.It Fl R
64eda14cbcSMatt MacyDestroy any more recent snapshots and bookmarks, as well as any clones of those
65eda14cbcSMatt Macysnapshots.
66eda14cbcSMatt Macy.It Fl f
67eda14cbcSMatt MacyUsed with the
68eda14cbcSMatt Macy.Fl R
69eda14cbcSMatt Macyoption to force an unmount of any clone file systems that are to be destroyed.
70eda14cbcSMatt Macy.It Fl r
71eda14cbcSMatt MacyDestroy any snapshots and bookmarks more recent than the one specified.
72eda14cbcSMatt Macy.El
7316038816SMartin Matuska.
74da5137abSMartin Matuska.Sh EXAMPLES
75da5137abSMartin Matuska.\" These are, respectively, examples 8 from zfs.8
76da5137abSMartin Matuska.\" Make sure to update them bidirectionally
77da5137abSMartin Matuska.Ss Example 8 : No Rolling Back a ZFS File System
78da5137abSMartin MatuskaThe following command reverts the contents of
79da5137abSMartin Matuska.Ar pool/home/anne
80da5137abSMartin Matuskato the snapshot named
81da5137abSMartin Matuska.Ar yesterday ,
82da5137abSMartin Matuskadeleting all intermediate snapshots:
83da5137abSMartin Matuska.Dl # Nm zfs Cm rollback Fl r Ar pool/home/anne Ns @ Ns Ar yesterday
84da5137abSMartin Matuska.
85eda14cbcSMatt Macy.Sh SEE ALSO
86eda14cbcSMatt Macy.Xr zfs-snapshot 8
87