The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/openzfs/man/man8/zfs-snapshot.8

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    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 https://opensource.org/licenses/CDDL-1.0.
   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 .\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
   22 .\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
   23 .\" Copyright (c) 2011, 2019 by Delphix. All rights reserved.
   24 .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
   25 .\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
   26 .\" Copyright (c) 2014 by Adam Stevko. All rights reserved.
   27 .\" Copyright (c) 2014 Integros [integros.com]
   28 .\" Copyright 2019 Richard Laager. All rights reserved.
   29 .\" Copyright 2018 Nexenta Systems, Inc.
   30 .\" Copyright 2019 Joyent, Inc.
   31 .\"
   32 .Dd March 16, 2022
   33 .Dt ZFS-SNAPSHOT 8
   34 .Os
   35 .
   36 .Sh NAME
   37 .Nm zfs-snapshot
   38 .Nd create snapshots of ZFS datasets
   39 .Sh SYNOPSIS
   40 .Nm zfs
   41 .Cm snapshot
   42 .Op Fl r
   43 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns …
   44 .Ar dataset Ns @ Ns Ar snapname Ns …
   45 .
   46 .Sh DESCRIPTION
   47 All previous modifications by successful system calls to the file system are
   48 part of the snapshots.
   49 Snapshots are taken atomically, so that all snapshots correspond to the same
   50 moment in time.
   51 .Nm zfs Cm snap
   52 can be used as an alias for
   53 .Nm zfs Cm snapshot .
   54 See the
   55 .Sx Snapshots
   56 section of
   57 .Xr zfsconcepts 7
   58 for details.
   59 .Bl -tag -width "-o"
   60 .It Fl o Ar property Ns = Ns Ar value
   61 Set the specified property; see
   62 .Nm zfs Cm create
   63 for details.
   64 .It Fl r
   65 Recursively create snapshots of all descendent datasets
   66 .El
   67 .
   68 .Sh EXAMPLES
   69 .\" These are, respectively, examples 2, 3, 10, 15 from zfs.8
   70 .\" Make sure to update them bidirectionally
   71 .Ss Example 1 : No Creating a ZFS Snapshot
   72 The following command creates a snapshot named
   73 .Ar yesterday .
   74 This snapshot is mounted on demand in the
   75 .Pa .zfs/snapshot
   76 directory at the root of the
   77 .Ar pool/home/bob
   78 file system.
   79 .Dl # Nm zfs Cm snapshot Ar pool/home/bob Ns @ Ns Ar yesterday
   80 .
   81 .Ss Example 2 : No Creating and Destroying Multiple Snapshots
   82 The following command creates snapshots named
   83 .Ar yesterday No of Ar pool/home
   84 and all of its descendent file systems.
   85 Each snapshot is mounted on demand in the
   86 .Pa .zfs/snapshot
   87 directory at the root of its file system.
   88 The second command destroys the newly created snapshots.
   89 .Dl # Nm zfs Cm snapshot Fl r Ar pool/home Ns @ Ns Ar yesterday
   90 .Dl # Nm zfs Cm destroy Fl r Ar pool/home Ns @ Ns Ar yesterday
   91 .
   92 .Ss Example 3 : No Promoting a ZFS Clone
   93 The following commands illustrate how to test out changes to a file system, and
   94 then replace the original file system with the changed one, using clones, clone
   95 promotion, and renaming:
   96 .Bd -literal -compact -offset Ds
   97 .No # Nm zfs Cm create Ar pool/project/production
   98   populate /pool/project/production with data
   99 .No # Nm zfs Cm snapshot Ar pool/project/production Ns @ Ns Ar today
  100 .No # Nm zfs Cm clone Ar pool/project/production@today pool/project/beta
  101   make changes to /pool/project/beta and test them
  102 .No # Nm zfs Cm promote Ar pool/project/beta
  103 .No # Nm zfs Cm rename Ar pool/project/production pool/project/legacy
  104 .No # Nm zfs Cm rename Ar pool/project/beta pool/project/production
  105   once the legacy version is no longer needed, it can be destroyed
  106 .No # Nm zfs Cm destroy Ar pool/project/legacy
  107 .Ed
  108 .
  109 .Ss Example 4 : No Performing a Rolling Snapshot
  110 The following example shows how to maintain a history of snapshots with a
  111 consistent naming scheme.
  112 To keep a week's worth of snapshots, the user destroys the oldest snapshot,
  113 renames the remaining snapshots, and then creates a new snapshot, as follows:
  114 .Bd -literal -compact -offset Ds
  115 .No # Nm zfs Cm destroy Fl r Ar pool/users@7daysago
  116 .No # Nm zfs Cm rename Fl r Ar pool/users@6daysago No @ Ns Ar 7daysago
  117 .No # Nm zfs Cm rename Fl r Ar pool/users@5daysago No @ Ns Ar 6daysago
  118 .No # Nm zfs Cm rename Fl r Ar pool/users@4daysago No @ Ns Ar 5daysago
  119 .No # Nm zfs Cm rename Fl r Ar pool/users@3daysago No @ Ns Ar 4daysago
  120 .No # Nm zfs Cm rename Fl r Ar pool/users@2daysago No @ Ns Ar 3daysago
  121 .No # Nm zfs Cm rename Fl r Ar pool/users@yesterday No @ Ns Ar 2daysago
  122 .No # Nm zfs Cm rename Fl r Ar pool/users@today No @ Ns Ar yesterday
  123 .No # Nm zfs Cm snapshot Fl r Ar pool/users Ns @ Ns Ar today
  124 .Ed
  125 .
  126 .Sh SEE ALSO
  127 .Xr zfs-bookmark 8 ,
  128 .Xr zfs-clone 8 ,
  129 .Xr zfs-destroy 8 ,
  130 .Xr zfs-diff 8 ,
  131 .Xr zfs-hold 8 ,
  132 .Xr zfs-rename 8 ,
  133 .Xr zfs-rollback 8 ,
  134 .Xr zfs-send 8

Cache object: b9d3587301a70bdd615d90f9cf88d71d


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.