logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

zfs-snapshot — create snapshots of ZFS datasets

Description

       Creates a snapshot of a dataset or multiple snapshots of different datasets.

       Snapshots  are  created atomically.  That is, a snapshot is a consistent image of a dataset at a specific
       point in time; it includes all modifications to the dataset made by system calls that  have  successfully
       completed  before  that point in time.  Recursive snapshots created through the -r option are all created
       at the same time.

       zfssnap can be used as an alias for zfssnapshot.

       See the “Snapshots” section of zfsconcepts(7) for details.

       -oproperty=value
           Set the specified property; see zfscreate for details.

       -r  Recursively create snapshots of all descendent datasets

Examples

Example1: Creating a ZFS Snapshot
       The following command creates a snapshot named yesterday.  This snapshot is  mounted  on  demand  in  the
       .zfs/snapshot directory at the root of the pool/home/bob file system.
             #zfssnapshotpool/home/bob@yesterdayExample2: Creating and Destroying Multiple Snapshots
       The  following  command  creates  snapshots  named  yesterday of pool/home and all of its descendent file
       systems.  Each snapshot is mounted on demand in the .zfs/snapshot directory  at  the  root  of  its  file
       system.  The second command destroys the newly created snapshots.
             #zfssnapshot-rpool/home@yesterday#zfsdestroy-rpool/home@yesterdayExample3: Promoting a ZFS Clone
       The following commands illustrate how to test out changes to a file system, and then replace the original
       file system with the changed one, using clones, clone promotion, and renaming:
             # zfscreatepool/project/production
               populate /pool/project/production with data
             # zfssnapshotpool/project/production@today
             # zfsclonepool/project/production@todaypool/project/beta
               make changes to /pool/project/beta and test them
             # zfspromotepool/project/beta
             # zfsrenamepool/project/productionpool/project/legacy
             # zfsrenamepool/project/betapool/project/production
               once the legacy version is no longer needed, it can be destroyed
             # zfsdestroypool/project/legacyExample4: Performing a Rolling Snapshot
       The  following  example shows how to maintain a history of snapshots with a consistent naming scheme.  To
       keep a week's worth of snapshots, the user destroys the oldest snapshot, renames the remaining snapshots,
       and then creates a new snapshot, as follows:
             # zfsdestroy-rpool/users@7daysago
             # zfsrename-rpool/users@6daysago @7daysago
             # zfsrename-rpool/users@5daysago @6daysago
             # zfsrename-rpool/users@4daysago @5daysago
             # zfsrename-rpool/users@3daysago @4daysago
             # zfsrename-rpool/users@2daysago @3daysago
             # zfsrename-rpool/users@yesterday @2daysago
             # zfsrename-rpool/users@today @yesterday
             # zfssnapshot-rpool/users@today

Name

       zfs-snapshot — create snapshots of ZFS datasets

See Also

zfs-bookmark(8), zfs-clone(8), zfs-destroy(8), zfs-diff(8), zfs-hold(8), zfs-rename(8),  zfs-rollback(8),
       zfs-send(8)

OpenZFS                                          March 16, 2022                                  ZFS-SNAPSHOT(8)

Synopsis

zfssnapshot [-r] [-oproperty=value]… dataset@snapname

See Also