ZFS-CLONE(8)
π zfs-clone(8) β clone snapshot of ZFS dataset π
okay bestie, welcome to zfs-clone, a page from the System Manager's Manual (that's the manual name, we're being fancy today π
). It's got one job and it does it gorgeously: making a clone out of a snapshot. Let's get into it π¦
β¨ SYNOPSIS β¨
zfs clone [-pu] [-o property=value]β¦ snapshot filesystem|volume
that's it. that's the whole vibe. β¨
πΈ DESCRIPTION πΈ
fr fr, if you want the deep lore, go read the βClonesβ section of zfsconcepts(7) β it's giving required reading. π
the tea: your target dataset can live anywhere in the ZFS hierarchy, and it gets created as the same type as the original. no cap.
now, the flags, one by one, no skipping, we don't do that here π
-o property=valueβ sets the specified property. that's it, that's the whole flag. for the deets, go seezfs create(it explains it way better than I could, iykyk). π-pβ creates all the non-existing parent datasets. iconic. and here's the cute part: datasets made this way get automatically mounted according to themountpointproperty inherited from their parent. πͺ and if the target filesystem or volume already exists? the operation just completes successfully. no drama, no error, we move on. periodt.-uβ do not mount the newly created file system. she's created but she's staying home. π
π EXAMPLES π
β Example 1: Creating a ZFS Clone
this command creates a writable file system whose initial contents are the same as pool/home/bob@yesterday. slay.
# zfs clone pool/home/bob@yesterday pool/clone
π₯ Example 2: Promoting a ZFS Clone
okay this one is the main character moment π. these 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. chef's kiss.
# 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
π¦ SEE ALSO π¦
and that's the whole page, bestie!! this masterpiece came to you from OpenZFS, dated July 11, 2022 β like, that's the source and the version and the date, all wrapped up with a bow π. go clone something cute. mwah πβ¨
π¦ 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