Print this page
5882 Temporary pool names
Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/man/man1m/zpool.1m
+++ new/usr/src/man/man1m/zpool.1m
1 1 .\"
2 2 .\" CDDL HEADER START
3 3 .\"
4 4 .\" The contents of this file are subject to the terms of the
5 5 .\" Common Development and Distribution License (the "License").
6 6 .\" You may not use this file except in compliance with the License.
7 7 .\"
8 8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 .\" or http://www.opensolaris.org/os/licensing.
10 10 .\" See the License for the specific language governing permissions
11 11 .\" and limitations under the License.
12 12 .\"
13 13 .\" When distributing Covered Code, include this CDDL HEADER in each
14 14 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 .\" If applicable, add the following below this CDDL HEADER, with the
16 16 .\" fields enclosed by brackets "[]" replaced with your own identifying
17 17 .\" information: Portions Copyright [yyyy] [name of copyright owner]
18 18 .\"
19 19 .\" CDDL HEADER END
20 20 .\"
21 21 .\"
22 22 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
23 23 .\" Copyright (c) 2012, 2017 by Delphix. All rights reserved.
24 24 .\" Copyright 2017 Nexenta Systems, Inc.
25 25 .\" Copyright (c) 2017 Datto Inc.
26 26 .\" Copyright (c) 2017 George Melikov. All Rights Reserved.
27 27 .\"
28 28 .Dd April 27, 2018
29 29 .Dt ZPOOL 1M
30 30 .Os
31 31 .Sh NAME
32 32 .Nm zpool
33 33 .Nd configure ZFS storage pools
34 34 .Sh SYNOPSIS
35 35 .Nm
36 36 .Fl \?
37 37 .Nm
38 38 .Cm add
39 39 .Op Fl fn
40 40 .Ar pool vdev Ns ...
41 41 .Nm
42 42 .Cm attach
43 43 .Op Fl f
44 44 .Ar pool device new_device
45 45 .Nm
46 46 .Cm checkpoint
47 47 .Op Fl d, -discard
48 48 .Ar pool
49 49 .Nm
50 50 .Cm clear
|
↓ open down ↓ |
50 lines elided |
↑ open up ↑ |
51 51 .Ar pool
52 52 .Op Ar device
53 53 .Nm
54 54 .Cm create
55 55 .Op Fl dfn
56 56 .Op Fl B
57 57 .Op Fl m Ar mountpoint
58 58 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
59 59 .Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns ...
60 60 .Op Fl R Ar root
61 +.Op Fl t Ar tempname
61 62 .Ar pool vdev Ns ...
62 63 .Nm
63 64 .Cm destroy
64 65 .Op Fl f
65 66 .Ar pool
66 67 .Nm
67 68 .Cm detach
68 69 .Ar pool device
69 70 .Nm
70 71 .Cm export
71 72 .Op Fl f
72 73 .Ar pool Ns ...
73 74 .Nm
74 75 .Cm get
75 76 .Op Fl Hp
76 77 .Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
77 78 .Sy all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns ...
78 79 .Ar pool Ns ...
79 80 .Nm
80 81 .Cm history
81 82 .Op Fl il
82 83 .Oo Ar pool Oc Ns ...
83 84 .Nm
84 85 .Cm import
85 86 .Op Fl D
86 87 .Op Fl d Ar dir
87 88 .Nm
|
↓ open down ↓ |
17 lines elided |
↑ open up ↑ |
88 89 .Cm import
89 90 .Fl a
90 91 .Op Fl DfmN
91 92 .Op Fl F Op Fl n
92 93 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
93 94 .Op Fl o Ar mntopts
94 95 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
95 96 .Op Fl R Ar root
96 97 .Nm
97 98 .Cm import
98 -.Op Fl Dfm
99 +.Op Fl Dfmt
99 100 .Op Fl F Op Fl n
100 101 .Op Fl -rewind-to-checkpoint
101 102 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
102 103 .Op Fl o Ar mntopts
103 104 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
104 105 .Op Fl R Ar root
105 106 .Ar pool Ns | Ns Ar id
106 107 .Op Ar newpool
107 108 .Nm
108 109 .Cm initialize
109 110 .Op Fl cs
110 111 .Ar pool
111 112 .Op Ar device Ns ...
112 113 .Nm
113 114 .Cm iostat
114 115 .Op Fl v
115 116 .Op Fl T Sy u Ns | Ns Sy d
116 117 .Oo Ar pool Oc Ns ...
117 118 .Op Ar interval Op Ar count
118 119 .Nm
119 120 .Cm labelclear
120 121 .Op Fl f
121 122 .Ar device
122 123 .Nm
123 124 .Cm list
124 125 .Op Fl Hpv
125 126 .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
126 127 .Op Fl T Sy u Ns | Ns Sy d
127 128 .Oo Ar pool Oc Ns ...
128 129 .Op Ar interval Op Ar count
129 130 .Nm
130 131 .Cm offline
131 132 .Op Fl t
132 133 .Ar pool Ar device Ns ...
133 134 .Nm
134 135 .Cm online
135 136 .Op Fl e
136 137 .Ar pool Ar device Ns ...
137 138 .Nm
138 139 .Cm reguid
139 140 .Ar pool
140 141 .Nm
141 142 .Cm reopen
142 143 .Ar pool
143 144 .Nm
144 145 .Cm remove
145 146 .Op Fl np
146 147 .Ar pool Ar device Ns ...
147 148 .Nm
148 149 .Cm remove
149 150 .Fl s
150 151 .Ar pool
151 152 .Nm
152 153 .Cm replace
153 154 .Op Fl f
154 155 .Ar pool Ar device Op Ar new_device
155 156 .Nm
156 157 .Cm scrub
157 158 .Op Fl s | Fl p
158 159 .Ar pool Ns ...
159 160 .Nm
160 161 .Cm set
161 162 .Ar property Ns = Ns Ar value
162 163 .Ar pool
163 164 .Nm
164 165 .Cm split
165 166 .Op Fl n
166 167 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
167 168 .Op Fl R Ar root
168 169 .Ar pool newpool
169 170 .Nm
170 171 .Cm status
171 172 .Op Fl Dvx
172 173 .Op Fl T Sy u Ns | Ns Sy d
173 174 .Oo Ar pool Oc Ns ...
174 175 .Op Ar interval Op Ar count
175 176 .Nm
176 177 .Cm upgrade
177 178 .Nm
178 179 .Cm upgrade
179 180 .Fl v
180 181 .Nm
181 182 .Cm upgrade
182 183 .Op Fl V Ar version
183 184 .Fl a Ns | Ns Ar pool Ns ...
184 185 .Sh DESCRIPTION
185 186 The
186 187 .Nm
187 188 command configures ZFS storage pools.
188 189 A storage pool is a collection of devices that provides physical storage and
189 190 data replication for ZFS datasets.
190 191 All datasets within a storage pool share the same space.
191 192 See
192 193 .Xr zfs 1M
193 194 for information on managing datasets.
194 195 .Ss Virtual Devices (vdevs)
195 196 A "virtual device" describes a single device or a collection of devices
196 197 organized according to certain performance and fault characteristics.
197 198 The following virtual devices are supported:
198 199 .Bl -tag -width Ds
199 200 .It Sy disk
200 201 A block device, typically located under
201 202 .Pa /dev/dsk .
202 203 ZFS can use individual slices or partitions, though the recommended mode of
203 204 operation is to use whole disks.
204 205 A disk can be specified by a full path, or it can be a shorthand name
205 206 .Po the relative portion of the path under
206 207 .Pa /dev/dsk
207 208 .Pc .
208 209 A whole disk can be specified by omitting the slice or partition designation.
209 210 For example,
210 211 .Pa c0t0d0
211 212 is equivalent to
212 213 .Pa /dev/dsk/c0t0d0s2 .
213 214 When given a whole disk, ZFS automatically labels the disk, if necessary.
214 215 .It Sy file
215 216 A regular file.
216 217 The use of files as a backing store is strongly discouraged.
217 218 It is designed primarily for experimental purposes, as the fault tolerance of a
218 219 file is only as good as the file system of which it is a part.
219 220 A file must be specified by a full path.
220 221 .It Sy mirror
221 222 A mirror of two or more devices.
222 223 Data is replicated in an identical fashion across all components of a mirror.
223 224 A mirror with N disks of size X can hold X bytes and can withstand (N-1) devices
224 225 failing before data integrity is compromised.
225 226 .It Sy raidz , raidz1 , raidz2 , raidz3
226 227 A variation on RAID-5 that allows for better distribution of parity and
227 228 eliminates the RAID-5
228 229 .Qq write hole
229 230 .Pq in which data and parity become inconsistent after a power loss .
230 231 Data and parity is striped across all disks within a raidz group.
231 232 .Pp
232 233 A raidz group can have single-, double-, or triple-parity, meaning that the
233 234 raidz group can sustain one, two, or three failures, respectively, without
234 235 losing any data.
235 236 The
236 237 .Sy raidz1
237 238 vdev type specifies a single-parity raidz group; the
238 239 .Sy raidz2
239 240 vdev type specifies a double-parity raidz group; and the
240 241 .Sy raidz3
241 242 vdev type specifies a triple-parity raidz group.
242 243 The
243 244 .Sy raidz
244 245 vdev type is an alias for
245 246 .Sy raidz1 .
246 247 .Pp
247 248 A raidz group with N disks of size X with P parity disks can hold approximately
248 249 (N-P)*X bytes and can withstand P device(s) failing before data integrity is
249 250 compromised.
250 251 The minimum number of devices in a raidz group is one more than the number of
251 252 parity disks.
252 253 The recommended number is between 3 and 9 to help increase performance.
253 254 .It Sy spare
254 255 A special pseudo-vdev which keeps track of available hot spares for a pool.
255 256 For more information, see the
256 257 .Sx Hot Spares
257 258 section.
258 259 .It Sy log
259 260 A separate intent log device.
260 261 If more than one log device is specified, then writes are load-balanced between
261 262 devices.
262 263 Log devices can be mirrored.
263 264 However, raidz vdev types are not supported for the intent log.
264 265 For more information, see the
265 266 .Sx Intent Log
266 267 section.
267 268 .It Sy cache
268 269 A device used to cache storage pool data.
269 270 A cache device cannot be configured as a mirror or raidz group.
270 271 For more information, see the
271 272 .Sx Cache Devices
272 273 section.
273 274 .El
274 275 .Pp
275 276 Virtual devices cannot be nested, so a mirror or raidz virtual device can only
276 277 contain files or disks.
277 278 Mirrors of mirrors
278 279 .Pq or other combinations
279 280 are not allowed.
280 281 .Pp
281 282 A pool can have any number of virtual devices at the top of the configuration
282 283 .Po known as
283 284 .Qq root vdevs
284 285 .Pc .
285 286 Data is dynamically distributed across all top-level devices to balance data
286 287 among devices.
287 288 As new virtual devices are added, ZFS automatically places data on the newly
288 289 available devices.
289 290 .Pp
290 291 Virtual devices are specified one at a time on the command line, separated by
291 292 whitespace.
292 293 The keywords
293 294 .Sy mirror
294 295 and
295 296 .Sy raidz
296 297 are used to distinguish where a group ends and another begins.
297 298 For example, the following creates two root vdevs, each a mirror of two disks:
298 299 .Bd -literal
299 300 # zpool create mypool mirror c0t0d0 c0t1d0 mirror c1t0d0 c1t1d0
300 301 .Ed
301 302 .Ss Device Failure and Recovery
302 303 ZFS supports a rich set of mechanisms for handling device failure and data
303 304 corruption.
304 305 All metadata and data is checksummed, and ZFS automatically repairs bad data
305 306 from a good copy when corruption is detected.
306 307 .Pp
307 308 In order to take advantage of these features, a pool must make use of some form
308 309 of redundancy, using either mirrored or raidz groups.
309 310 While ZFS supports running in a non-redundant configuration, where each root
310 311 vdev is simply a disk or file, this is strongly discouraged.
311 312 A single case of bit corruption can render some or all of your data unavailable.
312 313 .Pp
313 314 A pool's health status is described by one of three states: online, degraded,
314 315 or faulted.
315 316 An online pool has all devices operating normally.
316 317 A degraded pool is one in which one or more devices have failed, but the data is
317 318 still available due to a redundant configuration.
318 319 A faulted pool has corrupted metadata, or one or more faulted devices, and
319 320 insufficient replicas to continue functioning.
320 321 .Pp
321 322 The health of the top-level vdev, such as mirror or raidz device, is
322 323 potentially impacted by the state of its associated vdevs, or component
323 324 devices.
324 325 A top-level vdev or component device is in one of the following states:
325 326 .Bl -tag -width "DEGRADED"
326 327 .It Sy DEGRADED
327 328 One or more top-level vdevs is in the degraded state because one or more
328 329 component devices are offline.
329 330 Sufficient replicas exist to continue functioning.
330 331 .Pp
331 332 One or more component devices is in the degraded or faulted state, but
332 333 sufficient replicas exist to continue functioning.
333 334 The underlying conditions are as follows:
334 335 .Bl -bullet
335 336 .It
336 337 The number of checksum errors exceeds acceptable levels and the device is
337 338 degraded as an indication that something may be wrong.
338 339 ZFS continues to use the device as necessary.
339 340 .It
340 341 The number of I/O errors exceeds acceptable levels.
341 342 The device could not be marked as faulted because there are insufficient
342 343 replicas to continue functioning.
343 344 .El
344 345 .It Sy FAULTED
345 346 One or more top-level vdevs is in the faulted state because one or more
346 347 component devices are offline.
347 348 Insufficient replicas exist to continue functioning.
348 349 .Pp
349 350 One or more component devices is in the faulted state, and insufficient
350 351 replicas exist to continue functioning.
351 352 The underlying conditions are as follows:
352 353 .Bl -bullet
353 354 .It
354 355 The device could be opened, but the contents did not match expected values.
355 356 .It
356 357 The number of I/O errors exceeds acceptable levels and the device is faulted to
357 358 prevent further use of the device.
358 359 .El
359 360 .It Sy OFFLINE
360 361 The device was explicitly taken offline by the
361 362 .Nm zpool Cm offline
362 363 command.
363 364 .It Sy ONLINE
364 365 The device is online and functioning.
365 366 .It Sy REMOVED
366 367 The device was physically removed while the system was running.
367 368 Device removal detection is hardware-dependent and may not be supported on all
368 369 platforms.
369 370 .It Sy UNAVAIL
370 371 The device could not be opened.
371 372 If a pool is imported when a device was unavailable, then the device will be
372 373 identified by a unique identifier instead of its path since the path was never
373 374 correct in the first place.
374 375 .El
375 376 .Pp
376 377 If a device is removed and later re-attached to the system, ZFS attempts
377 378 to put the device online automatically.
378 379 Device attach detection is hardware-dependent and might not be supported on all
379 380 platforms.
380 381 .Ss Hot Spares
381 382 ZFS allows devices to be associated with pools as
382 383 .Qq hot spares .
383 384 These devices are not actively used in the pool, but when an active device
384 385 fails, it is automatically replaced by a hot spare.
385 386 To create a pool with hot spares, specify a
386 387 .Sy spare
387 388 vdev with any number of devices.
388 389 For example,
389 390 .Bd -literal
390 391 # zpool create pool mirror c0d0 c1d0 spare c2d0 c3d0
391 392 .Ed
392 393 .Pp
393 394 Spares can be shared across multiple pools, and can be added with the
394 395 .Nm zpool Cm add
395 396 command and removed with the
396 397 .Nm zpool Cm remove
397 398 command.
398 399 Once a spare replacement is initiated, a new
399 400 .Sy spare
400 401 vdev is created within the configuration that will remain there until the
401 402 original device is replaced.
402 403 At this point, the hot spare becomes available again if another device fails.
403 404 .Pp
404 405 If a pool has a shared spare that is currently being used, the pool can not be
405 406 exported since other pools may use this shared spare, which may lead to
406 407 potential data corruption.
407 408 .Pp
408 409 An in-progress spare replacement can be cancelled by detaching the hot spare.
409 410 If the original faulted device is detached, then the hot spare assumes its
410 411 place in the configuration, and is removed from the spare list of all active
411 412 pools.
412 413 .Pp
413 414 Spares cannot replace log devices.
414 415 .Ss Intent Log
415 416 The ZFS Intent Log (ZIL) satisfies POSIX requirements for synchronous
416 417 transactions.
417 418 For instance, databases often require their transactions to be on stable storage
418 419 devices when returning from a system call.
419 420 NFS and other applications can also use
420 421 .Xr fsync 3C
421 422 to ensure data stability.
422 423 By default, the intent log is allocated from blocks within the main pool.
423 424 However, it might be possible to get better performance using separate intent
424 425 log devices such as NVRAM or a dedicated disk.
425 426 For example:
426 427 .Bd -literal
427 428 # zpool create pool c0d0 c1d0 log c2d0
428 429 .Ed
429 430 .Pp
430 431 Multiple log devices can also be specified, and they can be mirrored.
431 432 See the
432 433 .Sx EXAMPLES
433 434 section for an example of mirroring multiple log devices.
434 435 .Pp
435 436 Log devices can be added, replaced, attached, detached, and imported and
436 437 exported as part of the larger pool.
437 438 Mirrored devices can be removed by specifying the top-level mirror vdev.
438 439 .Ss Cache Devices
439 440 Devices can be added to a storage pool as
440 441 .Qq cache devices .
441 442 These devices provide an additional layer of caching between main memory and
442 443 disk.
443 444 For read-heavy workloads, where the working set size is much larger than what
444 445 can be cached in main memory, using cache devices allow much more of this
445 446 working set to be served from low latency media.
446 447 Using cache devices provides the greatest performance improvement for random
447 448 read-workloads of mostly static content.
448 449 .Pp
449 450 To create a pool with cache devices, specify a
450 451 .Sy cache
451 452 vdev with any number of devices.
452 453 For example:
453 454 .Bd -literal
454 455 # zpool create pool c0d0 c1d0 cache c2d0 c3d0
455 456 .Ed
456 457 .Pp
457 458 Cache devices cannot be mirrored or part of a raidz configuration.
458 459 If a read error is encountered on a cache device, that read I/O is reissued to
459 460 the original storage pool device, which might be part of a mirrored or raidz
460 461 configuration.
461 462 .Pp
462 463 The content of the cache devices is considered volatile, as is the case with
463 464 other system caches.
464 465 .Ss Pool checkpoint
465 466 Before starting critical procedures that include destructive actions (e.g
466 467 .Nm zfs Cm destroy
467 468 ), an administrator can checkpoint the pool's state and in the case of a
468 469 mistake or failure, rewind the entire pool back to the checkpoint.
469 470 Otherwise, the checkpoint can be discarded when the procedure has completed
470 471 successfully.
471 472 .Pp
472 473 A pool checkpoint can be thought of as a pool-wide snapshot and should be used
473 474 with care as it contains every part of the pool's state, from properties to vdev
474 475 configuration.
475 476 Thus, while a pool has a checkpoint certain operations are not allowed.
476 477 Specifically, vdev removal/attach/detach, mirror splitting, and
477 478 changing the pool's guid.
478 479 Adding a new vdev is supported but in the case of a rewind it will have to be
479 480 added again.
480 481 Finally, users of this feature should keep in mind that scrubs in a pool that
481 482 has a checkpoint do not repair checkpointed data.
482 483 .Pp
483 484 To create a checkpoint for a pool:
484 485 .Bd -literal
485 486 # zpool checkpoint pool
486 487 .Ed
487 488 .Pp
488 489 To later rewind to its checkpointed state, you need to first export it and
489 490 then rewind it during import:
490 491 .Bd -literal
491 492 # zpool export pool
492 493 # zpool import --rewind-to-checkpoint pool
493 494 .Ed
494 495 .Pp
495 496 To discard the checkpoint from a pool:
496 497 .Bd -literal
497 498 # zpool checkpoint -d pool
498 499 .Ed
499 500 .Pp
500 501 Dataset reservations (controlled by the
501 502 .Nm reservation
502 503 or
503 504 .Nm refreservation
504 505 zfs properties) may be unenforceable while a checkpoint exists, because the
505 506 checkpoint is allowed to consume the dataset's reservation.
506 507 Finally, data that is part of the checkpoint but has been freed in the
507 508 current state of the pool won't be scanned during a scrub.
508 509 .Ss Properties
509 510 Each pool has several properties associated with it.
510 511 Some properties are read-only statistics while others are configurable and
511 512 change the behavior of the pool.
512 513 .Pp
513 514 The following are read-only properties:
514 515 .Bl -tag -width Ds
515 516 .It Cm allocated
516 517 Amount of storage space used within the pool.
517 518 .It Sy bootsize
518 519 The size of the system boot partition.
519 520 This property can only be set at pool creation time and is read-only once pool
520 521 is created.
521 522 Setting this property implies using the
522 523 .Fl B
523 524 option.
524 525 .It Sy capacity
525 526 Percentage of pool space used.
526 527 This property can also be referred to by its shortened column name,
527 528 .Sy cap .
528 529 .It Sy expandsize
529 530 Amount of uninitialized space within the pool or device that can be used to
530 531 increase the total capacity of the pool.
531 532 Uninitialized space consists of any space on an EFI labeled vdev which has not
532 533 been brought online
533 534 .Po e.g, using
534 535 .Nm zpool Cm online Fl e
535 536 .Pc .
536 537 This space occurs when a LUN is dynamically expanded.
537 538 .It Sy fragmentation
538 539 The amount of fragmentation in the pool.
539 540 .It Sy free
540 541 The amount of free space available in the pool.
541 542 .It Sy freeing
542 543 After a file system or snapshot is destroyed, the space it was using is
543 544 returned to the pool asynchronously.
544 545 .Sy freeing
545 546 is the amount of space remaining to be reclaimed.
546 547 Over time
547 548 .Sy freeing
548 549 will decrease while
549 550 .Sy free
550 551 increases.
551 552 .It Sy health
552 553 The current health of the pool.
553 554 Health can be one of
554 555 .Sy ONLINE , DEGRADED , FAULTED , OFFLINE, REMOVED , UNAVAIL .
555 556 .It Sy guid
556 557 A unique identifier for the pool.
557 558 .It Sy size
558 559 Total size of the storage pool.
559 560 .It Sy unsupported@ Ns Em feature_guid
560 561 Information about unsupported features that are enabled on the pool.
561 562 See
562 563 .Xr zpool-features 5
563 564 for details.
564 565 .El
565 566 .Pp
566 567 The space usage properties report actual physical space available to the
567 568 storage pool.
568 569 The physical space can be different from the total amount of space that any
569 570 contained datasets can actually use.
570 571 The amount of space used in a raidz configuration depends on the characteristics
571 572 of the data being written.
572 573 In addition, ZFS reserves some space for internal accounting that the
573 574 .Xr zfs 1M
574 575 command takes into account, but the
575 576 .Nm
576 577 command does not.
577 578 For non-full pools of a reasonable size, these effects should be invisible.
578 579 For small pools, or pools that are close to being completely full, these
579 580 discrepancies may become more noticeable.
580 581 .Pp
581 582 The following property can be set at creation time and import time:
582 583 .Bl -tag -width Ds
583 584 .It Sy altroot
584 585 Alternate root directory.
585 586 If set, this directory is prepended to any mount points within the pool.
586 587 This can be used when examining an unknown pool where the mount points cannot be
587 588 trusted, or in an alternate boot environment, where the typical paths are not
588 589 valid.
589 590 .Sy altroot
590 591 is not a persistent property.
591 592 It is valid only while the system is up.
592 593 Setting
593 594 .Sy altroot
594 595 defaults to using
595 596 .Sy cachefile Ns = Ns Sy none ,
596 597 though this may be overridden using an explicit setting.
597 598 .El
598 599 .Pp
599 600 The following property can be set only at import time:
600 601 .Bl -tag -width Ds
601 602 .It Sy readonly Ns = Ns Sy on Ns | Ns Sy off
602 603 If set to
603 604 .Sy on ,
604 605 the pool will be imported in read-only mode.
605 606 This property can also be referred to by its shortened column name,
606 607 .Sy rdonly .
607 608 .El
608 609 .Pp
609 610 The following properties can be set at creation time and import time, and later
610 611 changed with the
611 612 .Nm zpool Cm set
612 613 command:
613 614 .Bl -tag -width Ds
614 615 .It Sy autoexpand Ns = Ns Sy on Ns | Ns Sy off
615 616 Controls automatic pool expansion when the underlying LUN is grown.
616 617 If set to
617 618 .Sy on ,
618 619 the pool will be resized according to the size of the expanded device.
619 620 If the device is part of a mirror or raidz then all devices within that
620 621 mirror/raidz group must be expanded before the new space is made available to
621 622 the pool.
622 623 The default behavior is
623 624 .Sy off .
624 625 This property can also be referred to by its shortened column name,
625 626 .Sy expand .
626 627 .It Sy autoreplace Ns = Ns Sy on Ns | Ns Sy off
627 628 Controls automatic device replacement.
628 629 If set to
629 630 .Sy off ,
630 631 device replacement must be initiated by the administrator by using the
631 632 .Nm zpool Cm replace
632 633 command.
633 634 If set to
634 635 .Sy on ,
635 636 any new device, found in the same physical location as a device that previously
636 637 belonged to the pool, is automatically formatted and replaced.
637 638 The default behavior is
638 639 .Sy off .
639 640 This property can also be referred to by its shortened column name,
640 641 .Sy replace .
641 642 .It Sy bootfs Ns = Ns Ar pool Ns / Ns Ar dataset
642 643 Identifies the default bootable dataset for the root pool.
643 644 This property is expected to be set mainly by the installation and upgrade
644 645 programs.
645 646 .It Sy cachefile Ns = Ns Ar path Ns | Ns Sy none
646 647 Controls the location of where the pool configuration is cached.
647 648 Discovering all pools on system startup requires a cached copy of the
648 649 configuration data that is stored on the root file system.
649 650 All pools in this cache are automatically imported when the system boots.
650 651 Some environments, such as install and clustering, need to cache this
651 652 information in a different location so that pools are not automatically
652 653 imported.
653 654 Setting this property caches the pool configuration in a different location that
654 655 can later be imported with
655 656 .Nm zpool Cm import Fl c .
656 657 Setting it to the special value
657 658 .Sy none
658 659 creates a temporary pool that is never cached, and the special value
659 660 .Qq
660 661 .Pq empty string
661 662 uses the default location.
662 663 .Pp
663 664 Multiple pools can share the same cache file.
664 665 Because the kernel destroys and recreates this file when pools are added and
665 666 removed, care should be taken when attempting to access this file.
666 667 When the last pool using a
667 668 .Sy cachefile
668 669 is exported or destroyed, the file is removed.
669 670 .It Sy comment Ns = Ns Ar text
670 671 A text string consisting of printable ASCII characters that will be stored
671 672 such that it is available even if the pool becomes faulted.
672 673 An administrator can provide additional information about a pool using this
673 674 property.
674 675 .It Sy dedupditto Ns = Ns Ar number
675 676 Threshold for the number of block ditto copies.
676 677 If the reference count for a deduplicated block increases above this number, a
677 678 new ditto copy of this block is automatically stored.
678 679 The default setting is
679 680 .Sy 0
680 681 which causes no ditto copies to be created for deduplicated blocks.
681 682 The minimum legal nonzero setting is
682 683 .Sy 100 .
683 684 .It Sy delegation Ns = Ns Sy on Ns | Ns Sy off
684 685 Controls whether a non-privileged user is granted access based on the dataset
685 686 permissions defined on the dataset.
686 687 See
687 688 .Xr zfs 1M
688 689 for more information on ZFS delegated administration.
689 690 .It Sy failmode Ns = Ns Sy wait Ns | Ns Sy continue Ns | Ns Sy panic
690 691 Controls the system behavior in the event of catastrophic pool failure.
691 692 This condition is typically a result of a loss of connectivity to the underlying
692 693 storage device(s) or a failure of all devices within the pool.
693 694 The behavior of such an event is determined as follows:
694 695 .Bl -tag -width "continue"
695 696 .It Sy wait
696 697 Blocks all I/O access until the device connectivity is recovered and the errors
697 698 are cleared.
698 699 This is the default behavior.
699 700 .It Sy continue
700 701 Returns
701 702 .Er EIO
702 703 to any new write I/O requests but allows reads to any of the remaining healthy
703 704 devices.
704 705 Any write requests that have yet to be committed to disk would be blocked.
705 706 .It Sy panic
706 707 Prints out a message to the console and generates a system crash dump.
707 708 .El
708 709 .It Sy feature@ Ns Ar feature_name Ns = Ns Sy enabled
709 710 The value of this property is the current state of
710 711 .Ar feature_name .
711 712 The only valid value when setting this property is
712 713 .Sy enabled
713 714 which moves
714 715 .Ar feature_name
715 716 to the enabled state.
716 717 See
717 718 .Xr zpool-features 5
718 719 for details on feature states.
719 720 .It Sy listsnapshots Ns = Ns Sy on Ns | Ns Sy off
720 721 Controls whether information about snapshots associated with this pool is
721 722 output when
722 723 .Nm zfs Cm list
723 724 is run without the
724 725 .Fl t
725 726 option.
726 727 The default value is
727 728 .Sy off .
728 729 This property can also be referred to by its shortened name,
729 730 .Sy listsnaps .
730 731 .It Sy version Ns = Ns Ar version
731 732 The current on-disk version of the pool.
732 733 This can be increased, but never decreased.
733 734 The preferred method of updating pools is with the
734 735 .Nm zpool Cm upgrade
735 736 command, though this property can be used when a specific version is needed for
736 737 backwards compatibility.
737 738 Once feature flags are enabled on a pool this property will no longer have a
738 739 value.
739 740 .El
740 741 .Ss Subcommands
741 742 All subcommands that modify state are logged persistently to the pool in their
742 743 original form.
743 744 .Pp
744 745 The
745 746 .Nm
746 747 command provides subcommands to create and destroy storage pools, add capacity
747 748 to storage pools, and provide information about the storage pools.
748 749 The following subcommands are supported:
749 750 .Bl -tag -width Ds
750 751 .It Xo
751 752 .Nm
752 753 .Fl \?
753 754 .Xc
754 755 Displays a help message.
755 756 .It Xo
756 757 .Nm
757 758 .Cm add
758 759 .Op Fl fn
759 760 .Ar pool vdev Ns ...
760 761 .Xc
761 762 Adds the specified virtual devices to the given pool.
762 763 The
763 764 .Ar vdev
764 765 specification is described in the
765 766 .Sx Virtual Devices
766 767 section.
767 768 The behavior of the
768 769 .Fl f
769 770 option, and the device checks performed are described in the
770 771 .Nm zpool Cm create
771 772 subcommand.
772 773 .Bl -tag -width Ds
773 774 .It Fl f
774 775 Forces use of
775 776 .Ar vdev Ns s ,
776 777 even if they appear in use or specify a conflicting replication level.
777 778 Not all devices can be overridden in this manner.
778 779 .It Fl n
779 780 Displays the configuration that would be used without actually adding the
780 781 .Ar vdev Ns s .
781 782 The actual pool creation can still fail due to insufficient privileges or
782 783 device sharing.
783 784 .El
784 785 .It Xo
785 786 .Nm
786 787 .Cm attach
787 788 .Op Fl f
788 789 .Ar pool device new_device
789 790 .Xc
790 791 Attaches
791 792 .Ar new_device
792 793 to the existing
793 794 .Ar device .
794 795 The existing device cannot be part of a raidz configuration.
795 796 If
796 797 .Ar device
797 798 is not currently part of a mirrored configuration,
798 799 .Ar device
799 800 automatically transforms into a two-way mirror of
800 801 .Ar device
801 802 and
802 803 .Ar new_device .
803 804 If
804 805 .Ar device
805 806 is part of a two-way mirror, attaching
806 807 .Ar new_device
807 808 creates a three-way mirror, and so on.
808 809 In either case,
809 810 .Ar new_device
810 811 begins to resilver immediately.
811 812 .Bl -tag -width Ds
812 813 .It Fl f
813 814 Forces use of
814 815 .Ar new_device ,
815 816 even if its appears to be in use.
816 817 Not all devices can be overridden in this manner.
817 818 .El
818 819 .It Xo
819 820 .Nm
820 821 .Cm checkpoint
821 822 .Op Fl d, -discard
822 823 .Ar pool
823 824 .Xc
824 825 Checkpoints the current state of
825 826 .Ar pool
826 827 , which can be later restored by
827 828 .Nm zpool Cm import --rewind-to-checkpoint .
828 829 The existence of a checkpoint in a pool prohibits the following
829 830 .Nm zpool
830 831 commands:
831 832 .Cm remove ,
832 833 .Cm attach ,
833 834 .Cm detach ,
834 835 .Cm split ,
835 836 and
836 837 .Cm reguid .
837 838 In addition, it may break reservation boundaries if the pool lacks free
838 839 space.
839 840 The
840 841 .Nm zpool Cm status
841 842 command indicates the existence of a checkpoint or the progress of discarding a
842 843 checkpoint from a pool.
843 844 The
844 845 .Nm zpool Cm list
845 846 command reports how much space the checkpoint takes from the pool.
846 847 .Bl -tag -width Ds
847 848 .It Fl d, -discard
848 849 Discards an existing checkpoint from
849 850 .Ar pool .
850 851 .El
851 852 .It Xo
852 853 .Nm
853 854 .Cm clear
854 855 .Ar pool
855 856 .Op Ar device
856 857 .Xc
857 858 Clears device errors in a pool.
858 859 If no arguments are specified, all device errors within the pool are cleared.
859 860 If one or more devices is specified, only those errors associated with the
|
↓ open down ↓ |
751 lines elided |
↑ open up ↑ |
860 861 specified device or devices are cleared.
861 862 .It Xo
862 863 .Nm
863 864 .Cm create
864 865 .Op Fl dfn
865 866 .Op Fl B
866 867 .Op Fl m Ar mountpoint
867 868 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
868 869 .Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns ...
869 870 .Op Fl R Ar root
871 +.Op Fl t Ar tempname
870 872 .Ar pool vdev Ns ...
871 873 .Xc
872 874 Creates a new storage pool containing the virtual devices specified on the
873 875 command line.
874 876 The pool name must begin with a letter, and can only contain
875 877 alphanumeric characters as well as underscore
876 878 .Pq Qq Sy _ ,
877 879 dash
878 880 .Pq Qq Sy - ,
879 881 and period
880 882 .Pq Qq Sy \&. .
881 883 The pool names
882 884 .Sy mirror ,
883 885 .Sy raidz ,
884 886 .Sy spare
885 887 and
886 888 .Sy log
887 889 are reserved, as are names beginning with the pattern
888 890 .Sy c[0-9] .
889 891 The
890 892 .Ar vdev
891 893 specification is described in the
892 894 .Sx Virtual Devices
893 895 section.
894 896 .Pp
895 897 The command verifies that each device specified is accessible and not currently
896 898 in use by another subsystem.
897 899 There are some uses, such as being currently mounted, or specified as the
898 900 dedicated dump device, that prevents a device from ever being used by ZFS.
899 901 Other uses, such as having a preexisting UFS file system, can be overridden with
900 902 the
901 903 .Fl f
902 904 option.
903 905 .Pp
904 906 The command also checks that the replication strategy for the pool is
905 907 consistent.
906 908 An attempt to combine redundant and non-redundant storage in a single pool, or
907 909 to mix disks and files, results in an error unless
908 910 .Fl f
909 911 is specified.
910 912 The use of differently sized devices within a single raidz or mirror group is
911 913 also flagged as an error unless
912 914 .Fl f
913 915 is specified.
914 916 .Pp
915 917 Unless the
916 918 .Fl R
917 919 option is specified, the default mount point is
918 920 .Pa / Ns Ar pool .
919 921 The mount point must not exist or must be empty, or else the root dataset
920 922 cannot be mounted.
921 923 This can be overridden with the
922 924 .Fl m
923 925 option.
924 926 .Pp
925 927 By default all supported features are enabled on the new pool unless the
926 928 .Fl d
927 929 option is specified.
928 930 .Bl -tag -width Ds
929 931 .It Fl B
930 932 Create whole disk pool with EFI System partition to support booting system
931 933 with UEFI firmware.
932 934 Default size is 256MB.
933 935 To create boot partition with custom size, set the
934 936 .Sy bootsize
935 937 property with the
936 938 .Fl o
937 939 option.
938 940 See the
939 941 .Sx Properties
940 942 section for details.
941 943 .It Fl d
942 944 Do not enable any features on the new pool.
943 945 Individual features can be enabled by setting their corresponding properties to
944 946 .Sy enabled
945 947 with the
946 948 .Fl o
947 949 option.
948 950 See
949 951 .Xr zpool-features 5
950 952 for details about feature properties.
951 953 .It Fl f
952 954 Forces use of
953 955 .Ar vdev Ns s ,
954 956 even if they appear in use or specify a conflicting replication level.
955 957 Not all devices can be overridden in this manner.
956 958 .It Fl m Ar mountpoint
957 959 Sets the mount point for the root dataset.
958 960 The default mount point is
959 961 .Pa /pool
960 962 or
961 963 .Pa altroot/pool
962 964 if
963 965 .Ar altroot
964 966 is specified.
965 967 The mount point must be an absolute path,
966 968 .Sy legacy ,
967 969 or
968 970 .Sy none .
969 971 For more information on dataset mount points, see
970 972 .Xr zfs 1M .
971 973 .It Fl n
972 974 Displays the configuration that would be used without actually creating the
973 975 pool.
974 976 The actual pool creation can still fail due to insufficient privileges or
975 977 device sharing.
976 978 .It Fl o Ar property Ns = Ns Ar value
977 979 Sets the given pool properties.
978 980 See the
979 981 .Sx Properties
980 982 section for a list of valid properties that can be set.
|
↓ open down ↓ |
101 lines elided |
↑ open up ↑ |
981 983 .It Fl O Ar file-system-property Ns = Ns Ar value
982 984 Sets the given file system properties in the root file system of the pool.
983 985 See the
984 986 .Sx Properties
985 987 section of
986 988 .Xr zfs 1M
987 989 for a list of valid properties that can be set.
988 990 .It Fl R Ar root
989 991 Equivalent to
990 992 .Fl o Sy cachefile Ns = Ns Sy none Fl o Sy altroot Ns = Ns Ar root
993 +.It Fl t Ar tempname
994 +Sets the in-core pool name to
995 +.Pa tempname
996 +while the on-disk name will be the name specified as the pool name
997 +.Pa pool .
998 +This will set the default cachefile property to
999 +.Sy none.
1000 +This is intended to handle name space collisions when creating pools
1001 +for other systems, such as virtual machines or physical machines
1002 +whose pools live on network block devices.
991 1003 .El
992 1004 .It Xo
993 1005 .Nm
994 1006 .Cm destroy
995 1007 .Op Fl f
996 1008 .Ar pool
997 1009 .Xc
998 1010 Destroys the given pool, freeing up any devices for other use.
999 1011 This command tries to unmount any active datasets before destroying the pool.
1000 1012 .Bl -tag -width Ds
1001 1013 .It Fl f
1002 1014 Forces any active datasets contained within the pool to be unmounted.
1003 1015 .El
1004 1016 .It Xo
1005 1017 .Nm
1006 1018 .Cm detach
1007 1019 .Ar pool device
1008 1020 .Xc
1009 1021 Detaches
1010 1022 .Ar device
1011 1023 from a mirror.
1012 1024 The operation is refused if there are no other valid replicas of the data.
1013 1025 .It Xo
1014 1026 .Nm
1015 1027 .Cm export
1016 1028 .Op Fl f
1017 1029 .Ar pool Ns ...
1018 1030 .Xc
1019 1031 Exports the given pools from the system.
1020 1032 All devices are marked as exported, but are still considered in use by other
1021 1033 subsystems.
1022 1034 The devices can be moved between systems
1023 1035 .Pq even those of different endianness
1024 1036 and imported as long as a sufficient number of devices are present.
1025 1037 .Pp
1026 1038 Before exporting the pool, all datasets within the pool are unmounted.
1027 1039 A pool can not be exported if it has a shared spare that is currently being
1028 1040 used.
1029 1041 .Pp
1030 1042 For pools to be portable, you must give the
1031 1043 .Nm
1032 1044 command whole disks, not just slices, so that ZFS can label the disks with
1033 1045 portable EFI labels.
1034 1046 Otherwise, disk drivers on platforms of different endianness will not recognize
1035 1047 the disks.
1036 1048 .Bl -tag -width Ds
1037 1049 .It Fl f
1038 1050 Forcefully unmount all datasets, using the
1039 1051 .Nm unmount Fl f
1040 1052 command.
1041 1053 .Pp
1042 1054 This command will forcefully export the pool even if it has a shared spare that
1043 1055 is currently being used.
1044 1056 This may lead to potential data corruption.
1045 1057 .El
1046 1058 .It Xo
1047 1059 .Nm
1048 1060 .Cm get
1049 1061 .Op Fl Hp
1050 1062 .Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
1051 1063 .Sy all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns ...
1052 1064 .Ar pool Ns ...
1053 1065 .Xc
1054 1066 Retrieves the given list of properties
1055 1067 .Po
1056 1068 or all properties if
1057 1069 .Sy all
1058 1070 is used
1059 1071 .Pc
1060 1072 for the specified storage pool(s).
1061 1073 These properties are displayed with the following fields:
1062 1074 .Bd -literal
1063 1075 name Name of storage pool
1064 1076 property Property name
1065 1077 value Property value
1066 1078 source Property source, either 'default' or 'local'.
1067 1079 .Ed
1068 1080 .Pp
1069 1081 See the
1070 1082 .Sx Properties
1071 1083 section for more information on the available pool properties.
1072 1084 .Bl -tag -width Ds
1073 1085 .It Fl H
1074 1086 Scripted mode.
1075 1087 Do not display headers, and separate fields by a single tab instead of arbitrary
1076 1088 space.
1077 1089 .It Fl o Ar field
1078 1090 A comma-separated list of columns to display.
1079 1091 .Sy name Ns \&, Ns Sy property Ns \&, Ns Sy value Ns \&, Ns Sy source
1080 1092 is the default value.
1081 1093 .It Fl p
1082 1094 Display numbers in parsable (exact) values.
1083 1095 .El
1084 1096 .It Xo
1085 1097 .Nm
1086 1098 .Cm history
1087 1099 .Op Fl il
1088 1100 .Oo Ar pool Oc Ns ...
1089 1101 .Xc
1090 1102 Displays the command history of the specified pool(s) or all pools if no pool is
1091 1103 specified.
1092 1104 .Bl -tag -width Ds
1093 1105 .It Fl i
1094 1106 Displays internally logged ZFS events in addition to user initiated events.
1095 1107 .It Fl l
1096 1108 Displays log records in long format, which in addition to standard format
1097 1109 includes, the user name, the hostname, and the zone in which the operation was
1098 1110 performed.
1099 1111 .El
1100 1112 .It Xo
1101 1113 .Nm
1102 1114 .Cm import
1103 1115 .Op Fl D
1104 1116 .Op Fl d Ar dir
1105 1117 .Xc
1106 1118 Lists pools available to import.
1107 1119 If the
1108 1120 .Fl d
1109 1121 option is not specified, this command searches for devices in
1110 1122 .Pa /dev/dsk .
1111 1123 The
1112 1124 .Fl d
1113 1125 option can be specified multiple times, and all directories are searched.
1114 1126 If the device appears to be part of an exported pool, this command displays a
1115 1127 summary of the pool with the name of the pool, a numeric identifier, as well as
1116 1128 the vdev layout and current health of the device for each device or file.
1117 1129 Destroyed pools, pools that were previously destroyed with the
1118 1130 .Nm zpool Cm destroy
1119 1131 command, are not listed unless the
1120 1132 .Fl D
1121 1133 option is specified.
1122 1134 .Pp
1123 1135 The numeric identifier is unique, and can be used instead of the pool name when
1124 1136 multiple exported pools of the same name are available.
1125 1137 .Bl -tag -width Ds
1126 1138 .It Fl c Ar cachefile
1127 1139 Reads configuration from the given
1128 1140 .Ar cachefile
1129 1141 that was created with the
1130 1142 .Sy cachefile
1131 1143 pool property.
1132 1144 This
1133 1145 .Ar cachefile
1134 1146 is used instead of searching for devices.
1135 1147 .It Fl d Ar dir
1136 1148 Searches for devices or files in
1137 1149 .Ar dir .
1138 1150 The
1139 1151 .Fl d
1140 1152 option can be specified multiple times.
1141 1153 .It Fl D
1142 1154 Lists destroyed pools only.
1143 1155 .El
1144 1156 .It Xo
1145 1157 .Nm
1146 1158 .Cm import
1147 1159 .Fl a
1148 1160 .Op Fl DfmN
1149 1161 .Op Fl F Op Fl n
1150 1162 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
1151 1163 .Op Fl o Ar mntopts
1152 1164 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1153 1165 .Op Fl R Ar root
1154 1166 .Xc
1155 1167 Imports all pools found in the search directories.
1156 1168 Identical to the previous command, except that all pools with a sufficient
1157 1169 number of devices available are imported.
1158 1170 Destroyed pools, pools that were previously destroyed with the
1159 1171 .Nm zpool Cm destroy
1160 1172 command, will not be imported unless the
1161 1173 .Fl D
1162 1174 option is specified.
1163 1175 .Bl -tag -width Ds
1164 1176 .It Fl a
1165 1177 Searches for and imports all pools found.
1166 1178 .It Fl c Ar cachefile
1167 1179 Reads configuration from the given
1168 1180 .Ar cachefile
1169 1181 that was created with the
1170 1182 .Sy cachefile
1171 1183 pool property.
1172 1184 This
1173 1185 .Ar cachefile
1174 1186 is used instead of searching for devices.
1175 1187 .It Fl d Ar dir
1176 1188 Searches for devices or files in
1177 1189 .Ar dir .
1178 1190 The
1179 1191 .Fl d
1180 1192 option can be specified multiple times.
1181 1193 This option is incompatible with the
1182 1194 .Fl c
1183 1195 option.
1184 1196 .It Fl D
1185 1197 Imports destroyed pools only.
1186 1198 The
1187 1199 .Fl f
1188 1200 option is also required.
1189 1201 .It Fl f
1190 1202 Forces import, even if the pool appears to be potentially active.
1191 1203 .It Fl F
1192 1204 Recovery mode for a non-importable pool.
1193 1205 Attempt to return the pool to an importable state by discarding the last few
1194 1206 transactions.
1195 1207 Not all damaged pools can be recovered by using this option.
1196 1208 If successful, the data from the discarded transactions is irretrievably lost.
1197 1209 This option is ignored if the pool is importable or already imported.
1198 1210 .It Fl m
1199 1211 Allows a pool to import when there is a missing log device.
1200 1212 Recent transactions can be lost because the log device will be discarded.
1201 1213 .It Fl n
1202 1214 Used with the
1203 1215 .Fl F
1204 1216 recovery option.
1205 1217 Determines whether a non-importable pool can be made importable again, but does
1206 1218 not actually perform the pool recovery.
1207 1219 For more details about pool recovery mode, see the
1208 1220 .Fl F
1209 1221 option, above.
1210 1222 .It Fl N
1211 1223 Import the pool without mounting any file systems.
1212 1224 .It Fl o Ar mntopts
1213 1225 Comma-separated list of mount options to use when mounting datasets within the
1214 1226 pool.
1215 1227 See
1216 1228 .Xr zfs 1M
1217 1229 for a description of dataset properties and mount options.
1218 1230 .It Fl o Ar property Ns = Ns Ar value
1219 1231 Sets the specified property on the imported pool.
1220 1232 See the
1221 1233 .Sx Properties
1222 1234 section for more information on the available pool properties.
1223 1235 .It Fl R Ar root
1224 1236 Sets the
1225 1237 .Sy cachefile
|
↓ open down ↓ |
225 lines elided |
↑ open up ↑ |
1226 1238 property to
1227 1239 .Sy none
1228 1240 and the
1229 1241 .Sy altroot
1230 1242 property to
1231 1243 .Ar root .
1232 1244 .El
1233 1245 .It Xo
1234 1246 .Nm
1235 1247 .Cm import
1236 -.Op Fl Dfm
1248 +.Op Fl Dfmt
1237 1249 .Op Fl F Op Fl n
1238 1250 .Op Fl -rewind-to-checkpoint
1239 1251 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir
1240 1252 .Op Fl o Ar mntopts
1241 1253 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1242 1254 .Op Fl R Ar root
1243 1255 .Ar pool Ns | Ns Ar id
1244 1256 .Op Ar newpool
1245 1257 .Xc
1246 1258 Imports a specific pool.
1247 1259 A pool can be identified by its name or the numeric identifier.
1248 1260 If
1249 1261 .Ar newpool
1250 1262 is specified, the pool is imported using the name
1251 1263 .Ar newpool .
1252 1264 Otherwise, it is imported with the same name as its exported name.
1253 1265 .Pp
1254 1266 If a device is removed from a system without running
1255 1267 .Nm zpool Cm export
1256 1268 first, the device appears as potentially active.
1257 1269 It cannot be determined if this was a failed export, or whether the device is
1258 1270 really in use from another host.
1259 1271 To import a pool in this state, the
1260 1272 .Fl f
1261 1273 option is required.
1262 1274 .Bl -tag -width Ds
1263 1275 .It Fl c Ar cachefile
1264 1276 Reads configuration from the given
1265 1277 .Ar cachefile
1266 1278 that was created with the
1267 1279 .Sy cachefile
1268 1280 pool property.
1269 1281 This
1270 1282 .Ar cachefile
1271 1283 is used instead of searching for devices.
1272 1284 .It Fl d Ar dir
1273 1285 Searches for devices or files in
1274 1286 .Ar dir .
1275 1287 The
1276 1288 .Fl d
1277 1289 option can be specified multiple times.
1278 1290 This option is incompatible with the
1279 1291 .Fl c
1280 1292 option.
1281 1293 .It Fl D
1282 1294 Imports destroyed pool.
1283 1295 The
1284 1296 .Fl f
1285 1297 option is also required.
1286 1298 .It Fl f
1287 1299 Forces import, even if the pool appears to be potentially active.
1288 1300 .It Fl F
1289 1301 Recovery mode for a non-importable pool.
1290 1302 Attempt to return the pool to an importable state by discarding the last few
1291 1303 transactions.
1292 1304 Not all damaged pools can be recovered by using this option.
1293 1305 If successful, the data from the discarded transactions is irretrievably lost.
1294 1306 This option is ignored if the pool is importable or already imported.
1295 1307 .It Fl m
1296 1308 Allows a pool to import when there is a missing log device.
1297 1309 Recent transactions can be lost because the log device will be discarded.
1298 1310 .It Fl n
1299 1311 Used with the
1300 1312 .Fl F
1301 1313 recovery option.
1302 1314 Determines whether a non-importable pool can be made importable again, but does
1303 1315 not actually perform the pool recovery.
1304 1316 For more details about pool recovery mode, see the
1305 1317 .Fl F
1306 1318 option, above.
1307 1319 .It Fl o Ar mntopts
1308 1320 Comma-separated list of mount options to use when mounting datasets within the
1309 1321 pool.
1310 1322 See
1311 1323 .Xr zfs 1M
1312 1324 for a description of dataset properties and mount options.
1313 1325 .It Fl o Ar property Ns = Ns Ar value
1314 1326 Sets the specified property on the imported pool.
1315 1327 See the
1316 1328 .Sx Properties
|
↓ open down ↓ |
70 lines elided |
↑ open up ↑ |
1317 1329 section for more information on the available pool properties.
1318 1330 .It Fl R Ar root
1319 1331 Sets the
1320 1332 .Sy cachefile
1321 1333 property to
1322 1334 .Sy none
1323 1335 and the
1324 1336 .Sy altroot
1325 1337 property to
1326 1338 .Ar root .
1339 +.It Fl t
1340 +Used with
1341 +.Ar newpool .
1342 +Specifies that
1343 +.Ar newpool
1344 +is temporary.
1345 +Temporary pool names last until export.
1346 +Ensures that the original pool name will be used in all label updates and
1347 +therefore is retained upon export.
1348 +Will also set
1349 +.Sy cachefile
1350 +property to
1351 +.Sy none
1352 +when not explicitly specified.
1327 1353 .It Fl -rewind-to-checkpoint
1328 1354 Rewinds pool to the checkpointed state.
1329 1355 Once the pool is imported with this flag there is no way to undo the rewind.
1330 1356 All changes and data that were written after the checkpoint are lost!
1331 1357 The only exception is when the
1332 1358 .Sy readonly
1333 1359 mounting option is enabled.
1334 1360 In this case, the checkpointed state of the pool is opened and an
1335 1361 administrator can see how the pool would look like if they were
1336 1362 to fully rewind.
1337 1363 .El
1338 1364 .It Xo
1339 1365 .Nm
1340 1366 .Cm initialize
1341 1367 .Op Fl cs
1342 1368 .Ar pool
1343 1369 .Op Ar device Ns ...
1344 1370 .Xc
1345 1371 Begins initializing by writing to all unallocated regions on the specified
1346 1372 devices, or all eligible devices in the pool if no individual devices are
1347 1373 specified.
1348 1374 Only leaf data or log devices may be initialized.
1349 1375 .Bl -tag -width Ds
1350 1376 .It Fl c, -cancel
1351 1377 Cancel initializing on the specified devices, or all eligible devices if none
1352 1378 are specified.
1353 1379 If one or more target devices are invalid or are not currently being
1354 1380 initialized, the command will fail and no cancellation will occur on any device.
1355 1381 .It Fl s -suspend
1356 1382 Suspend initializing on the specified devices, or all eligible devices if none
1357 1383 are specified.
1358 1384 If one or more target devices are invalid or are not currently being
1359 1385 initialized, the command will fail and no suspension will occur on any device.
1360 1386 Initializing can then be resumed by running
1361 1387 .Nm zpool Cm initialize
1362 1388 with no flags on the relevant target devices.
1363 1389 .El
1364 1390 .It Xo
1365 1391 .Nm
1366 1392 .Cm iostat
1367 1393 .Op Fl v
1368 1394 .Op Fl T Sy u Ns | Ns Sy d
1369 1395 .Oo Ar pool Oc Ns ...
1370 1396 .Op Ar interval Op Ar count
1371 1397 .Xc
1372 1398 Displays I/O statistics for the given pools.
1373 1399 When given an
1374 1400 .Ar interval ,
1375 1401 the statistics are printed every
1376 1402 .Ar interval
1377 1403 seconds until ^C is pressed.
1378 1404 If no
1379 1405 .Ar pool Ns s
1380 1406 are specified, statistics for every pool in the system is shown.
1381 1407 If
1382 1408 .Ar count
1383 1409 is specified, the command exits after
1384 1410 .Ar count
1385 1411 reports are printed.
1386 1412 .Bl -tag -width Ds
1387 1413 .It Fl T Sy u Ns | Ns Sy d
1388 1414 Display a time stamp.
1389 1415 Specify
1390 1416 .Sy u
1391 1417 for a printed representation of the internal representation of time.
1392 1418 See
1393 1419 .Xr time 2 .
1394 1420 Specify
1395 1421 .Sy d
1396 1422 for standard date format.
1397 1423 See
1398 1424 .Xr date 1 .
1399 1425 .It Fl v
1400 1426 Verbose statistics Reports usage statistics for individual vdevs within the
1401 1427 pool, in addition to the pool-wide statistics.
1402 1428 .El
1403 1429 .It Xo
1404 1430 .Nm
1405 1431 .Cm labelclear
1406 1432 .Op Fl f
1407 1433 .Ar device
1408 1434 .Xc
1409 1435 Removes ZFS label information from the specified
1410 1436 .Ar device .
1411 1437 The
1412 1438 .Ar device
1413 1439 must not be part of an active pool configuration.
1414 1440 .Bl -tag -width Ds
1415 1441 .It Fl f
1416 1442 Treat exported or foreign devices as inactive.
1417 1443 .El
1418 1444 .It Xo
1419 1445 .Nm
1420 1446 .Cm list
1421 1447 .Op Fl Hpv
1422 1448 .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
1423 1449 .Op Fl T Sy u Ns | Ns Sy d
1424 1450 .Oo Ar pool Oc Ns ...
1425 1451 .Op Ar interval Op Ar count
1426 1452 .Xc
1427 1453 Lists the given pools along with a health status and space usage.
1428 1454 If no
1429 1455 .Ar pool Ns s
1430 1456 are specified, all pools in the system are listed.
1431 1457 When given an
1432 1458 .Ar interval ,
1433 1459 the information is printed every
1434 1460 .Ar interval
1435 1461 seconds until ^C is pressed.
1436 1462 If
1437 1463 .Ar count
1438 1464 is specified, the command exits after
1439 1465 .Ar count
1440 1466 reports are printed.
1441 1467 .Bl -tag -width Ds
1442 1468 .It Fl H
1443 1469 Scripted mode.
1444 1470 Do not display headers, and separate fields by a single tab instead of arbitrary
1445 1471 space.
1446 1472 .It Fl o Ar property
1447 1473 Comma-separated list of properties to display.
1448 1474 See the
1449 1475 .Sx Properties
1450 1476 section for a list of valid properties.
1451 1477 The default list is
1452 1478 .Cm name , size , allocated , free , checkpoint, expandsize , fragmentation , capacity ,
1453 1479 .Cm dedupratio , health , altroot .
1454 1480 .It Fl p
1455 1481 Display numbers in parsable
1456 1482 .Pq exact
1457 1483 values.
1458 1484 .It Fl T Sy u Ns | Ns Sy d
1459 1485 Display a time stamp.
1460 1486 Specify
1461 1487 .Fl u
1462 1488 for a printed representation of the internal representation of time.
1463 1489 See
1464 1490 .Xr time 2 .
1465 1491 Specify
1466 1492 .Fl d
1467 1493 for standard date format.
1468 1494 See
1469 1495 .Xr date 1 .
1470 1496 .It Fl v
1471 1497 Verbose statistics.
1472 1498 Reports usage statistics for individual vdevs within the pool, in addition to
1473 1499 the pool-wise statistics.
1474 1500 .El
1475 1501 .It Xo
1476 1502 .Nm
1477 1503 .Cm offline
1478 1504 .Op Fl t
1479 1505 .Ar pool Ar device Ns ...
1480 1506 .Xc
1481 1507 Takes the specified physical device offline.
1482 1508 While the
1483 1509 .Ar device
1484 1510 is offline, no attempt is made to read or write to the device.
1485 1511 This command is not applicable to spares.
1486 1512 .Bl -tag -width Ds
1487 1513 .It Fl t
1488 1514 Temporary.
1489 1515 Upon reboot, the specified physical device reverts to its previous state.
1490 1516 .El
1491 1517 .It Xo
1492 1518 .Nm
1493 1519 .Cm online
1494 1520 .Op Fl e
1495 1521 .Ar pool Ar device Ns ...
1496 1522 .Xc
1497 1523 Brings the specified physical device online.
1498 1524 This command is not applicable to spares.
1499 1525 .Bl -tag -width Ds
1500 1526 .It Fl e
1501 1527 Expand the device to use all available space.
1502 1528 If the device is part of a mirror or raidz then all devices must be expanded
1503 1529 before the new space will become available to the pool.
1504 1530 .El
1505 1531 .It Xo
1506 1532 .Nm
1507 1533 .Cm reguid
1508 1534 .Ar pool
1509 1535 .Xc
1510 1536 Generates a new unique identifier for the pool.
1511 1537 You must ensure that all devices in this pool are online and healthy before
1512 1538 performing this action.
1513 1539 .It Xo
1514 1540 .Nm
1515 1541 .Cm reopen
1516 1542 .Ar pool
1517 1543 .Xc
1518 1544 Reopen all the vdevs associated with the pool.
1519 1545 .It Xo
1520 1546 .Nm
1521 1547 .Cm remove
1522 1548 .Op Fl np
1523 1549 .Ar pool Ar device Ns ...
1524 1550 .Xc
1525 1551 Removes the specified device from the pool.
1526 1552 This command currently only supports removing hot spares, cache, log
1527 1553 devices and mirrored top-level vdevs (mirror of leaf devices); but not raidz.
1528 1554 .sp
1529 1555 Removing a top-level vdev reduces the total amount of space in the storage pool.
1530 1556 The specified device will be evacuated by copying all allocated space from it to
1531 1557 the other devices in the pool.
1532 1558 In this case, the
1533 1559 .Nm zpool Cm remove
1534 1560 command initiates the removal and returns, while the evacuation continues in
1535 1561 the background.
1536 1562 The removal progress can be monitored with
1537 1563 .Nm zpool Cm status.
1538 1564 This feature must be enabled to be used, see
1539 1565 .Xr zpool-features 5
1540 1566 .Pp
1541 1567 A mirrored top-level device (log or data) can be removed by specifying the top-level mirror for the
1542 1568 same.
1543 1569 Non-log devices or data devices that are part of a mirrored configuration can be removed using
1544 1570 the
1545 1571 .Nm zpool Cm detach
1546 1572 command.
1547 1573 .Bl -tag -width Ds
1548 1574 .It Fl n
1549 1575 Do not actually perform the removal ("no-op").
1550 1576 Instead, print the estimated amount of memory that will be used by the
1551 1577 mapping table after the removal completes.
1552 1578 This is nonzero only for top-level vdevs.
1553 1579 .El
1554 1580 .Bl -tag -width Ds
1555 1581 .It Fl p
1556 1582 Used in conjunction with the
1557 1583 .Fl n
1558 1584 flag, displays numbers as parsable (exact) values.
1559 1585 .El
1560 1586 .It Xo
1561 1587 .Nm
1562 1588 .Cm remove
1563 1589 .Fl s
1564 1590 .Ar pool
1565 1591 .Xc
1566 1592 Stops and cancels an in-progress removal of a top-level vdev.
1567 1593 .It Xo
1568 1594 .Nm
1569 1595 .Cm replace
1570 1596 .Op Fl f
1571 1597 .Ar pool Ar device Op Ar new_device
1572 1598 .Xc
1573 1599 Replaces
1574 1600 .Ar old_device
1575 1601 with
1576 1602 .Ar new_device .
1577 1603 This is equivalent to attaching
1578 1604 .Ar new_device ,
1579 1605 waiting for it to resilver, and then detaching
1580 1606 .Ar old_device .
1581 1607 .Pp
1582 1608 The size of
1583 1609 .Ar new_device
1584 1610 must be greater than or equal to the minimum size of all the devices in a mirror
1585 1611 or raidz configuration.
1586 1612 .Pp
1587 1613 .Ar new_device
1588 1614 is required if the pool is not redundant.
1589 1615 If
1590 1616 .Ar new_device
1591 1617 is not specified, it defaults to
1592 1618 .Ar old_device .
1593 1619 This form of replacement is useful after an existing disk has failed and has
1594 1620 been physically replaced.
1595 1621 In this case, the new disk may have the same
1596 1622 .Pa /dev/dsk
1597 1623 path as the old device, even though it is actually a different disk.
1598 1624 ZFS recognizes this.
1599 1625 .Bl -tag -width Ds
1600 1626 .It Fl f
1601 1627 Forces use of
1602 1628 .Ar new_device ,
1603 1629 even if its appears to be in use.
1604 1630 Not all devices can be overridden in this manner.
1605 1631 .El
1606 1632 .It Xo
1607 1633 .Nm
1608 1634 .Cm scrub
1609 1635 .Op Fl s | Fl p
1610 1636 .Ar pool Ns ...
1611 1637 .Xc
1612 1638 Begins a scrub or resumes a paused scrub.
1613 1639 The scrub examines all data in the specified pools to verify that it checksums
1614 1640 correctly.
1615 1641 For replicated
1616 1642 .Pq mirror or raidz
1617 1643 devices, ZFS automatically repairs any damage discovered during the scrub.
1618 1644 The
1619 1645 .Nm zpool Cm status
1620 1646 command reports the progress of the scrub and summarizes the results of the
1621 1647 scrub upon completion.
1622 1648 .Pp
1623 1649 Scrubbing and resilvering are very similar operations.
1624 1650 The difference is that resilvering only examines data that ZFS knows to be out
1625 1651 of date
1626 1652 .Po
1627 1653 for example, when attaching a new device to a mirror or replacing an existing
1628 1654 device
1629 1655 .Pc ,
1630 1656 whereas scrubbing examines all data to discover silent errors due to hardware
1631 1657 faults or disk failure.
1632 1658 .Pp
1633 1659 Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows
1634 1660 one at a time.
1635 1661 If a scrub is paused, the
1636 1662 .Nm zpool Cm scrub
1637 1663 resumes it.
1638 1664 If a resilver is in progress, ZFS does not allow a scrub to be started until the
1639 1665 resilver completes.
1640 1666 .Bl -tag -width Ds
1641 1667 .It Fl s
1642 1668 Stop scrubbing.
1643 1669 .El
1644 1670 .Bl -tag -width Ds
1645 1671 .It Fl p
1646 1672 Pause scrubbing.
1647 1673 Scrub pause state and progress are periodically synced to disk.
1648 1674 If the system is restarted or pool is exported during a paused scrub,
1649 1675 even after import, scrub will remain paused until it is resumed.
1650 1676 Once resumed the scrub will pick up from the place where it was last
1651 1677 checkpointed to disk.
1652 1678 To resume a paused scrub issue
1653 1679 .Nm zpool Cm scrub
1654 1680 again.
1655 1681 .El
1656 1682 .It Xo
1657 1683 .Nm
1658 1684 .Cm set
1659 1685 .Ar property Ns = Ns Ar value
1660 1686 .Ar pool
1661 1687 .Xc
1662 1688 Sets the given property on the specified pool.
1663 1689 See the
1664 1690 .Sx Properties
1665 1691 section for more information on what properties can be set and acceptable
1666 1692 values.
1667 1693 .It Xo
1668 1694 .Nm
1669 1695 .Cm split
1670 1696 .Op Fl n
1671 1697 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1672 1698 .Op Fl R Ar root
1673 1699 .Ar pool newpool
1674 1700 .Xc
1675 1701 Splits devices off
1676 1702 .Ar pool
1677 1703 creating
1678 1704 .Ar newpool .
1679 1705 All vdevs in
1680 1706 .Ar pool
1681 1707 must be mirrors.
1682 1708 At the time of the split,
1683 1709 .Ar newpool
1684 1710 will be a replica of
1685 1711 .Ar pool .
1686 1712 .Bl -tag -width Ds
1687 1713 .It Fl n
1688 1714 Do dry run, do not actually perform the split.
1689 1715 Print out the expected configuration of
1690 1716 .Ar newpool .
1691 1717 .It Fl o Ar property Ns = Ns Ar value
1692 1718 Sets the specified property for
1693 1719 .Ar newpool .
1694 1720 See the
1695 1721 .Sx Properties
1696 1722 section for more information on the available pool properties.
1697 1723 .It Fl R Ar root
1698 1724 Set
1699 1725 .Sy altroot
1700 1726 for
1701 1727 .Ar newpool
1702 1728 to
1703 1729 .Ar root
1704 1730 and automatically import it.
1705 1731 .El
1706 1732 .It Xo
1707 1733 .Nm
1708 1734 .Cm status
1709 1735 .Op Fl Dvx
1710 1736 .Op Fl T Sy u Ns | Ns Sy d
1711 1737 .Oo Ar pool Oc Ns ...
1712 1738 .Op Ar interval Op Ar count
1713 1739 .Xc
1714 1740 Displays the detailed health status for the given pools.
1715 1741 If no
1716 1742 .Ar pool
1717 1743 is specified, then the status of each pool in the system is displayed.
1718 1744 For more information on pool and device health, see the
1719 1745 .Sx Device Failure and Recovery
1720 1746 section.
1721 1747 .Pp
1722 1748 If a scrub or resilver is in progress, this command reports the percentage done
1723 1749 and the estimated time to completion.
1724 1750 Both of these are only approximate, because the amount of data in the pool and
1725 1751 the other workloads on the system can change.
1726 1752 .Bl -tag -width Ds
1727 1753 .It Fl D
1728 1754 Display a histogram of deduplication statistics, showing the allocated
1729 1755 .Pq physically present on disk
1730 1756 and referenced
1731 1757 .Pq logically referenced in the pool
1732 1758 block counts and sizes by reference count.
1733 1759 .It Fl T Sy u Ns | Ns Sy d
1734 1760 Display a time stamp.
1735 1761 Specify
1736 1762 .Fl u
1737 1763 for a printed representation of the internal representation of time.
1738 1764 See
1739 1765 .Xr time 2 .
1740 1766 Specify
1741 1767 .Fl d
1742 1768 for standard date format.
1743 1769 See
1744 1770 .Xr date 1 .
1745 1771 .It Fl v
1746 1772 Displays verbose data error information, printing out a complete list of all
1747 1773 data errors since the last complete pool scrub.
1748 1774 .It Fl x
1749 1775 Only display status for pools that are exhibiting errors or are otherwise
1750 1776 unavailable.
1751 1777 Warnings about pools not using the latest on-disk format will not be included.
1752 1778 .El
1753 1779 .It Xo
1754 1780 .Nm
1755 1781 .Cm upgrade
1756 1782 .Xc
1757 1783 Displays pools which do not have all supported features enabled and pools
1758 1784 formatted using a legacy ZFS version number.
1759 1785 These pools can continue to be used, but some features may not be available.
1760 1786 Use
1761 1787 .Nm zpool Cm upgrade Fl a
1762 1788 to enable all features on all pools.
1763 1789 .It Xo
1764 1790 .Nm
1765 1791 .Cm upgrade
1766 1792 .Fl v
1767 1793 .Xc
1768 1794 Displays legacy ZFS versions supported by the current software.
1769 1795 See
1770 1796 .Xr zpool-features 5
1771 1797 for a description of feature flags features supported by the current software.
1772 1798 .It Xo
1773 1799 .Nm
1774 1800 .Cm upgrade
1775 1801 .Op Fl V Ar version
1776 1802 .Fl a Ns | Ns Ar pool Ns ...
1777 1803 .Xc
1778 1804 Enables all supported features on the given pool.
1779 1805 Once this is done, the pool will no longer be accessible on systems that do not
1780 1806 support feature flags.
1781 1807 See
1782 1808 .Xr zpool-features 5
1783 1809 for details on compatibility with systems that support feature flags, but do not
1784 1810 support all features enabled on the pool.
1785 1811 .Bl -tag -width Ds
1786 1812 .It Fl a
1787 1813 Enables all supported features on all pools.
1788 1814 .It Fl V Ar version
1789 1815 Upgrade to the specified legacy version.
1790 1816 If the
1791 1817 .Fl V
1792 1818 flag is specified, no features will be enabled on the pool.
1793 1819 This option can only be used to increase the version number up to the last
1794 1820 supported legacy version number.
1795 1821 .El
1796 1822 .El
1797 1823 .Sh EXIT STATUS
1798 1824 The following exit values are returned:
1799 1825 .Bl -tag -width Ds
1800 1826 .It Sy 0
1801 1827 Successful completion.
1802 1828 .It Sy 1
1803 1829 An error occurred.
1804 1830 .It Sy 2
1805 1831 Invalid command line options were specified.
1806 1832 .El
1807 1833 .Sh EXAMPLES
1808 1834 .Bl -tag -width Ds
1809 1835 .It Sy Example 1 No Creating a RAID-Z Storage Pool
1810 1836 The following command creates a pool with a single raidz root vdev that
1811 1837 consists of six disks.
1812 1838 .Bd -literal
1813 1839 # zpool create tank raidz c0t0d0 c0t1d0 c0t2d0 c0t3d0 c0t4d0 c0t5d0
1814 1840 .Ed
1815 1841 .It Sy Example 2 No Creating a Mirrored Storage Pool
1816 1842 The following command creates a pool with two mirrors, where each mirror
1817 1843 contains two disks.
1818 1844 .Bd -literal
1819 1845 # zpool create tank mirror c0t0d0 c0t1d0 mirror c0t2d0 c0t3d0
1820 1846 .Ed
1821 1847 .It Sy Example 3 No Creating a ZFS Storage Pool by Using Slices
1822 1848 The following command creates an unmirrored pool using two disk slices.
1823 1849 .Bd -literal
1824 1850 # zpool create tank /dev/dsk/c0t0d0s1 c0t1d0s4
1825 1851 .Ed
1826 1852 .It Sy Example 4 No Creating a ZFS Storage Pool by Using Files
1827 1853 The following command creates an unmirrored pool using files.
1828 1854 While not recommended, a pool based on files can be useful for experimental
1829 1855 purposes.
1830 1856 .Bd -literal
1831 1857 # zpool create tank /path/to/file/a /path/to/file/b
1832 1858 .Ed
1833 1859 .It Sy Example 5 No Adding a Mirror to a ZFS Storage Pool
1834 1860 The following command adds two mirrored disks to the pool
1835 1861 .Em tank ,
1836 1862 assuming the pool is already made up of two-way mirrors.
1837 1863 The additional space is immediately available to any datasets within the pool.
1838 1864 .Bd -literal
1839 1865 # zpool add tank mirror c1t0d0 c1t1d0
1840 1866 .Ed
1841 1867 .It Sy Example 6 No Listing Available ZFS Storage Pools
1842 1868 The following command lists all available pools on the system.
1843 1869 In this case, the pool
1844 1870 .Em zion
1845 1871 is faulted due to a missing device.
1846 1872 The results from this command are similar to the following:
1847 1873 .Bd -literal
1848 1874 # zpool list
1849 1875 NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT
1850 1876 rpool 19.9G 8.43G 11.4G 33% - 42% 1.00x ONLINE -
1851 1877 tank 61.5G 20.0G 41.5G 48% - 32% 1.00x ONLINE -
1852 1878 zion - - - - - - - FAULTED -
1853 1879 .Ed
1854 1880 .It Sy Example 7 No Destroying a ZFS Storage Pool
1855 1881 The following command destroys the pool
1856 1882 .Em tank
1857 1883 and any datasets contained within.
1858 1884 .Bd -literal
1859 1885 # zpool destroy -f tank
1860 1886 .Ed
1861 1887 .It Sy Example 8 No Exporting a ZFS Storage Pool
1862 1888 The following command exports the devices in pool
1863 1889 .Em tank
1864 1890 so that they can be relocated or later imported.
1865 1891 .Bd -literal
1866 1892 # zpool export tank
1867 1893 .Ed
1868 1894 .It Sy Example 9 No Importing a ZFS Storage Pool
1869 1895 The following command displays available pools, and then imports the pool
1870 1896 .Em tank
1871 1897 for use on the system.
1872 1898 The results from this command are similar to the following:
1873 1899 .Bd -literal
1874 1900 # zpool import
1875 1901 pool: tank
1876 1902 id: 15451357997522795478
1877 1903 state: ONLINE
1878 1904 action: The pool can be imported using its name or numeric identifier.
1879 1905 config:
1880 1906
1881 1907 tank ONLINE
1882 1908 mirror ONLINE
1883 1909 c1t2d0 ONLINE
1884 1910 c1t3d0 ONLINE
1885 1911
1886 1912 # zpool import tank
1887 1913 .Ed
1888 1914 .It Sy Example 10 No Upgrading All ZFS Storage Pools to the Current Version
1889 1915 The following command upgrades all ZFS Storage pools to the current version of
1890 1916 the software.
1891 1917 .Bd -literal
1892 1918 # zpool upgrade -a
1893 1919 This system is currently running ZFS version 2.
1894 1920 .Ed
1895 1921 .It Sy Example 11 No Managing Hot Spares
1896 1922 The following command creates a new pool with an available hot spare:
1897 1923 .Bd -literal
1898 1924 # zpool create tank mirror c0t0d0 c0t1d0 spare c0t2d0
1899 1925 .Ed
1900 1926 .Pp
1901 1927 If one of the disks were to fail, the pool would be reduced to the degraded
1902 1928 state.
1903 1929 The failed device can be replaced using the following command:
1904 1930 .Bd -literal
1905 1931 # zpool replace tank c0t0d0 c0t3d0
1906 1932 .Ed
1907 1933 .Pp
1908 1934 Once the data has been resilvered, the spare is automatically removed and is
1909 1935 made available for use should another device fail.
1910 1936 The hot spare can be permanently removed from the pool using the following
1911 1937 command:
1912 1938 .Bd -literal
1913 1939 # zpool remove tank c0t2d0
1914 1940 .Ed
1915 1941 .It Sy Example 12 No Creating a ZFS Pool with Mirrored Separate Intent Logs
1916 1942 The following command creates a ZFS storage pool consisting of two, two-way
1917 1943 mirrors and mirrored log devices:
1918 1944 .Bd -literal
1919 1945 # zpool create pool mirror c0d0 c1d0 mirror c2d0 c3d0 log mirror \e
1920 1946 c4d0 c5d0
1921 1947 .Ed
1922 1948 .It Sy Example 13 No Adding Cache Devices to a ZFS Pool
1923 1949 The following command adds two disks for use as cache devices to a ZFS storage
1924 1950 pool:
1925 1951 .Bd -literal
1926 1952 # zpool add pool cache c2d0 c3d0
1927 1953 .Ed
1928 1954 .Pp
1929 1955 Once added, the cache devices gradually fill with content from main memory.
1930 1956 Depending on the size of your cache devices, it could take over an hour for
1931 1957 them to fill.
1932 1958 Capacity and reads can be monitored using the
1933 1959 .Cm iostat
1934 1960 option as follows:
1935 1961 .Bd -literal
1936 1962 # zpool iostat -v pool 5
1937 1963 .Ed
1938 1964 .It Sy Example 14 No Removing a Mirrored top-level (Log or Data) Device
1939 1965 The following commands remove the mirrored log device
1940 1966 .Sy mirror-2
1941 1967 and mirrored top-level data device
1942 1968 .Sy mirror-1 .
1943 1969 .Pp
1944 1970 Given this configuration:
1945 1971 .Bd -literal
1946 1972 pool: tank
1947 1973 state: ONLINE
1948 1974 scrub: none requested
1949 1975 config:
1950 1976
1951 1977 NAME STATE READ WRITE CKSUM
1952 1978 tank ONLINE 0 0 0
1953 1979 mirror-0 ONLINE 0 0 0
1954 1980 c6t0d0 ONLINE 0 0 0
1955 1981 c6t1d0 ONLINE 0 0 0
1956 1982 mirror-1 ONLINE 0 0 0
1957 1983 c6t2d0 ONLINE 0 0 0
1958 1984 c6t3d0 ONLINE 0 0 0
1959 1985 logs
1960 1986 mirror-2 ONLINE 0 0 0
1961 1987 c4t0d0 ONLINE 0 0 0
1962 1988 c4t1d0 ONLINE 0 0 0
1963 1989 .Ed
1964 1990 .Pp
1965 1991 The command to remove the mirrored log
1966 1992 .Sy mirror-2
1967 1993 is:
1968 1994 .Bd -literal
1969 1995 # zpool remove tank mirror-2
1970 1996 .Ed
1971 1997 .Pp
1972 1998 The command to remove the mirrored data
1973 1999 .Sy mirror-1
1974 2000 is:
1975 2001 .Bd -literal
1976 2002 # zpool remove tank mirror-1
1977 2003 .Ed
1978 2004 .It Sy Example 15 No Displaying expanded space on a device
1979 2005 The following command displays the detailed information for the pool
1980 2006 .Em data .
1981 2007 This pool is comprised of a single raidz vdev where one of its devices
1982 2008 increased its capacity by 10GB.
1983 2009 In this example, the pool will not be able to utilize this extra capacity until
1984 2010 all the devices under the raidz vdev have been expanded.
1985 2011 .Bd -literal
1986 2012 # zpool list -v data
1987 2013 NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT
1988 2014 data 23.9G 14.6G 9.30G 48% - 61% 1.00x ONLINE -
1989 2015 raidz1 23.9G 14.6G 9.30G 48% -
1990 2016 c1t1d0 - - - - -
1991 2017 c1t2d0 - - - - 10G
1992 2018 c1t3d0 - - - - -
1993 2019 .Ed
1994 2020 .El
1995 2021 .Sh INTERFACE STABILITY
1996 2022 .Sy Evolving
1997 2023 .Sh SEE ALSO
1998 2024 .Xr zfs 1M ,
1999 2025 .Xr attributes 5 ,
2000 2026 .Xr zpool-features 5
|
↓ open down ↓ |
664 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX