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.
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 .\" or https://opensource.org/licenses/CDDL-1.0.
10 .\" See the License for the specific language governing permissions
11 .\" and limitations under the License.
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]
21 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
22 .\" Copyright (c) 2012, 2018 by Delphix. All rights reserved.
23 .\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved.
24 .\" Copyright (c) 2017 Datto Inc.
25 .\" Copyright (c) 2018 George Melikov. All Rights Reserved.
26 .\" Copyright 2017 Nexenta Systems, Inc.
27 .\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
28 .\" Copyright (c) 2021, Colm Buckley <colm@tuatha.org>
36 .Nd create ZFS storage pool
41 .Op Fl m Ar mountpoint
42 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns …
43 .Oo Fl o Sy feature@ Ns Ar feature Ns = Ns Ar value Oc
44 .Op Fl o Ar compatibility Ns = Ns Sy off Ns | Ns Sy legacy Ns | Ns Ar file Ns Oo , Ns Ar file Oc Ns …
45 .Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns …
52 Creates a new storage pool containing the virtual devices specified on the
54 The pool name must begin with a letter, and can only contain
55 alphanumeric characters as well as the underscore
72 are reserved, as are names beginning with
80 specification is described in the
85 The command attempts to verify that each device specified is accessible and not
86 currently in use by another subsystem.
87 However this check is not robust enough
88 to detect simultaneous attempts to use a new device in different pools, even if
89 .Sy multihost Ns = Sy enabled .
90 The administrator must ensure, that simultaneous invocations of any combination of
91 .Nm zpool Cm replace ,
95 .Nm zpool Cm labelclear ,
96 do not refer to the same device.
97 Using the same device in two pools will result in pool corruption.
99 There are some uses, such as being currently mounted, or specified as the
100 dedicated dump device, that prevents a device from ever being used by ZFS.
101 Other uses, such as having a preexisting UFS file system, can be overridden with
104 The command also checks that the replication strategy for the pool is
106 An attempt to combine redundant and non-redundant storage in a single pool,
107 or to mix disks and files, results in an error unless
110 The use of differently-sized devices within a single raidz or mirror group is
111 also flagged as an error unless
117 option is specified, the default mount point is
119 The mount point must not exist or must be empty, or else the root dataset
120 will not be able to be be mounted.
121 This can be overridden with the
125 By default all supported features are enabled on the new pool.
129 .Fl o Ar compatibility
131 .Pq e.g Fl o Sy compatibility Ns = Ns Ar 2020
132 can be used to restrict the features that are enabled, so that the
133 pool can be imported on other releases of ZFS.
134 .Bl -tag -width "-t tname"
136 Do not enable any features on the new pool.
137 Individual features can be enabled by setting their corresponding properties to
143 for details about feature properties.
147 even if they appear in use or specify a conflicting replication level.
148 Not all devices can be overridden in this manner.
149 .It Fl m Ar mountpoint
150 Sets the mount point for the root dataset.
151 The default mount point is
158 The mount point must be an absolute path,
162 For more information on dataset mount points, see
165 Displays the configuration that would be used without actually creating the
167 The actual pool creation can still fail due to insufficient privileges or
169 .It Fl o Ar property Ns = Ns Ar value
170 Sets the given pool properties.
173 for a list of valid properties that can be set.
174 .It Fl o Ar compatibility Ns = Ns Sy off Ns | Ns Sy legacy Ns | Ns Ar file Ns Oo , Ns Ar file Oc Ns …
175 Specifies compatibility feature sets.
178 for more information about compatibility feature sets.
179 .It Fl o Sy feature@ Ns Ar feature Ns = Ns Ar value
180 Sets the given pool feature.
183 section for a list of valid features that can be set.
184 Value can be either disabled or enabled.
185 .It Fl O Ar file-system-property Ns = Ns Ar value
186 Sets the given file system properties in the root file system of the pool.
189 for a list of valid properties that can be set.
192 .Fl o Sy cachefile Ns = Ns Sy none Fl o Sy altroot Ns = Ns Ar root
194 Sets the in-core pool name to
196 while the on-disk name will be the name specified as
198 This will set the default of the
203 to handle name space collisions when creating pools for other systems,
204 such as virtual machines or physical machines whose pools live on network
209 .\" These are, respectively, examples 1, 2, 3, 4, 11, 12 from zpool.8
210 .\" Make sure to update them bidirectionally
211 .Ss Example 1 : No Creating a RAID-Z Storage Pool
212 The following command creates a pool with a single raidz root vdev that
213 consists of six disks:
214 .Dl # Nm zpool Cm create Ar tank Sy raidz Pa sda sdb sdc sdd sde sdf
216 .Ss Example 2 : No Creating a Mirrored Storage Pool
217 The following command creates a pool with two mirrors, where each mirror
219 .Dl # Nm zpool Cm create Ar tank Sy mirror Pa sda sdb Sy mirror Pa sdc sdd
221 .Ss Example 3 : No Creating a ZFS Storage Pool by Using Partitions
222 The following command creates a non-redundant pool using two disk partitions:
223 .Dl # Nm zpool Cm create Ar tank Pa sda1 sdb2
225 .Ss Example 4 : No Creating a ZFS Storage Pool by Using Files
226 The following command creates a non-redundant pool using files.
227 While not recommended, a pool based on files can be useful for experimental
229 .Dl # Nm zpool Cm create Ar tank Pa /path/to/file/a /path/to/file/b
231 .Ss Example 5 : No Managing Hot Spares
232 The following command creates a new pool with an available hot spare:
233 .Dl # Nm zpool Cm create Ar tank Sy mirror Pa sda sdb Sy spare Pa sdc
235 .Ss Example 6 : No Creating a ZFS Pool with Mirrored Separate Intent Logs
236 The following command creates a ZFS storage pool consisting of two, two-way
237 mirrors and mirrored log devices:
238 .Dl # Nm zpool Cm create Ar pool Sy mirror Pa sda sdb Sy mirror Pa sdc sdd Sy log mirror Pa sde sdf
241 .Xr zpool-destroy 8 ,