ZFS-SNAPSHOT(8)
π zfs-snapshot β bestie edition π
okay so you opened the manual page for zfs-snapshot(8), which lives in the System Manager's Manual section, and honestly? you're about to have the best time. sit down, hydrate, we're making snapshots β¨
πΈ NAME πΈ
zfs-snapshot β create snapshots of ZFS datasets π«Ά
π SYNOPSIS π
zfs snapshot [-r] [-o property=value]β¦ dataset@snapnameβ¦
like. that's it. that's the whole vibe. look at her π
β¨ DESCRIPTION β¨
So what this does is: it makes a snapshot of a dataset, OR multiple snapshots of different datasets. multiple. at once. she's efficient, she's organized, she's that girl π
Now the important part, and I need you to really hear me on this one: snapshots are created atomically. which means a snapshot is a consistent image of a dataset at one specific point in time β it captures every modification to the dataset made by system calls that successfully completed before that point in time. no half-finished nonsense, no "oops I caught it mid-write", none of that. clean. pristine. iconic.
and if you use the -r option to make recursive snapshots? they are all created at the same time. every single one of them. no cap. π¦
oh and also β zfs snap can be used as an alias for zfs snapshot. so if you're feeling lazy (respect), you can just type snap. lowercase bestie behavior, we love it π
if you want the deep lore, go read the "Snapshots" section of zfsconcepts(7). it's giving required reading π
-o property=valueβ sets the specified property; peepzfs createfor the deets on how that works β¨-rβ recursively creates snapshots of all descendent datasets π
π EXAMPLES π
π Example 1: Creating a ZFS Snapshot
This command creates a snapshot named yesterday. That snapshot gets mounted on demand in the .zfs/snapshot directory at the root of the pool/home/bob file system. cute, right?
# zfs snapshot pool/home/bob@yesterday
π Example 2: Creating and Destroying Multiple Snapshots
This 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 own file system. then the second command destroys the brand-new snapshots. we love a full circle moment π«
# zfs snapshot -r pool/home@yesterday
# zfs destroy -r pool/home@yesterday
π Example 3: Promoting a ZFS Clone
these commands show you 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. it's a whole glow-up arc, honestly π¦
# zfs create pool/project/production
populate /pool/project/production with data
# zfs snapshot pool/project/production@today
# zfs clone pool/project/production@today pool/project/beta
make changes to /pool/project/beta and test them
# zfs promote pool/project/beta
# zfs rename pool/project/production pool/project/legacy
# zfs rename pool/project/beta pool/project/production
once the legacy version is no longer needed, it can be destroyed
# zfs destroy pool/project/legacy
π Example 4: Performing a Rolling Snapshot
this example shows how to keep 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 one. like a little conveyor belt of memories π
# zfs destroy -r pool/users@7daysago
# zfs rename -r pool/users@6daysago @7daysago
# zfs rename -r pool/users@5daysago @6daysago
# zfs rename -r pool/users@4daysago @5daysago
# zfs rename -r pool/users@3daysago @4daysago
# zfs rename -r pool/users@2daysago @3daysago
# zfs rename -r pool/users@yesterday @2daysago
# zfs rename -r pool/users@today @yesterday
# zfs snapshot -r pool/users@today
π SEE ALSO π
the whole friend group, fr fr:
zfs-bookmark(8)zfs-clone(8)zfs-destroy(8)zfs-diff(8)zfs-hold(8)zfs-rename(8)zfs-rollback(8)zfs-send(8)
okay that's the page!! this one came from OpenZFS, dated July 11, 2022, and yes that date is giving vintage but she ate and left no crumbs π β¨ go make some snapshots bestie, you got this π«Άπ
π¦ where this page comes from
- alpine 3.23: zfs-doc 2.4.4-r0 Β· CDDL-1.0
- alpine 3.24: zfs-doc 2.4.4-r0 Β· CDDL-1.0
- nixos 26.05: zfs-user 2.4.4
- nixpkgs unstable: zfs-user 2.4.4
- ubuntu resolute: zfsutils-linux 2.4.1-1ubuntu5 Β· CDDL-1.0
- ubuntu resolute: zfsutils-linux 2.4.1-1ubuntu5.1 Β· CDDL-1.0
- ubuntu stonking: zfsutils-linux 2.4.4-1ubuntu4 Β· CDDL-1.0
- π the page's license: CDDL-1.0
- Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved
- Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
- Copyright (c) 2011, 2019 by Delphix. All rights reserved
- Copyright (c) 2013 by Saso Kiselkov. All rights reserved
- Copyright (c) 2014, Joyent, Inc. All rights reserved
- Copyright (c) 2014 by Adam Stevko. All rights reserved
- Copyright (c) 2014 Integros [integros.com]
- Copyright 2019 Richard Laager. All rights reserved
- Copyright 2018 Nexenta Systems, Inc
- Copyright 2019 Joyent, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms