zfs-clone(8)

zfs-clone8

Clone snapshot of zfs dataset

Usage

zfs {clone [-pu] [-o property=value] … snapshot filesystem | volume}

Overview

See the Clones section of zfsconcepts(7) for details. The target dataset can be located anywhere in the ZFS hierarchy, and is created as the same type as the original.

-o property=value

Sets the specified property; see zfs create for details.

-p

Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the mountpoint property inherited from their parent. If the -p option is specified multiple times, parent datasets are created with canmount=off. If the target filesystem or volume already exists, the operation completes successfully.

-u

Do not mount the newly created file system.

Examples

Example 1 : No Creating a ZFS Clone

The following command creates a writable file system whose initial contents are the same as pool/home/bob@yesterday.

# zfs clone pool/home/bob@yesterday pool/clone

Example 2 : No 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:

# 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

Releases

15 releases since FreeBSD 13.0-RELEASE; the text changed 5 times.

  1. 13.0
  2. 13.1–13.5
  3. 14.0–14.5
  4. 15.0
  5. 15.1
  6. 16.0

-u since FreeBSD 15.1-RELEASE.

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.