ZFS-CREATE(8) | System Manager's Manual | ZFS-CREATE(8) |
zfs-create
—
create ZFS dataset
zfs |
create [-Pnpuv ]
[-o
property=value]…
filesystem |
zfs |
create [-ps ]
[-b blocksize]
[-o
property=value]…
-V size
volume |
zfs
create
[-Pnpuv
] [-o
property=value]…
filesystem-u
option is used.
-o
property=valuezfs
set
property=value was invoked
at the same time the dataset was created. Any editable ZFS property
can also be set at creation time. Multiple -o
options can be specified. An error results if the same property is
specified in multiple -o
options.-p
-o
option is ignored. If the target filesystem
already exists, the operation completes successfully.-n
-v
or -P
flags to
validate properties that are passed via -o
options and those implied by other options. The actual dataset
creation can still fail due to insufficient privileges or available
capacity.-P
-p
option is used. The
property key has two values, a property name that
property's value. The property key may appear zero
or more times, once for each property that will be set local to
filesystem due to the use of the
-o
option.-u
-v
zfs
create
[-ps
] [-b
blocksize] [-o
property=value]…
-V
size
volumesize is automatically rounded up to the nearest multiple of the blocksize.
-b
blocksize-o
volblocksize=blocksize. If
this option is specified in conjunction with
-o
volblocksize, the
resulting behavior is undefined.-o
property=valuezfs
set
property=value command was
invoked at the same time the dataset was created. Any editable ZFS
property can also be set at creation time. Multiple
-o
options can be specified. An error results
if the same property is specified in multiple
-o
options.-p
-o
option is ignored. If the target filesystem
already exists, the operation completes successfully.-s
-n
-v
or -P
flags to
validate properties that are passed via -o
options and those implied by other options. The actual dataset
creation can still fail due to insufficient privileges or available
capacity.-P
-p
option is used. The
property key has two values, a property name that
property's value. The property key may appear zero
or more times, once for each property that will be set local to
volume due to the use of the
-b
or -o
options, as
well as
refreservation
if the volume is not sparse.-v
Swapping to a ZFS volume is prone to deadlock and not recommended. See OpenZFS FAQ.
Swapping to a file on a ZFS filesystem is not supported.
The following commands create a file system named pool/home and a file system named pool/home/bob. The mount point /export/home is set for the parent file system, and is automatically inherited by the child file system.
# zfs
create
pool/home
# zfs
set
mountpoint=/export/home
pool/home
# zfs
create
pool/home/bob
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
March 16, 2022 | OpenZFS |