From 3ff2eca0be9237d109c9317a7846b287a1b6d458 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Thu, 5 Jun 2025 15:50:42 +1000 Subject: [PATCH] zfs-program(8): document zfs.sync.clone() Reviewed-by: Brian Behlendorf Reviewed-by: Alexander Motin Signed-off-by: Rob Norris Sponsored-by: https://despairlabs.com/sponsor/ Closes #17426 --- man/man8/zfs-program.8 | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/man/man8/zfs-program.8 b/man/man8/zfs-program.8 index 710142d1e..d87042c4c 100644 --- a/man/man8/zfs-program.8 +++ b/man/man8/zfs-program.8 @@ -12,8 +12,9 @@ .\" Copyright (c) 2016, 2019 by Delphix. All Rights Reserved. .\" Copyright (c) 2019, 2020 by Christian Schwarz. All Rights Reserved. .\" Copyright 2020 Joyent, Inc. +.\" Copyright (c) 2025, Rob Norris .\" -.Dd May 27, 2021 +.Dd June 5, 2025 .Dt ZFS-PROGRAM 8 .Os . @@ -347,6 +348,32 @@ They are executed in "syncing context". .Pp The available sync submodule functions are as follows: .Bl -tag -width "xx" +.It Fn zfs.sync.clone snapshot newdataset +Create a new filesystem from a snapshot. +Returns 0 if the filesystem was successfully created, +and a nonzero error code otherwise. +.Pp +Note: Due to general limitations in channel programs, a filesystem created +this way will not be mounted, regardless of the value of the +.Sy mountpoint +and +.Sy canmount +properties. +This limitation may be removed in the future, +so it is recommended that you set +.Sy mountpoint Ns = Ns Sy none +or +.Sy canmount Ns = Ns Sy off +or +.Sy noauto +to avoid surprises. +.Pp +.Bl -tag -compact -width "newbookmark (string)" +.It Ar snapshot Pq string +Name of the source snapshot to clone. +.It Ar newdataset Pq string +Name of the target dataset to create. +.El .It Sy zfs.sync.destroy Ns Pq Ar dataset , Op Ar defer Ns = Ns Sy true Ns | Ns Sy false Destroy the given dataset. Returns 0 on successful destroy, or a nonzero error code if the dataset could @@ -474,6 +501,7 @@ The available .Sy zfs.check functions are: .Bl -tag -compact -width "xx" +.It Fn zfs.check.clone snapshot newdataset .It Sy zfs.check.destroy Ns Pq Ar dataset , Op Ar defer Ns = Ns Sy true Ns | Ns Sy false .It Fn zfs.check.promote dataset .It Fn zfs.check.rollback filesystem