xref: /freebsd/sys/contrib/openzfs/man/man8/zfs-rollback.8 (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
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-ROLLBACK 8
35.Os
36.Sh NAME
37.Nm zfs-rollback
38.Nd Roll back the given dataset to a previous snapshot.
39.Sh SYNOPSIS
40.Nm zfs
41.Cm rollback
42.Op Fl Rfr
43.Ar snapshot
44.Sh DESCRIPTION
45.Bl -tag -width ""
46.It Xo
47.Nm zfs
48.Cm rollback
49.Op Fl Rfr
50.Ar snapshot
51.Xc
52When a dataset is rolled back, all data that has changed since the snapshot is
53discarded, and the dataset reverts to the state at the time of the snapshot.
54By default, the command refuses to roll back to a snapshot other than the most
55recent one.
56In order to do so, all intermediate snapshots and bookmarks must be destroyed by
57specifying the
58.Fl r
59option.
60.Pp
61The
62.Fl rR
63options do not recursively destroy the child snapshots of a recursive snapshot.
64Only direct snapshots of the specified filesystem are destroyed by either of
65these options.
66To completely roll back a recursive snapshot, you must rollback the individual
67child snapshots.
68.Bl -tag -width "-R"
69.It Fl R
70Destroy any more recent snapshots and bookmarks, as well as any clones of those
71snapshots.
72.It Fl f
73Used with the
74.Fl R
75option to force an unmount of any clone file systems that are to be destroyed.
76.It Fl r
77Destroy any snapshots and bookmarks more recent than the one specified.
78.El
79.El
80.Sh SEE ALSO
81.Xr zfs-snapshot 8
82