ZFS-CLONE(8) System Manager's Manual ZFS-CLONE(8)

# [NAME](#NAME)

`zfs-clone` — clone snapshot of ZFS dataset

# [SYNOPSIS](#SYNOPSIS)

`zfs` `clone` \[`-pu`] \[`-o` `property`=`value`]… `snapshot` `filesystem`|`volume`

# [DESCRIPTION](#DESCRIPTION)

See the [Clones](#Clones) section of [zfsconcepts(7)](/man/os/zfs/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`](#o) `property`=`value`

Sets the specified property; see `zfs` `create` for details.

[`-p`](#p)

Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the [**mountpoint**](#mountpoint) property inherited from their parent. If the target filesystem or volume already exists, the operation completes successfully.

[`-u`](#u)

Do not mount the newly created file system.

# [EXAMPLES](#EXAMPLES)

## [Example 1: Creating a ZFS Clone](#Example_1_:_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: Promoting a ZFS Clone](#Example_2_:_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
```

# [SEE ALSO](#SEE_ALSO)

[zfs-promote(8)](/man/os/zfs/zfs-promote.8), [zfs-snapshot(8)](/man/os/zfs/zfs-snapshot.8)

July 11, 2022 OpenZFS

---

Document: zfs-clone(8) from zfs 2.4.4-r4 (Chainguard OS)
Source: https://github.com/openzfs/zfs
