From d45d7f08fa56f94fc9577a6578cb411071a42e8d Mon Sep 17 00:00:00 2001 From: Mike Gerdts Date: Tue, 16 Jul 2019 13:19:24 -0500 Subject: Add zfs create dryrun Adds the ability to sanity check zfs create arguments and to see the value of any additional properties that will local to the dataset. For example, automation that may need to adjust quota on a parent filesystem before creating a volume may call `zfs create -nP -V ` to obtain the value of refreservation. This adds the following options to zfs create: - -n dry-run (no-op) - -v verbose - -P parseable (implies verbose) Reviewed-by: Ryan Moeller Reviewed-by: Brian Behlendorf Reviewed-by: Matt Ahrens Reviewed-by: Jerry Jelinek Signed-off-by: Mike Gerdts Closes #8974 --- man/man8/zfs.8 | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 93 insertions(+), 5 deletions(-) (limited to 'man/man8') diff --git a/man/man8/zfs.8 b/man/man8/zfs.8 index 3fc142f5e..cbbd76503 100644 --- a/man/man8/zfs.8 +++ b/man/man8/zfs.8 @@ -28,9 +28,9 @@ .\" Copyright (c) 2014 Integros [integros.com] .\" Copyright 2019 Richard Laager. All rights reserved. .\" Copyright 2018 Nexenta Systems, Inc. -.\" Copyright 2018 Joyent, Inc. +.\" Copyright 2019 Joyent, Inc. .\" -.Dd April 30, 2019 +.Dd June 30, 2019 .Dt ZFS 8 SMM .Os Linux .Sh NAME @@ -41,12 +41,12 @@ .Fl ?V .Nm .Cm create -.Op Fl p +.Op Fl Pnpv .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... .Ar filesystem .Nm .Cm create -.Op Fl ps +.Op Fl Pnpsv .Op Fl b Ar blocksize .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... .Fl V Ar size Ar volume @@ -2556,7 +2556,7 @@ subcommand. .It Xo .Nm .Cm create -.Op Fl p +.Op Fl Pnpv .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... .Ar filesystem .Xc @@ -2585,6 +2585,48 @@ Any property specified on the command line using the .Fl o option is ignored. If the target filesystem already exists, the operation completes successfully. +.It Fl n +Do a dry-run +.Pq Qq No-op +creation. +No datasets will be created. +This is useful in conjunction with the +.Fl v +or +.Fl P +flags to validate properties that are passed via +.Fl o +options and those implied by other options. +The actual dataset creation can still fail due to insufficient privileges or +available capacity. +.It Fl P +Print machine-parsable verbose information about the created dataset. +Each line of output contains a key and one or two values, all separated by tabs. +The +.Sy create_ancestors +and +.Sy create +keys have +.Em filesystem +as their only value. +The +.Sy create_ancestors +key only appears if the +.Fl p +option is used. +The +.Sy property +key has two values, a property name that property's value. +The +.Sy property +key may appear zero or more times, once for each property that will be set local +to +.Em filesystem +due to the use of the +.Fl o +option. +.It Fl v +Print verbose information about the created dataset. .El .It Xo .Nm @@ -2641,6 +2683,52 @@ See in the .Sx Native Properties section for more information about sparse volumes. +.It Fl n +Do a dry-run +.Pq Qq No-op +creation. +No datasets will be created. +This is useful in conjunction with the +.Fl v +or +.Fl P +flags to validate properties that are passed via +.Fl o +options and those implied by other options. +The actual dataset creation can still fail due to insufficient privileges or +available capacity. +.It Fl P +Print machine-parsable verbose information about the created dataset. +Each line of output contains a key and one or two values, all separated by tabs. +The +.Sy create_ancestors +and +.Sy create +keys have +.Em volume +as their only value. +The +.Sy create_ancestors +key only appears if the +.Fl p +option is used. +The +.Sy property +key has two values, a property name that property's value. +The +.Sy property +key may appear zero or more times, once for each property that will be set local +to +.Em volume +due to the use of the +.Fl b +or +.Fl o +options, as well as +.Sy refreservation +if the volume is not sparse. +.It Fl v +Print verbose information about the created dataset. .El .It Xo .Nm -- cgit v1.2.3