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