ZFS-CREATE(8)
π zfs-create β create ZFS dataset π
okay bestie, welcome to zfs-create(8), straight out of the System Manager's Manual π
this is the one that makes your datasets exist. yes, the glow-up moment. β¨
πΈ SYNOPSIS πΈ
zfs create [-Pnpuv] [-o property=value]β¦ filesystem
zfs create [-ps] [-b blocksize] [-o property=value]β¦ -V size volume
two whole modes, no cap. one for filesystems, one for volumes. pick your fighter. π«Ά
π¦ DESCRIPTION π¦
β¨ the filesystem era β¨
zfs create [-Pnpuv] [-o property=value]β¦ filesystem
Creates a new ZFS file system. π The file system is automatically mounted according to the mountpoint property inherited from the parent, unless the -u option is used. so like, it mounts itself, that's just the vibe.
-o property=valueβ Sets the specified property as if the commandzfs set property=valuewas invoked at the same time the dataset was created. Any editable ZFS property can also be set at creation time. Multiple-ooptions can be specified. An error results if the same property is specified in multiple-ooptions. (pick one, we are NOT doing duplicates, that's giving chaos π)-pβ Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to themountpointproperty inherited from their parent. Any property specified on the command line using the-ooption is ignored. If the target filesystem already exists, the operation completes successfully. lowkey the "build the whole tree while you're at it" button π-nβ Do a dry-run ("No-op") creation. No datasets will be created. This is useful in conjunction with the-vor-Pflags to validate properties that are passed via-ooptions and those implied by other options. The actual dataset creation can still fail due to insufficient privileges or available capacity. it's giving dress rehearsal π β remember, the real thing can still flop later.-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. Thecreate_ancestorsandcreatekeys havefilesystemas their only value. Thecreate_ancestorskey only appears if the-poption is used. Thepropertykey has two values, a property name that property's value. Thepropertykey may appear zero or more times, once for each property that will be set local tofilesystemdue to the use of the-ooption. tabs are the separator, the robots are fed π-uβ Do not mount the newly created file system. (it exists. it's just... not showing up. mysterious. π)-vβ Print verbose information about the created dataset. tell me everything, bestie π£οΈ
π the volume era π
zfs create [-ps] [-b blocksize] [-o property=value]β¦ -V size volume
Creates a volume of the given size. π₯ The volume is exported as a block device in /dev/zvol/path, where path is the name of the volume in the ZFS namespace. The size represents the logical size as exported by the device. By default, a reservation of equal size is created.
size is automatically rounded up to the nearest multiple of the blocksize. (yes queen, it rounds up, don't fight it β¨)
-b blocksizeβ Equivalent to-o volblocksize=blocksize. If this option is specified in conjunction with-o volblocksize, the resulting behavior is undefined. β οΈ do not. do NOT mix them. that's not a vibe, that's a mystery box and not the cute kind.-o property=valueβ Sets the specified property as if thezfs set property=valuecommand was invoked at the same time the dataset was created. Any editable ZFS property can also be set at creation time. Multiple-ooptions can be specified. An error results if the same property is specified in multiple-ooptions.-pβ Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to themountpointproperty inherited from their parent. Any property specified on the command line using the-ooption is ignored. If the target filesystem already exists, the operation completes successfully.-sβ Creates a sparse volume with no reservation. Seevolsizein the Native Properties section ofzfsprops(7)for more information about sparse volumes. no reservation, no commitment, very main character energy π-nβ Do a dry-run ("No-op") creation. No datasets will be created. This is useful in conjunction with the-vor-Pflags to validate properties that are passed via-ooptions and those implied by other options. The actual dataset creation can still fail due to insufficient privileges or available capacity.-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. Thecreate_ancestorsandcreatekeys havevolumeas their only value. Thecreate_ancestorskey only appears if the-poption is used. Thepropertykey has two values, a property name that property's value. Thepropertykey may appear zero or more times, once for each property that will be set local tovolumedue to the use of the-bor-ooptions, as well asrefreservationif the volume is not sparse. π«Ά-vβ Print verbose information about the created dataset.
π§ ZFS for Swap π§
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. nope. not a thing. don't try it, bestie. π
π EXAMPLES π
β Example 1: Creating a ZFS File System Hierarchy
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. inheritance is the moment, fr fr π
# zfs create pool/home
# zfs set mountpoint=/export/home pool/home
# zfs create pool/home/bob
β 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
the swap-the-identity arc, honestly iconic πΈ
π SEE ALSO π
that's the whole page, bestie, you ate π this was OpenZFS, dated June 2, 2023, and it lives in section 8 of the manual. go make some datasets. slay. πβ¨π¦
π¦ where this page comes from
- alpine 3.23: zfs-doc 2.4.4-r0 Β· CDDL-1.0
- alpine 3.24: zfs-doc 2.4.4-r0 Β· CDDL-1.0
- nixos 26.05: zfs-user 2.4.4
- nixpkgs unstable: zfs-user 2.4.4
- ubuntu resolute: zfsutils-linux 2.4.1-1ubuntu5 Β· CDDL-1.0
- ubuntu resolute: zfsutils-linux 2.4.1-1ubuntu5.1 Β· CDDL-1.0
- ubuntu stonking: zfsutils-linux 2.4.4-1ubuntu4 Β· CDDL-1.0
- π the page's license: CDDL-1.0
- Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved
- Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
- Copyright (c) 2011, 2019 by Delphix. All rights reserved
- Copyright (c) 2013 by Saso Kiselkov. All rights reserved
- Copyright (c) 2014, Joyent, Inc. All rights reserved
- Copyright (c) 2014 by Adam Stevko. All rights reserved
- Copyright (c) 2014 Integros [integros.com]
- Copyright 2019 Richard Laager. All rights reserved
- Copyright 2018 Nexenta Systems, Inc
- Copyright 2019 Joyent, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms