1.\" 2.\" CDDL HEADER START 3.\" 4.\" The contents of this file are subject to the terms of the 5.\" Common Development and Distribution License (the "License"). 6.\" You may not use this file except in compliance with the License. 7.\" 8.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9.\" or http://www.opensolaris.org/os/licensing. 10.\" See the License for the specific language governing permissions 11.\" and limitations under the License. 12.\" 13.\" When distributing Covered Code, include this CDDL HEADER in each 14.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15.\" If applicable, add the following below this CDDL HEADER, with the 16.\" fields enclosed by brackets "[]" replaced with your own identifying 17.\" information: Portions Copyright [yyyy] [name of copyright owner] 18.\" 19.\" CDDL HEADER END 20.\" 21.\" 22.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved. 23.\" Copyright (c) 2012, 2018 by Delphix. All rights reserved. 24.\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved. 25.\" Copyright (c) 2017 Datto Inc. 26.\" Copyright (c) 2018 George Melikov. All Rights Reserved. 27.\" Copyright 2017 Nexenta Systems, Inc. 28.\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved. 29.\" Copyright (c) 2021, Colm Buckley <colm@tuatha.org> 30.\" 31.Dd August 9, 2019 32.Dt ZPOOL-CREATE 8 33.Os 34.Sh NAME 35.Nm zpool-create 36.Nd Creates a new ZFS storage pool 37.Sh SYNOPSIS 38.Nm zpool 39.Cm create 40.Op Fl dfn 41.Op Fl m Ar mountpoint 42.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... 43.Oo Fl o Ar feature@feature Ns = Ns Ar value Oc 44.Op Fl o Ar compatibility Ns = Ns Ar off | legacy | file Bq , Ns Ar file Ns ... 45.Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns ... 46.Op Fl R Ar root 47.Ar pool vdev Ns ... 48.Sh DESCRIPTION 49.Bl -tag -width Ds 50.It Xo 51.Nm zpool 52.Cm create 53.Op Fl dfn 54.Op Fl m Ar mountpoint 55.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... 56.Oo Fl o Ar feature@feature Ns = Ns Ar value Oc Ns ... 57.Op Fl o Ar compatibility Ns = Ns Ar off | legacy | file Bq , Ns Ar file Ns ... 58.Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns ... 59.Op Fl R Ar root 60.Op Fl t Ar tname 61.Ar pool vdev Ns ... 62.Xc 63Creates a new storage pool containing the virtual devices specified on the 64command line. 65The pool name must begin with a letter, and can only contain 66alphanumeric characters as well as underscore 67.Pq Qq Sy _ , 68dash 69.Pq Qq Sy \&- , 70colon 71.Pq Qq Sy \&: , 72space 73.Pq Qq Sy \&\ , 74and period 75.Pq Qq Sy \&. . 76The pool names 77.Sy mirror , 78.Sy raidz , 79.Sy draid , 80.Sy spare 81and 82.Sy log 83are reserved, as are names beginning with 84.Sy mirror , 85.Sy raidz , 86.Sy draid , 87.Sy spare , 88and the pattern 89.Sy c[0-9] . 90The 91.Ar vdev 92specification is described in the 93.Em Virtual Devices 94section of 95.Xr zpoolconcepts. 96.Pp 97The command attempts to verify that each device specified is accessible and not 98currently in use by another subsystem. However this check is not robust enough 99to detect simultaneous attempts to use a new device in different pools, even if 100.Sy multihost 101is 102.Sy enabled. 103The 104administrator must ensure that simultaneous invocations of any combination of 105.Sy zpool replace , 106.Sy zpool create , 107.Sy zpool add , 108or 109.Sy zpool labelclear , 110do not refer to the same device. Using the same device in two pools will 111result in pool corruption. 112.Pp 113There are some uses, such as being currently mounted, or specified as the 114dedicated dump device, that prevents a device from ever being used by ZFS. 115Other uses, such as having a preexisting UFS file system, can be overridden with 116the 117.Fl f 118option. 119.Pp 120The command also checks that the replication strategy for the pool is 121consistent. 122An attempt to combine redundant and non-redundant storage in a single pool, or 123to mix disks and files, results in an error unless 124.Fl f 125is specified. 126The use of differently sized devices within a single raidz or mirror group is 127also flagged as an error unless 128.Fl f 129is specified. 130.Pp 131Unless the 132.Fl R 133option is specified, the default mount point is 134.Pa / Ns Ar pool . 135The mount point must not exist or must be empty, or else the root dataset 136cannot be mounted. 137This can be overridden with the 138.Fl m 139option. 140.Pp 141By default all supported features are enabled on the new pool. The 142.Fl d 143option or the 144.Fl o Ar compatibility 145property (eg: 146.Fl o Ar compatibility=2020 147) can be used to restrict the features that are enabled, so that the 148pool can be imported on other releases of the ZFS software. 149.Bl -tag -width Ds 150.It Fl d 151Do not enable any features on the new pool. 152Individual features can be enabled by setting their corresponding properties to 153.Sy enabled 154with the 155.Fl o 156option. 157See 158.Xr zpool-features 5 159for details about feature properties. 160.It Fl f 161Forces use of 162.Ar vdev Ns s , 163even if they appear in use or specify a conflicting replication level. 164Not all devices can be overridden in this manner. 165.It Fl m Ar mountpoint 166Sets the mount point for the root dataset. 167The default mount point is 168.Pa /pool 169or 170.Pa altroot/pool 171if 172.Ar altroot 173is specified. 174The mount point must be an absolute path, 175.Sy legacy , 176or 177.Sy none . 178For more information on dataset mount points, see 179.Xr zfs 8 . 180.It Fl n 181Displays the configuration that would be used without actually creating the 182pool. 183The actual pool creation can still fail due to insufficient privileges or 184device sharing. 185.It Fl o Ar property Ns = Ns Ar value 186Sets the given pool properties. 187See the 188.Xr zpoolprops 189manual page for a list of valid properties that can be set. 190.It Fl o Ar compatibility Ns = Ns Ar off | legacy | file Bq , Ns Ar file Ns ... 191Specifies compatibility feature sets. See 192.Xr zpool-features 5 193for more information about compatibility feature sets. 194.It Fl o Ar feature@feature Ns = Ns Ar value 195Sets the given pool feature. See the 196.Xr zpool-features 5 197section for a list of valid features that can be set. 198Value can be either disabled or enabled. 199.It Fl O Ar file-system-property Ns = Ns Ar value 200Sets the given file system properties in the root file system of the pool. 201See the 202.Xr zfsprops 8 203manual page for a list of valid properties that can be set. 204.It Fl R Ar root 205Equivalent to 206.Fl o Sy cachefile Ns = Ns Sy none Fl o Sy altroot Ns = Ns Ar root 207.It Fl t Ar tname 208Sets the in-core pool name to 209.Sy tname 210while the on-disk name will be the name specified as the pool name 211.Sy pool . 212This will set the default cachefile property to none. This is intended 213to handle name space collisions when creating pools for other systems, 214such as virtual machines or physical machines whose pools live on network 215block devices. 216.El 217.El 218.Sh SEE ALSO 219.Xr zpool-destroy 8 , 220.Xr zpool-export 8 , 221.Xr zpool-import 8 222