Print this page
9286 want refreservation=auto
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man1m/zfs.1m
+++ new/usr/src/man/man1m/zfs.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) 2009 Sun Microsystems, Inc. All Rights Reserved.
23 23 .\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
24 24 .\" Copyright (c) 2011, 2016 by Delphix. All rights reserved.
25 25 .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
26 26 .\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
27 27 .\" Copyright (c) 2014 by Adam Stevko. All rights reserved.
28 28 .\" Copyright (c) 2014 Integros [integros.com]
29 29 .\" Copyright 2017 Nexenta Systems, Inc.
30 30 .\"
31 31 .Dd December 6, 2017
32 32 .Dt ZFS 1M
33 33 .Os
34 34 .Sh NAME
35 35 .Nm zfs
36 36 .Nd configures ZFS file systems
37 37 .Sh SYNOPSIS
38 38 .Nm
39 39 .Op Fl \?
40 40 .Nm
41 41 .Cm create
42 42 .Op Fl p
43 43 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
44 44 .Ar filesystem
45 45 .Nm
46 46 .Cm create
47 47 .Op Fl ps
48 48 .Op Fl b Ar blocksize
49 49 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
50 50 .Fl V Ar size Ar volume
51 51 .Nm
52 52 .Cm destroy
53 53 .Op Fl Rfnprv
54 54 .Ar filesystem Ns | Ns Ar volume
55 55 .Nm
56 56 .Cm destroy
57 57 .Op Fl Rdnprv
58 58 .Ar filesystem Ns | Ns Ar volume Ns @ Ns Ar snap Ns
59 59 .Oo % Ns Ar snap Ns Oo , Ns Ar snap Ns Oo % Ns Ar snap Oc Oc Oc Ns ...
60 60 .Nm
61 61 .Cm destroy
62 62 .Ar filesystem Ns | Ns Ar volume Ns # Ns Ar bookmark
63 63 .Nm
64 64 .Cm snapshot
65 65 .Op Fl r
66 66 .Oo Fl o Ar property Ns = Ns value Oc Ns ...
67 67 .Ar filesystem Ns @ Ns Ar snapname Ns | Ns Ar volume Ns @ Ns Ar snapname Ns ...
68 68 .Nm
69 69 .Cm rollback
70 70 .Op Fl Rfr
71 71 .Ar snapshot
72 72 .Nm
73 73 .Cm clone
74 74 .Op Fl p
75 75 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
76 76 .Ar snapshot Ar filesystem Ns | Ns Ar volume
77 77 .Nm
78 78 .Cm promote
79 79 .Ar clone-filesystem
80 80 .Nm
81 81 .Cm rename
82 82 .Op Fl f
83 83 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
84 84 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
85 85 .Nm
86 86 .Cm rename
87 87 .Op Fl fp
88 88 .Ar filesystem Ns | Ns Ar volume
89 89 .Ar filesystem Ns | Ns Ar volume
90 90 .Nm
91 91 .Cm rename
92 92 .Fl r
93 93 .Ar snapshot Ar snapshot
94 94 .Nm
95 95 .Cm list
96 96 .Op Fl r Ns | Ns Fl d Ar depth
97 97 .Op Fl Hp
98 98 .Oo Fl o Ar property Ns Oo , Ns Ar property Oc Ns ... Oc
99 99 .Oo Fl s Ar property Oc Ns ...
100 100 .Oo Fl S Ar property Oc Ns ...
101 101 .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
102 102 .Oo Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Oc Ns ...
103 103 .Nm
104 104 .Cm remap
105 105 .Ar filesystem Ns | Ns Ar volume
106 106 .Nm
107 107 .Cm set
108 108 .Ar property Ns = Ns Ar value Oo Ar property Ns = Ns Ar value Oc Ns ...
109 109 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
110 110 .Nm
111 111 .Cm get
112 112 .Op Fl r Ns | Ns Fl d Ar depth
113 113 .Op Fl Hp
114 114 .Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
115 115 .Oo Fl s Ar source Ns Oo , Ns Ar source Oc Ns ... Oc
116 116 .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
117 117 .Cm all | Ar property Ns Oo , Ns Ar property Oc Ns ...
118 118 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns | Ns Ar bookmark Ns ...
119 119 .Nm
120 120 .Cm inherit
121 121 .Op Fl rS
122 122 .Ar property Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
123 123 .Nm
124 124 .Cm upgrade
125 125 .Nm
126 126 .Cm upgrade
127 127 .Fl v
128 128 .Nm
129 129 .Cm upgrade
130 130 .Op Fl r
131 131 .Op Fl V Ar version
132 132 .Fl a | Ar filesystem
133 133 .Nm
134 134 .Cm userspace
135 135 .Op Fl Hinp
136 136 .Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
137 137 .Oo Fl s Ar field Oc Ns ...
138 138 .Oo Fl S Ar field Oc Ns ...
139 139 .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
140 140 .Ar filesystem Ns | Ns Ar snapshot
141 141 .Nm
142 142 .Cm groupspace
143 143 .Op Fl Hinp
144 144 .Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
145 145 .Oo Fl s Ar field Oc Ns ...
146 146 .Oo Fl S Ar field Oc Ns ...
147 147 .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
148 148 .Ar filesystem Ns | Ns Ar snapshot
149 149 .Nm
150 150 .Cm mount
151 151 .Nm
152 152 .Cm mount
153 153 .Op Fl Ov
154 154 .Op Fl o Ar options
155 155 .Fl a | Ar filesystem
156 156 .Nm
157 157 .Cm unmount
158 158 .Op Fl f
159 159 .Fl a | Ar filesystem Ns | Ns Ar mountpoint
160 160 .Nm
161 161 .Cm share
162 162 .Fl a | Ar filesystem
163 163 .Nm
164 164 .Cm unshare
165 165 .Fl a | Ar filesystem Ns | Ns Ar mountpoint
166 166 .Nm
167 167 .Cm bookmark
168 168 .Ar snapshot bookmark
169 169 .Nm
170 170 .Cm send
171 171 .Op Fl DLPRcenpv
172 172 .Op Oo Fl I Ns | Ns Fl i Oc Ar snapshot
173 173 .Ar snapshot
174 174 .Nm
175 175 .Cm send
176 176 .Op Fl Lce
177 177 .Op Fl i Ar snapshot Ns | Ns Ar bookmark
178 178 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
179 179 .Nm
180 180 .Cm send
181 181 .Op Fl Penv
182 182 .Fl t Ar receive_resume_token
183 183 .Nm
184 184 .Cm receive
185 185 .Op Fl Fnsuv
186 186 .Op Fl o Sy origin Ns = Ns Ar snapshot
187 187 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
188 188 .Nm
189 189 .Cm receive
190 190 .Op Fl Fnsuv
191 191 .Op Fl d Ns | Ns Fl e
192 192 .Op Fl o Sy origin Ns = Ns Ar snapshot
193 193 .Ar filesystem
194 194 .Nm
195 195 .Cm receive
196 196 .Fl A
197 197 .Ar filesystem Ns | Ns Ar volume
198 198 .Nm
199 199 .Cm allow
200 200 .Ar filesystem Ns | Ns Ar volume
201 201 .Nm
202 202 .Cm allow
203 203 .Op Fl dglu
204 204 .Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ...
205 205 .Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
206 206 .Ar setname Oc Ns ...
207 207 .Ar filesystem Ns | Ns Ar volume
208 208 .Nm
209 209 .Cm allow
210 210 .Op Fl dl
211 211 .Fl e Ns | Ns Sy everyone
212 212 .Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
213 213 .Ar setname Oc Ns ...
214 214 .Ar filesystem Ns | Ns Ar volume
215 215 .Nm
216 216 .Cm allow
217 217 .Fl c
218 218 .Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
219 219 .Ar setname Oc Ns ...
220 220 .Ar filesystem Ns | Ns Ar volume
221 221 .Nm
222 222 .Cm allow
223 223 .Fl s No @ Ns Ar setname
224 224 .Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
225 225 .Ar setname Oc Ns ...
226 226 .Ar filesystem Ns | Ns Ar volume
227 227 .Nm
228 228 .Cm unallow
229 229 .Op Fl dglru
230 230 .Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ...
231 231 .Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
232 232 .Ar setname Oc Ns ... Oc
233 233 .Ar filesystem Ns | Ns Ar volume
234 234 .Nm
235 235 .Cm unallow
236 236 .Op Fl dlr
237 237 .Fl e Ns | Ns Sy everyone
238 238 .Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
239 239 .Ar setname Oc Ns ... Oc
240 240 .Ar filesystem Ns | Ns Ar volume
241 241 .Nm
242 242 .Cm unallow
243 243 .Op Fl r
244 244 .Fl c
245 245 .Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
246 246 .Ar setname Oc Ns ... Oc
247 247 .Ar filesystem Ns | Ns Ar volume
248 248 .Nm
249 249 .Cm unallow
250 250 .Op Fl r
251 251 .Fl s @ Ns Ar setname
252 252 .Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
253 253 .Ar setname Oc Ns ... Oc
254 254 .Ar filesystem Ns | Ns Ar volume
255 255 .Nm
256 256 .Cm hold
257 257 .Op Fl r
258 258 .Ar tag Ar snapshot Ns ...
259 259 .Nm
260 260 .Cm holds
261 261 .Op Fl r
262 262 .Ar snapshot Ns ...
263 263 .Nm
264 264 .Cm release
265 265 .Op Fl r
266 266 .Ar tag Ar snapshot Ns ...
267 267 .Nm
268 268 .Cm diff
269 269 .Op Fl FHt
270 270 .Ar snapshot Ar snapshot Ns | Ns Ar filesystem
271 271 .Nm
272 272 .Cm program
273 273 .Op Fl n
274 274 .Op Fl t Ar timeout
275 275 .Op Fl m Ar memory_limit
276 276 .Ar pool script
277 277 .Op Ar arg1 No ...
278 278 .Sh DESCRIPTION
279 279 The
280 280 .Nm
281 281 command configures ZFS datasets within a ZFS storage pool, as described in
282 282 .Xr zpool 1M .
283 283 A dataset is identified by a unique path within the ZFS namespace.
284 284 For example:
285 285 .Bd -literal
286 286 pool/{filesystem,volume,snapshot}
287 287 .Ed
288 288 .Pp
289 289 where the maximum length of a dataset name is
290 290 .Dv MAXNAMELEN
291 291 .Pq 256 bytes .
292 292 .Pp
293 293 A dataset can be one of the following:
294 294 .Bl -tag -width "file system"
295 295 .It Sy file system
296 296 A ZFS dataset of type
297 297 .Sy filesystem
298 298 can be mounted within the standard system namespace and behaves like other file
299 299 systems.
300 300 While ZFS file systems are designed to be POSIX compliant, known issues exist
301 301 that prevent compliance in some cases.
302 302 Applications that depend on standards conformance might fail due to non-standard
303 303 behavior when checking file system free space.
304 304 .It Sy volume
305 305 A logical volume exported as a raw or block device.
306 306 This type of dataset should only be used under special circumstances.
307 307 File systems are typically used in most environments.
308 308 .It Sy snapshot
309 309 A read-only version of a file system or volume at a given point in time.
310 310 It is specified as
311 311 .Ar filesystem Ns @ Ns Ar name
312 312 or
313 313 .Ar volume Ns @ Ns Ar name .
314 314 .El
315 315 .Ss ZFS File System Hierarchy
316 316 A ZFS storage pool is a logical collection of devices that provide space for
317 317 datasets.
318 318 A storage pool is also the root of the ZFS file system hierarchy.
319 319 .Pp
320 320 The root of the pool can be accessed as a file system, such as mounting and
321 321 unmounting, taking snapshots, and setting properties.
322 322 The physical storage characteristics, however, are managed by the
323 323 .Xr zpool 1M
324 324 command.
325 325 .Pp
326 326 See
327 327 .Xr zpool 1M
328 328 for more information on creating and administering pools.
329 329 .Ss Snapshots
330 330 A snapshot is a read-only copy of a file system or volume.
331 331 Snapshots can be created extremely quickly, and initially consume no additional
332 332 space within the pool.
333 333 As data within the active dataset changes, the snapshot consumes more data than
334 334 would otherwise be shared with the active dataset.
335 335 .Pp
336 336 Snapshots can have arbitrary names.
337 337 Snapshots of volumes can be cloned or rolled back, but cannot be accessed
338 338 independently.
339 339 .Pp
340 340 File system snapshots can be accessed under the
341 341 .Pa .zfs/snapshot
342 342 directory in the root of the file system.
343 343 Snapshots are automatically mounted on demand and may be unmounted at regular
344 344 intervals.
345 345 The visibility of the
346 346 .Pa .zfs
347 347 directory can be controlled by the
348 348 .Sy snapdir
349 349 property.
350 350 .Ss Clones
351 351 A clone is a writable volume or file system whose initial contents are the same
352 352 as another dataset.
353 353 As with snapshots, creating a clone is nearly instantaneous, and initially
354 354 consumes no additional space.
355 355 .Pp
356 356 Clones can only be created from a snapshot.
357 357 When a snapshot is cloned, it creates an implicit dependency between the parent
358 358 and child.
359 359 Even though the clone is created somewhere else in the dataset hierarchy, the
360 360 original snapshot cannot be destroyed as long as a clone exists.
361 361 The
362 362 .Sy origin
363 363 property exposes this dependency, and the
364 364 .Cm destroy
365 365 command lists any such dependencies, if they exist.
366 366 .Pp
367 367 The clone parent-child dependency relationship can be reversed by using the
368 368 .Cm promote
369 369 subcommand.
370 370 This causes the
371 371 .Qq origin
372 372 file system to become a clone of the specified file system, which makes it
373 373 possible to destroy the file system that the clone was created from.
374 374 .Ss "Mount Points"
375 375 Creating a ZFS file system is a simple operation, so the number of file systems
376 376 per system is likely to be numerous.
377 377 To cope with this, ZFS automatically manages mounting and unmounting file
378 378 systems without the need to edit the
379 379 .Pa /etc/vfstab
380 380 file.
381 381 All automatically managed file systems are mounted by ZFS at boot time.
382 382 .Pp
383 383 By default, file systems are mounted under
384 384 .Pa /path ,
385 385 where
386 386 .Ar path
387 387 is the name of the file system in the ZFS namespace.
388 388 Directories are created and destroyed as needed.
389 389 .Pp
390 390 A file system can also have a mount point set in the
391 391 .Sy mountpoint
392 392 property.
393 393 This directory is created as needed, and ZFS automatically mounts the file
394 394 system when the
395 395 .Nm zfs Cm mount Fl a
396 396 command is invoked
397 397 .Po without editing
398 398 .Pa /etc/vfstab
399 399 .Pc .
400 400 The
401 401 .Sy mountpoint
402 402 property can be inherited, so if
403 403 .Em pool/home
404 404 has a mount point of
405 405 .Pa /export/stuff ,
406 406 then
407 407 .Em pool/home/user
408 408 automatically inherits a mount point of
409 409 .Pa /export/stuff/user .
410 410 .Pp
411 411 A file system
412 412 .Sy mountpoint
413 413 property of
414 414 .Sy none
415 415 prevents the file system from being mounted.
416 416 .Pp
417 417 If needed, ZFS file systems can also be managed with traditional tools
418 418 .Po
419 419 .Nm mount ,
420 420 .Nm umount ,
421 421 .Pa /etc/vfstab
422 422 .Pc .
423 423 If a file system's mount point is set to
424 424 .Sy legacy ,
425 425 ZFS makes no attempt to manage the file system, and the administrator is
426 426 responsible for mounting and unmounting the file system.
427 427 .Ss "Zones"
428 428 A ZFS file system can be added to a non-global zone by using the
429 429 .Nm zonecfg Cm add Sy fs
430 430 subcommand.
431 431 A ZFS file system that is added to a non-global zone must have its
432 432 .Sy mountpoint
433 433 property set to
434 434 .Sy legacy .
435 435 .Pp
436 436 The physical properties of an added file system are controlled by the global
437 437 administrator.
438 438 However, the zone administrator can create, modify, or destroy files within the
439 439 added file system, depending on how the file system is mounted.
440 440 .Pp
441 441 A dataset can also be delegated to a non-global zone by using the
442 442 .Nm zonecfg Cm add Sy dataset
443 443 subcommand.
444 444 You cannot delegate a dataset to one zone and the children of the same dataset
445 445 to another zone.
446 446 The zone administrator can change properties of the dataset or any of its
447 447 children.
448 448 However, the
449 449 .Sy quota ,
450 450 .Sy filesystem_limit
451 451 and
452 452 .Sy snapshot_limit
453 453 properties of the delegated dataset can be modified only by the global
454 454 administrator.
455 455 .Pp
456 456 A ZFS volume can be added as a device to a non-global zone by using the
457 457 .Nm zonecfg Cm add Sy device
458 458 subcommand.
459 459 However, its physical properties can be modified only by the global
460 460 administrator.
461 461 .Pp
462 462 For more information about
463 463 .Nm zonecfg
464 464 syntax, see
465 465 .Xr zonecfg 1M .
466 466 .Pp
467 467 After a dataset is delegated to a non-global zone, the
468 468 .Sy zoned
469 469 property is automatically set.
470 470 A zoned file system cannot be mounted in the global zone, since the zone
471 471 administrator might have to set the mount point to an unacceptable value.
472 472 .Pp
473 473 The global administrator can forcibly clear the
474 474 .Sy zoned
475 475 property, though this should be done with extreme care.
476 476 The global administrator should verify that all the mount points are acceptable
477 477 before clearing the property.
478 478 .Ss Native Properties
479 479 Properties are divided into two types, native properties and user-defined
480 480 .Po or
481 481 .Qq user
482 482 .Pc
483 483 properties.
484 484 Native properties either export internal statistics or control ZFS behavior.
485 485 In addition, native properties are either editable or read-only.
486 486 User properties have no effect on ZFS behavior, but you can use them to annotate
487 487 datasets in a way that is meaningful in your environment.
488 488 For more information about user properties, see the
489 489 .Sx User Properties
490 490 section, below.
491 491 .Pp
492 492 Every dataset has a set of properties that export statistics about the dataset
493 493 as well as control various behaviors.
494 494 Properties are inherited from the parent unless overridden by the child.
495 495 Some properties apply only to certain types of datasets
496 496 .Pq file systems, volumes, or snapshots .
497 497 .Pp
498 498 The values of numeric properties can be specified using human-readable suffixes
499 499 .Po for example,
500 500 .Sy k ,
501 501 .Sy KB ,
502 502 .Sy M ,
503 503 .Sy Gb ,
504 504 and so forth, up to
505 505 .Sy Z
506 506 for zettabyte
507 507 .Pc .
508 508 The following are all valid
509 509 .Pq and equal
510 510 specifications:
511 511 .Li 1536M, 1.5g, 1.50GB .
512 512 .Pp
513 513 The values of non-numeric properties are case sensitive and must be lowercase,
514 514 except for
515 515 .Sy mountpoint ,
516 516 .Sy sharenfs ,
517 517 and
518 518 .Sy sharesmb .
519 519 .Pp
520 520 The following native properties consist of read-only statistics about the
521 521 dataset.
522 522 These properties can be neither set, nor inherited.
523 523 Native properties apply to all dataset types unless otherwise noted.
524 524 .Bl -tag -width "usedbyrefreservation"
525 525 .It Sy available
526 526 The amount of space available to the dataset and all its children, assuming that
527 527 there is no other activity in the pool.
528 528 Because space is shared within a pool, availability can be limited by any number
529 529 of factors, including physical pool size, quotas, reservations, or other
530 530 datasets within the pool.
531 531 .Pp
532 532 This property can also be referred to by its shortened column name,
533 533 .Sy avail .
534 534 .It Sy compressratio
535 535 For non-snapshots, the compression ratio achieved for the
536 536 .Sy used
537 537 space of this dataset, expressed as a multiplier.
538 538 The
539 539 .Sy used
540 540 property includes descendant datasets, and, for clones, does not include the
541 541 space shared with the origin snapshot.
542 542 For snapshots, the
543 543 .Sy compressratio
544 544 is the same as the
545 545 .Sy refcompressratio
546 546 property.
547 547 Compression can be turned on by running:
548 548 .Nm zfs Cm set Sy compression Ns = Ns Sy on Ar dataset .
549 549 The default value is
550 550 .Sy off .
551 551 .It Sy creation
552 552 The time this dataset was created.
553 553 .It Sy clones
554 554 For snapshots, this property is a comma-separated list of filesystems or volumes
555 555 which are clones of this snapshot.
556 556 The clones'
557 557 .Sy origin
558 558 property is this snapshot.
559 559 If the
560 560 .Sy clones
561 561 property is not empty, then this snapshot can not be destroyed
562 562 .Po even with the
563 563 .Fl r
564 564 or
565 565 .Fl f
566 566 options
567 567 .Pc .
568 568 .It Sy defer_destroy
569 569 This property is
570 570 .Sy on
571 571 if the snapshot has been marked for deferred destroy by using the
572 572 .Nm zfs Cm destroy Fl d
573 573 command.
574 574 Otherwise, the property is
575 575 .Sy off .
576 576 .It Sy filesystem_count
577 577 The total number of filesystems and volumes that exist under this location in
578 578 the dataset tree.
579 579 This value is only available when a
580 580 .Sy filesystem_limit
581 581 has been set somewhere in the tree under which the dataset resides.
582 582 .It Sy logicalreferenced
583 583 The amount of space that is
584 584 .Qq logically
585 585 accessible by this dataset.
586 586 See the
587 587 .Sy referenced
588 588 property.
589 589 The logical space ignores the effect of the
590 590 .Sy compression
591 591 and
592 592 .Sy copies
593 593 properties, giving a quantity closer to the amount of data that applications
594 594 see.
595 595 However, it does include space consumed by metadata.
596 596 .Pp
597 597 This property can also be referred to by its shortened column name,
598 598 .Sy lrefer .
599 599 .It Sy logicalused
600 600 The amount of space that is
601 601 .Qq logically
602 602 consumed by this dataset and all its descendents.
603 603 See the
604 604 .Sy used
605 605 property.
606 606 The logical space ignores the effect of the
607 607 .Sy compression
608 608 and
609 609 .Sy copies
610 610 properties, giving a quantity closer to the amount of data that applications
611 611 see.
612 612 However, it does include space consumed by metadata.
613 613 .Pp
614 614 This property can also be referred to by its shortened column name,
615 615 .Sy lused .
616 616 .It Sy mounted
617 617 For file systems, indicates whether the file system is currently mounted.
618 618 This property can be either
619 619 .Sy yes
620 620 or
621 621 .Sy no .
622 622 .It Sy origin
623 623 For cloned file systems or volumes, the snapshot from which the clone was
624 624 created.
625 625 See also the
626 626 .Sy clones
627 627 property.
628 628 .It Sy receive_resume_token
629 629 For filesystems or volumes which have saved partially-completed state from
630 630 .Sy zfs receive -s ,
631 631 this opaque token can be provided to
632 632 .Sy zfs send -t
633 633 to resume and complete the
634 634 .Sy zfs receive .
635 635 .It Sy referenced
636 636 The amount of data that is accessible by this dataset, which may or may not be
637 637 shared with other datasets in the pool.
638 638 When a snapshot or clone is created, it initially references the same amount of
639 639 space as the file system or snapshot it was created from, since its contents are
640 640 identical.
641 641 .Pp
642 642 This property can also be referred to by its shortened column name,
643 643 .Sy refer .
644 644 .It Sy refcompressratio
645 645 The compression ratio achieved for the
646 646 .Sy referenced
647 647 space of this dataset, expressed as a multiplier.
648 648 See also the
649 649 .Sy compressratio
650 650 property.
651 651 .It Sy snapshot_count
652 652 The total number of snapshots that exist under this location in the dataset
653 653 tree.
654 654 This value is only available when a
655 655 .Sy snapshot_limit
656 656 has been set somewhere in the tree under which the dataset resides.
657 657 .It Sy type
658 658 The type of dataset:
659 659 .Sy filesystem ,
660 660 .Sy volume ,
661 661 or
662 662 .Sy snapshot .
663 663 .It Sy used
664 664 The amount of space consumed by this dataset and all its descendents.
665 665 This is the value that is checked against this dataset's quota and reservation.
666 666 The space used does not include this dataset's reservation, but does take into
667 667 account the reservations of any descendent datasets.
668 668 The amount of space that a dataset consumes from its parent, as well as the
669 669 amount of space that is freed if this dataset is recursively destroyed, is the
670 670 greater of its space used and its reservation.
671 671 .Pp
672 672 The used space of a snapshot
673 673 .Po see the
674 674 .Sx Snapshots
675 675 section
676 676 .Pc
677 677 is space that is referenced exclusively by this snapshot.
678 678 If this snapshot is destroyed, the amount of
679 679 .Sy used
680 680 space will be freed.
681 681 Space that is shared by multiple snapshots isn't accounted for in this metric.
682 682 When a snapshot is destroyed, space that was previously shared with this
683 683 snapshot can become unique to snapshots adjacent to it, thus changing the used
684 684 space of those snapshots.
685 685 The used space of the latest snapshot can also be affected by changes in the
686 686 file system.
687 687 Note that the
688 688 .Sy used
689 689 space of a snapshot is a subset of the
690 690 .Sy written
691 691 space of the snapshot.
692 692 .Pp
693 693 The amount of space used, available, or referenced does not take into account
694 694 pending changes.
695 695 Pending changes are generally accounted for within a few seconds.
696 696 Committing a change to a disk using
697 697 .Xr fsync 3C
698 698 or
699 699 .Dv O_SYNC
700 700 does not necessarily guarantee that the space usage information is updated
701 701 immediately.
702 702 .It Sy usedby*
703 703 The
704 704 .Sy usedby*
705 705 properties decompose the
706 706 .Sy used
707 707 properties into the various reasons that space is used.
708 708 Specifically,
709 709 .Sy used No =
710 710 .Sy usedbychildren No +
711 711 .Sy usedbydataset No +
712 712 .Sy usedbyrefreservation No +
713 713 .Sy usedbysnapshots .
714 714 These properties are only available for datasets created on
715 715 .Nm zpool
716 716 .Qo version 13 Qc
717 717 pools.
718 718 .It Sy usedbychildren
719 719 The amount of space used by children of this dataset, which would be freed if
720 720 all the dataset's children were destroyed.
721 721 .It Sy usedbydataset
722 722 The amount of space used by this dataset itself, which would be freed if the
723 723 dataset were destroyed
724 724 .Po after first removing any
725 725 .Sy refreservation
726 726 and destroying any necessary snapshots or descendents
727 727 .Pc .
728 728 .It Sy usedbyrefreservation
729 729 The amount of space used by a
730 730 .Sy refreservation
731 731 set on this dataset, which would be freed if the
732 732 .Sy refreservation
733 733 was removed.
734 734 .It Sy usedbysnapshots
735 735 The amount of space consumed by snapshots of this dataset.
736 736 In particular, it is the amount of space that would be freed if all of this
737 737 dataset's snapshots were destroyed.
738 738 Note that this is not simply the sum of the snapshots'
739 739 .Sy used
740 740 properties because space can be shared by multiple snapshots.
741 741 .It Sy userused Ns @ Ns Em user
742 742 The amount of space consumed by the specified user in this dataset.
743 743 Space is charged to the owner of each file, as displayed by
744 744 .Nm ls Fl l .
745 745 The amount of space charged is displayed by
746 746 .Nm du
747 747 and
748 748 .Nm ls Fl s .
749 749 See the
750 750 .Nm zfs Cm userspace
751 751 subcommand for more information.
752 752 .Pp
753 753 Unprivileged users can access only their own space usage.
754 754 The root user, or a user who has been granted the
755 755 .Sy userused
756 756 privilege with
757 757 .Nm zfs Cm allow ,
758 758 can access everyone's usage.
759 759 .Pp
760 760 The
761 761 .Sy userused Ns @ Ns Em ...
762 762 properties are not displayed by
763 763 .Nm zfs Cm get Sy all .
764 764 The user's name must be appended after the @ symbol, using one of the following
765 765 forms:
766 766 .Bl -bullet -width ""
767 767 .It
768 768 .Em POSIX name
769 769 .Po for example,
770 770 .Sy joe
771 771 .Pc
772 772 .It
773 773 .Em POSIX numeric ID
774 774 .Po for example,
775 775 .Sy 789
776 776 .Pc
777 777 .It
778 778 .Em SID name
779 779 .Po for example,
780 780 .Sy joe.smith@mydomain
781 781 .Pc
782 782 .It
783 783 .Em SID numeric ID
784 784 .Po for example,
785 785 .Sy S-1-123-456-789
786 786 .Pc
787 787 .El
788 788 .It Sy userrefs
789 789 This property is set to the number of user holds on this snapshot.
790 790 User holds are set by using the
791 791 .Nm zfs Cm hold
792 792 command.
793 793 .It Sy groupused Ns @ Ns Em group
794 794 The amount of space consumed by the specified group in this dataset.
795 795 Space is charged to the group of each file, as displayed by
796 796 .Nm ls Fl l .
797 797 See the
798 798 .Sy userused Ns @ Ns Em user
799 799 property for more information.
800 800 .Pp
801 801 Unprivileged users can only access their own groups' space usage.
802 802 The root user, or a user who has been granted the
803 803 .Sy groupused
804 804 privilege with
805 805 .Nm zfs Cm allow ,
806 806 can access all groups' usage.
807 807 .It Sy volblocksize
808 808 For volumes, specifies the block size of the volume.
809 809 The
810 810 .Sy blocksize
811 811 cannot be changed once the volume has been written, so it should be set at
812 812 volume creation time.
813 813 The default
814 814 .Sy blocksize
815 815 for volumes is 8 Kbytes.
816 816 Any power of 2 from 512 bytes to 128 Kbytes is valid.
817 817 .Pp
818 818 This property can also be referred to by its shortened column name,
819 819 .Sy volblock .
820 820 .It Sy written
821 821 The amount of space
822 822 .Sy referenced
823 823 by this dataset, that was written since the previous snapshot
824 824 .Pq i.e. that is not referenced by the previous snapshot .
825 825 .It Sy written Ns @ Ns Em snapshot
826 826 The amount of
827 827 .Sy referenced
828 828 space written to this dataset since the specified snapshot.
829 829 This is the space that is referenced by this dataset but was not referenced by
830 830 the specified snapshot.
831 831 .Pp
832 832 The
833 833 .Em snapshot
834 834 may be specified as a short snapshot name
835 835 .Po just the part after the
836 836 .Sy @
837 837 .Pc ,
838 838 in which case it will be interpreted as a snapshot in the same filesystem as
839 839 this dataset.
840 840 The
841 841 .Em snapshot
842 842 may be a full snapshot name
843 843 .Po Em filesystem Ns @ Ns Em snapshot Pc ,
844 844 which for clones may be a snapshot in the origin's filesystem
845 845 .Pq or the origin of the origin's filesystem, etc.
846 846 .El
847 847 .Pp
848 848 The following native properties can be used to change the behavior of a ZFS
849 849 dataset.
850 850 .Bl -tag -width ""
851 851 .It Xo
852 852 .Sy aclinherit Ns = Ns Sy discard Ns | Ns Sy noallow Ns | Ns
853 853 .Sy restricted Ns | Ns Sy passthrough Ns | Ns Sy passthrough-x
854 854 .Xc
855 855 Controls how ACEs are inherited when files and directories are created.
856 856 .Bl -tag -width "passthrough-x"
857 857 .It Sy discard
858 858 does not inherit any ACEs.
859 859 .It Sy noallow
860 860 only inherits inheritable ACEs that specify
861 861 .Qq deny
862 862 permissions.
863 863 .It Sy restricted
864 864 default, removes the
865 865 .Sy write_acl
866 866 and
867 867 .Sy write_owner
868 868 permissions when the ACE is inherited.
869 869 .It Sy passthrough
870 870 inherits all inheritable ACEs without any modifications.
871 871 .It Sy passthrough-x
872 872 same meaning as
873 873 .Sy passthrough ,
874 874 except that the
875 875 .Sy owner@ ,
876 876 .Sy group@ ,
877 877 and
878 878 .Sy everyone@
879 879 ACEs inherit the execute permission only if the file creation mode also requests
880 880 the execute bit.
881 881 .El
882 882 .Pp
883 883 When the property value is set to
884 884 .Sy passthrough ,
885 885 files are created with a mode determined by the inheritable ACEs.
886 886 If no inheritable ACEs exist that affect the mode, then the mode is set in
887 887 accordance to the requested mode from the application.
888 888 .It Xo
889 889 .Sy aclmode Ns = Ns Sy discard Ns | Ns Sy groupmask Ns | Ns
890 890 .Sy passthrough Ns | Ns Sy restricted
891 891 .Xc
892 892 Controls how an ACL is modified during
893 893 .Xr chmod 2
894 894 and how inherited ACEs are modified by the file creation mode.
895 895 .Bl -tag -width "passthrough"
896 896 .It Sy discard
897 897 default, deletes all ACEs except for those representing the mode of the file or
898 898 directory requested by
899 899 .Xr chmod 2 .
900 900 .It Sy groupmask
901 901 reduces permissions granted by all
902 902 .Sy ALLOW
903 903 entries found in the ACL such that they are no greater than the group
904 904 permissions specified by the mode.
905 905 .It Sy passthrough
906 906 indicates that no changes are made to the ACL other than creating or updating
907 907 the necessary ACEs to represent the new mode of the file or directory.
908 908 .It Sy restricted
909 909 causes the
910 910 .Xr chmod 2
911 911 operation to return an error when used on any file or directory which has a
912 912 non-trivial ACL, with entries in addition to those that represent the mode.
913 913 .El
914 914 .Pp
915 915 .Xr chmod 2
916 916 is required to change the set user ID, set group ID, or sticky bit on a file or
917 917 directory, as they do not have equivalent ACEs.
918 918 In order to use
919 919 .Xr chmod 2
920 920 on a file or directory with a non-trivial ACL when
921 921 .Sy aclmode
922 922 is set to
923 923 .Sy restricted ,
924 924 you must first remove all ACEs except for those that represent the current mode.
925 925 .It Sy atime Ns = Ns Sy on Ns | Ns Sy off
926 926 Controls whether the access time for files is updated when they are read.
927 927 Turning this property off avoids producing write traffic when reading files and
928 928 can result in significant performance gains, though it might confuse mailers
929 929 and other similar utilities.
930 930 The default value is
931 931 .Sy on .
932 932 .It Sy canmount Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Sy noauto
933 933 If this property is set to
934 934 .Sy off ,
935 935 the file system cannot be mounted, and is ignored by
936 936 .Nm zfs Cm mount Fl a .
937 937 Setting this property to
938 938 .Sy off
939 939 is similar to setting the
940 940 .Sy mountpoint
941 941 property to
942 942 .Sy none ,
943 943 except that the dataset still has a normal
944 944 .Sy mountpoint
945 945 property, which can be inherited.
946 946 Setting this property to
947 947 .Sy off
948 948 allows datasets to be used solely as a mechanism to inherit properties.
949 949 One example of setting
950 950 .Sy canmount Ns = Ns Sy off
951 951 is to have two datasets with the same
952 952 .Sy mountpoint ,
953 953 so that the children of both datasets appear in the same directory, but might
954 954 have different inherited characteristics.
955 955 .Pp
956 956 When set to
957 957 .Sy noauto ,
958 958 a dataset can only be mounted and unmounted explicitly.
959 959 The dataset is not mounted automatically when the dataset is created or
960 960 imported, nor is it mounted by the
961 961 .Nm zfs Cm mount Fl a
962 962 command or unmounted by the
963 963 .Nm zfs Cm unmount Fl a
964 964 command.
965 965 .Pp
966 966 This property is not inherited.
967 967 .It Xo
968 968 .Sy checksum Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Sy fletcher2 Ns | Ns
969 969 .Sy fletcher4 Ns | Ns Sy sha256 Ns | Ns Sy noparity Ns | Ns
970 970 .Sy sha512 Ns | Ns Sy skein Ns | Ns Sy edonr
971 971 .Xc
972 972 Controls the checksum used to verify data integrity.
973 973 The default value is
974 974 .Sy on ,
975 975 which automatically selects an appropriate algorithm
976 976 .Po currently,
977 977 .Sy fletcher4 ,
978 978 but this may change in future releases
979 979 .Pc .
980 980 The value
981 981 .Sy off
982 982 disables integrity checking on user data.
983 983 The value
984 984 .Sy noparity
985 985 not only disables integrity but also disables maintaining parity for user data.
986 986 This setting is used internally by a dump device residing on a RAID-Z pool and
987 987 should not be used by any other dataset.
988 988 Disabling checksums is
989 989 .Sy NOT
990 990 a recommended practice.
991 991 .Pp
992 992 The
993 993 .Sy sha512 ,
994 994 .Sy skein ,
995 995 and
996 996 .Sy edonr
997 997 checksum algorithms require enabling the appropriate features on the pool.
998 998 Please see
999 999 .Xr zpool-features 5
1000 1000 for more information on these algorithms.
1001 1001 .Pp
1002 1002 Changing this property affects only newly-written data.
1003 1003 .Pp
1004 1004 Salted checksum algorithms
1005 1005 .Pq Cm edonr , skein
1006 1006 are currently not supported for any filesystem on the boot pools.
1007 1007 .It Xo
1008 1008 .Sy compression Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Sy gzip Ns | Ns
1009 1009 .Sy gzip- Ns Em N Ns | Ns Sy lz4 Ns | Ns Sy lzjb Ns | Ns Sy zle
1010 1010 .Xc
1011 1011 Controls the compression algorithm used for this dataset.
1012 1012 .Pp
1013 1013 Setting compression to
1014 1014 .Sy on
1015 1015 indicates that the current default compression algorithm should be used.
1016 1016 The default balances compression and decompression speed, with compression ratio
1017 1017 and is expected to work well on a wide variety of workloads.
1018 1018 Unlike all other settings for this property,
1019 1019 .Sy on
1020 1020 does not select a fixed compression type.
1021 1021 As new compression algorithms are added to ZFS and enabled on a pool, the
1022 1022 default compression algorithm may change.
1023 1023 The current default compression algorithm is either
1024 1024 .Sy lzjb
1025 1025 or, if the
1026 1026 .Sy lz4_compress
1027 1027 feature is enabled,
1028 1028 .Sy lz4 .
1029 1029 .Pp
1030 1030 The
1031 1031 .Sy lz4
1032 1032 compression algorithm is a high-performance replacement for the
1033 1033 .Sy lzjb
1034 1034 algorithm.
1035 1035 It features significantly faster compression and decompression, as well as a
1036 1036 moderately higher compression ratio than
1037 1037 .Sy lzjb ,
1038 1038 but can only be used on pools with the
1039 1039 .Sy lz4_compress
1040 1040 feature set to
1041 1041 .Sy enabled .
1042 1042 See
1043 1043 .Xr zpool-features 5
1044 1044 for details on ZFS feature flags and the
1045 1045 .Sy lz4_compress
1046 1046 feature.
1047 1047 .Pp
1048 1048 The
1049 1049 .Sy lzjb
1050 1050 compression algorithm is optimized for performance while providing decent data
1051 1051 compression.
1052 1052 .Pp
1053 1053 The
1054 1054 .Sy gzip
1055 1055 compression algorithm uses the same compression as the
1056 1056 .Xr gzip 1
1057 1057 command.
1058 1058 You can specify the
1059 1059 .Sy gzip
1060 1060 level by using the value
1061 1061 .Sy gzip- Ns Em N ,
1062 1062 where
1063 1063 .Em N
1064 1064 is an integer from 1
1065 1065 .Pq fastest
1066 1066 to 9
1067 1067 .Pq best compression ratio .
1068 1068 Currently,
1069 1069 .Sy gzip
1070 1070 is equivalent to
1071 1071 .Sy gzip-6
1072 1072 .Po which is also the default for
1073 1073 .Xr gzip 1
1074 1074 .Pc .
1075 1075 .Pp
1076 1076 The
1077 1077 .Sy zle
1078 1078 compression algorithm compresses runs of zeros.
1079 1079 .Pp
1080 1080 This property can also be referred to by its shortened column name
1081 1081 .Sy compress .
1082 1082 Changing this property affects only newly-written data.
1083 1083 .It Sy copies Ns = Ns Sy 1 Ns | Ns Sy 2 Ns | Ns Sy 3
1084 1084 Controls the number of copies of data stored for this dataset.
1085 1085 These copies are in addition to any redundancy provided by the pool, for
1086 1086 example, mirroring or RAID-Z.
1087 1087 The copies are stored on different disks, if possible.
1088 1088 The space used by multiple copies is charged to the associated file and dataset,
1089 1089 changing the
1090 1090 .Sy used
1091 1091 property and counting against quotas and reservations.
1092 1092 .Pp
1093 1093 Changing this property only affects newly-written data.
1094 1094 Therefore, set this property at file system creation time by using the
1095 1095 .Fl o Sy copies Ns = Ns Ar N
1096 1096 option.
1097 1097 .It Sy devices Ns = Ns Sy on Ns | Ns Sy off
1098 1098 Controls whether device nodes can be opened on this file system.
1099 1099 The default value is
1100 1100 .Sy on .
1101 1101 .It Sy exec Ns = Ns Sy on Ns | Ns Sy off
1102 1102 Controls whether processes can be executed from within this file system.
1103 1103 The default value is
1104 1104 .Sy on .
1105 1105 .It Sy filesystem_limit Ns = Ns Em count Ns | Ns Sy none
1106 1106 Limits the number of filesystems and volumes that can exist under this point in
1107 1107 the dataset tree.
1108 1108 The limit is not enforced if the user is allowed to change the limit.
1109 1109 Setting a
1110 1110 .Sy filesystem_limit
1111 1111 to
1112 1112 .Sy on
1113 1113 a descendent of a filesystem that already has a
1114 1114 .Sy filesystem_limit
1115 1115 does not override the ancestor's
1116 1116 .Sy filesystem_limit ,
1117 1117 but rather imposes an additional limit.
1118 1118 This feature must be enabled to be used
1119 1119 .Po see
1120 1120 .Xr zpool-features 5
1121 1121 .Pc .
1122 1122 .It Sy mountpoint Ns = Ns Pa path Ns | Ns Sy none Ns | Ns Sy legacy
1123 1123 Controls the mount point used for this file system.
1124 1124 See the
1125 1125 .Sx Mount Points
1126 1126 section for more information on how this property is used.
1127 1127 .Pp
1128 1128 When the
1129 1129 .Sy mountpoint
1130 1130 property is changed for a file system, the file system and any children that
1131 1131 inherit the mount point are unmounted.
1132 1132 If the new value is
1133 1133 .Sy legacy ,
1134 1134 then they remain unmounted.
1135 1135 Otherwise, they are automatically remounted in the new location if the property
1136 1136 was previously
1137 1137 .Sy legacy
1138 1138 or
1139 1139 .Sy none ,
1140 1140 or if they were mounted before the property was changed.
1141 1141 In addition, any shared file systems are unshared and shared in the new
1142 1142 location.
1143 1143 .It Sy nbmand Ns = Ns Sy on Ns | Ns Sy off
1144 1144 Controls whether the file system should be mounted with
1145 1145 .Sy nbmand
1146 1146 .Pq Non Blocking mandatory locks .
1147 1147 This is used for SMB clients.
1148 1148 Changes to this property only take effect when the file system is umounted and
1149 1149 remounted.
1150 1150 See
1151 1151 .Xr mount 1M
1152 1152 for more information on
1153 1153 .Sy nbmand
1154 1154 mounts.
1155 1155 .It Sy primarycache Ns = Ns Sy all Ns | Ns Sy none Ns | Ns Sy metadata
1156 1156 Controls what is cached in the primary cache
1157 1157 .Pq ARC .
1158 1158 If this property is set to
1159 1159 .Sy all ,
1160 1160 then both user data and metadata is cached.
1161 1161 If this property is set to
1162 1162 .Sy none ,
1163 1163 then neither user data nor metadata is cached.
1164 1164 If this property is set to
1165 1165 .Sy metadata ,
1166 1166 then only metadata is cached.
1167 1167 The default value is
1168 1168 .Sy all .
1169 1169 .It Sy quota Ns = Ns Em size Ns | Ns Sy none
1170 1170 Limits the amount of space a dataset and its descendents can consume.
1171 1171 This property enforces a hard limit on the amount of space used.
1172 1172 This includes all space consumed by descendents, including file systems and
1173 1173 snapshots.
1174 1174 Setting a quota on a descendent of a dataset that already has a quota does not
1175 1175 override the ancestor's quota, but rather imposes an additional limit.
1176 1176 .Pp
1177 1177 Quotas cannot be set on volumes, as the
1178 1178 .Sy volsize
1179 1179 property acts as an implicit quota.
1180 1180 .It Sy snapshot_limit Ns = Ns Em count Ns | Ns Sy none
1181 1181 Limits the number of snapshots that can be created on a dataset and its
1182 1182 descendents.
1183 1183 Setting a
1184 1184 .Sy snapshot_limit
1185 1185 on a descendent of a dataset that already has a
1186 1186 .Sy snapshot_limit
1187 1187 does not override the ancestor's
1188 1188 .Sy snapshot_limit ,
1189 1189 but rather imposes an additional limit.
1190 1190 The limit is not enforced if the user is allowed to change the limit.
1191 1191 For example, this means that recursive snapshots taken from the global zone are
1192 1192 counted against each delegated dataset within a zone.
1193 1193 This feature must be enabled to be used
1194 1194 .Po see
1195 1195 .Xr zpool-features 5
1196 1196 .Pc .
1197 1197 .It Sy userquota@ Ns Em user Ns = Ns Em size Ns | Ns Sy none
1198 1198 Limits the amount of space consumed by the specified user.
1199 1199 User space consumption is identified by the
1200 1200 .Sy userspace@ Ns Em user
1201 1201 property.
1202 1202 .Pp
1203 1203 Enforcement of user quotas may be delayed by several seconds.
1204 1204 This delay means that a user might exceed their quota before the system notices
1205 1205 that they are over quota and begins to refuse additional writes with the
1206 1206 .Er EDQUOT
1207 1207 error message.
1208 1208 See the
1209 1209 .Nm zfs Cm userspace
1210 1210 subcommand for more information.
1211 1211 .Pp
1212 1212 Unprivileged users can only access their own groups' space usage.
1213 1213 The root user, or a user who has been granted the
1214 1214 .Sy userquota
1215 1215 privilege with
1216 1216 .Nm zfs Cm allow ,
1217 1217 can get and set everyone's quota.
1218 1218 .Pp
1219 1219 This property is not available on volumes, on file systems before version 4, or
1220 1220 on pools before version 15.
1221 1221 The
1222 1222 .Sy userquota@ Ns Em ...
1223 1223 properties are not displayed by
1224 1224 .Nm zfs Cm get Sy all .
1225 1225 The user's name must be appended after the
1226 1226 .Sy @
1227 1227 symbol, using one of the following forms:
1228 1228 .Bl -bullet
1229 1229 .It
1230 1230 .Em POSIX name
1231 1231 .Po for example,
1232 1232 .Sy joe
1233 1233 .Pc
1234 1234 .It
1235 1235 .Em POSIX numeric ID
1236 1236 .Po for example,
1237 1237 .Sy 789
1238 1238 .Pc
1239 1239 .It
1240 1240 .Em SID name
1241 1241 .Po for example,
1242 1242 .Sy joe.smith@mydomain
1243 1243 .Pc
1244 1244 .It
1245 1245 .Em SID numeric ID
1246 1246 .Po for example,
1247 1247 .Sy S-1-123-456-789
1248 1248 .Pc
1249 1249 .El
1250 1250 .It Sy groupquota@ Ns Em group Ns = Ns Em size Ns | Ns Sy none
1251 1251 Limits the amount of space consumed by the specified group.
1252 1252 Group space consumption is identified by the
1253 1253 .Sy groupused@ Ns Em group
1254 1254 property.
1255 1255 .Pp
1256 1256 Unprivileged users can access only their own groups' space usage.
1257 1257 The root user, or a user who has been granted the
1258 1258 .Sy groupquota
1259 1259 privilege with
1260 1260 .Nm zfs Cm allow ,
1261 1261 can get and set all groups' quotas.
1262 1262 .It Sy readonly Ns = Ns Sy on Ns | Ns Sy off
1263 1263 Controls whether this dataset can be modified.
1264 1264 The default value is
1265 1265 .Sy off .
1266 1266 .Pp
1267 1267 This property can also be referred to by its shortened column name,
1268 1268 .Sy rdonly .
1269 1269 .It Sy recordsize Ns = Ns Em size
1270 1270 Specifies a suggested block size for files in the file system.
1271 1271 This property is designed solely for use with database workloads that access
1272 1272 files in fixed-size records.
1273 1273 ZFS automatically tunes block sizes according to internal algorithms optimized
1274 1274 for typical access patterns.
1275 1275 .Pp
1276 1276 For databases that create very large files but access them in small random
1277 1277 chunks, these algorithms may be suboptimal.
1278 1278 Specifying a
1279 1279 .Sy recordsize
1280 1280 greater than or equal to the record size of the database can result in
1281 1281 significant performance gains.
1282 1282 Use of this property for general purpose file systems is strongly discouraged,
1283 1283 and may adversely affect performance.
1284 1284 .Pp
1285 1285 The size specified must be a power of two greater than or equal to 512 and less
1286 1286 than or equal to 128 Kbytes.
1287 1287 If the
1288 1288 .Sy large_blocks
1289 1289 feature is enabled on the pool, the size may be up to 1 Mbyte.
1290 1290 See
1291 1291 .Xr zpool-features 5
1292 1292 for details on ZFS feature flags.
1293 1293 .Pp
1294 1294 Changing the file system's
1295 1295 .Sy recordsize
1296 1296 affects only files created afterward; existing files are unaffected.
1297 1297 .Pp
1298 1298 This property can also be referred to by its shortened column name,
1299 1299 .Sy recsize .
1300 1300 .It Sy redundant_metadata Ns = Ns Sy all Ns | Ns Sy most
1301 1301 Controls what types of metadata are stored redundantly.
1302 1302 ZFS stores an extra copy of metadata, so that if a single block is corrupted,
1303 1303 the amount of user data lost is limited.
1304 1304 This extra copy is in addition to any redundancy provided at the pool level
1305 1305 .Pq e.g. by mirroring or RAID-Z ,
1306 1306 and is in addition to an extra copy specified by the
1307 1307 .Sy copies
1308 1308 property
1309 1309 .Pq up to a total of 3 copies .
1310 1310 For example if the pool is mirrored,
1311 1311 .Sy copies Ns = Ns 2 ,
1312 1312 and
1313 1313 .Sy redundant_metadata Ns = Ns Sy most ,
1314 1314 then ZFS stores 6 copies of most metadata, and 4 copies of data and some
1315 1315 metadata.
1316 1316 .Pp
1317 1317 When set to
1318 1318 .Sy all ,
1319 1319 ZFS stores an extra copy of all metadata.
1320 1320 If a single on-disk block is corrupt, at worst a single block of user data
1321 1321 .Po which is
1322 1322 .Sy recordsize
1323 1323 bytes long
1324 1324 .Pc
1325 1325 can be lost.
1326 1326 .Pp
1327 1327 When set to
1328 1328 .Sy most ,
1329 1329 ZFS stores an extra copy of most types of metadata.
1330 1330 This can improve performance of random writes, because less metadata must be
1331 1331 written.
1332 1332 In practice, at worst about 100 blocks
1333 1333 .Po of
1334 1334 .Sy recordsize
1335 1335 bytes each
1336 1336 .Pc
1337 1337 of user data can be lost if a single on-disk block is corrupt.
↓ open down ↓ |
1337 lines elided |
↑ open up ↑ |
1338 1338 The exact behavior of which metadata blocks are stored redundantly may change in
1339 1339 future releases.
1340 1340 .Pp
1341 1341 The default value is
1342 1342 .Sy all .
1343 1343 .It Sy refquota Ns = Ns Em size Ns | Ns Sy none
1344 1344 Limits the amount of space a dataset can consume.
1345 1345 This property enforces a hard limit on the amount of space used.
1346 1346 This hard limit does not include space used by descendents, including file
1347 1347 systems and snapshots.
1348 -.It Sy refreservation Ns = Ns Em size Ns | Ns Sy none
1348 +.It Sy refreservation Ns = Ns Em size Ns | Ns Sy none Ns | Ns Sy auto
1349 1349 The minimum amount of space guaranteed to a dataset, not including its
1350 1350 descendents.
1351 1351 When the amount of space used is below this value, the dataset is treated as if
1352 1352 it were taking up the amount of space specified by
1353 1353 .Sy refreservation .
1354 1354 The
1355 1355 .Sy refreservation
1356 1356 reservation is accounted for in the parent datasets' space used, and counts
1357 1357 against the parent datasets' quotas and reservations.
1358 1358 .Pp
1359 1359 If
1360 1360 .Sy refreservation
1361 1361 is set, a snapshot is only allowed if there is enough free pool space outside of
1362 1362 this reservation to accommodate the current number of
1363 1363 .Qq referenced
1364 1364 bytes in the dataset.
1365 1365 .Pp
1366 +If
1367 +.Sy refreservation
1368 +is set to
1369 +.Sy auto ,
1370 +a volume is made dense
1371 +.Po or
1372 +.Qq not sparse
1373 +.Pc .
1374 +.Sy refreservation Ns = Ns Sy auto
1375 +is only supported on volumes. See
1376 +.Sy volsize
1377 +in the
1378 +.Sx Native Properties
1379 +section for more information about sparse volumes.
1380 +.Pp
1366 1381 This property can also be referred to by its shortened column name,
1367 1382 .Sy refreserv .
1368 -.It Sy reservation Ns = Ns Em size Ns | Ns Sy none
1383 +.It Sy reservation Ns = Ns Em size Ns | Ns Sy none Ns | Ns Sy auto
1369 1384 The minimum amount of space guaranteed to a dataset and its descendants.
1370 1385 When the amount of space used is below this value, the dataset is treated as if
1371 1386 it were taking up the amount of space specified by its reservation.
1372 1387 Reservations are accounted for in the parent datasets' space used, and count
1373 1388 against the parent datasets' quotas and reservations.
1374 1389 .Pp
1390 +See
1391 +.Sy refreservation Ns = Ns Sy auto
1392 +above for a description of the behavior of setting
1393 +.Sy reservation
1394 +to
1395 +.Sy auto .
1396 +If the pool is at version 9 or later,
1397 +.Sy refreservation Ns = Ns Sy auto
1398 +should be used instead.
1399 +.Pp
1375 1400 This property can also be referred to by its shortened column name,
1376 1401 .Sy reserv .
1377 1402 .It Sy secondarycache Ns = Ns Sy all Ns | Ns Sy none Ns | Ns Sy metadata
1378 1403 Controls what is cached in the secondary cache
1379 1404 .Pq L2ARC .
1380 1405 If this property is set to
1381 1406 .Sy all ,
1382 1407 then both user data and metadata is cached.
1383 1408 If this property is set to
1384 1409 .Sy none ,
1385 1410 then neither user data nor metadata is cached.
1386 1411 If this property is set to
1387 1412 .Sy metadata ,
1388 1413 then only metadata is cached.
1389 1414 The default value is
1390 1415 .Sy all .
1391 1416 .It Sy setuid Ns = Ns Sy on Ns | Ns Sy off
1392 1417 Controls whether the setuid bit is respected for the file system.
1393 1418 The default value is
1394 1419 .Sy on .
1395 1420 .It Sy sharesmb Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Em opts
1396 1421 Controls whether the file system is shared via SMB, and what options are to be
1397 1422 used.
1398 1423 A file system with the
1399 1424 .Sy sharesmb
1400 1425 property set to
1401 1426 .Sy off
1402 1427 is managed through traditional tools such as
1403 1428 .Xr sharemgr 1M .
1404 1429 Otherwise, the file system is automatically shared and unshared with the
1405 1430 .Nm zfs Cm share
1406 1431 and
1407 1432 .Nm zfs Cm unshare
1408 1433 commands.
1409 1434 If the property is set to
1410 1435 .Sy on ,
1411 1436 the
1412 1437 .Xr sharemgr 1M
1413 1438 command is invoked with no options.
1414 1439 Otherwise, the
1415 1440 .Xr sharemgr 1M
1416 1441 command is invoked with options equivalent to the contents of this property.
1417 1442 .Pp
1418 1443 Because SMB shares requires a resource name, a unique resource name is
1419 1444 constructed from the dataset name.
1420 1445 The constructed name is a copy of the dataset name except that the characters in
1421 1446 the dataset name, which would be invalid in the resource name, are replaced with
1422 1447 underscore
1423 1448 .Pq Sy _
1424 1449 characters.
1425 1450 A pseudo property
1426 1451 .Qq name
1427 1452 is also supported that allows you to replace the data set name with a specified
1428 1453 name.
1429 1454 The specified name is then used to replace the prefix dataset in the case of
1430 1455 inheritance.
1431 1456 For example, if the dataset
1432 1457 .Em data/home/john
1433 1458 is set to
1434 1459 .Sy name Ns = Ns Sy john ,
1435 1460 then
1436 1461 .Em data/home/john
1437 1462 has a resource name of
1438 1463 .Sy john .
1439 1464 If a child dataset
1440 1465 .Em data/home/john/backups
1441 1466 is shared, it has a resource name of
1442 1467 .Sy john_backups .
1443 1468 .Pp
1444 1469 When SMB shares are created, the SMB share name appears as an entry in the
1445 1470 .Pa .zfs/shares
1446 1471 directory.
1447 1472 You can use the
1448 1473 .Nm ls
1449 1474 or
1450 1475 .Nm chmod
1451 1476 command to display the share-level ACLs on the entries in this directory.
1452 1477 .Pp
1453 1478 When the
1454 1479 .Sy sharesmb
1455 1480 property is changed for a dataset, the dataset and any children inheriting the
1456 1481 property are re-shared with the new options, only if the property was previously
1457 1482 set to
1458 1483 .Sy off ,
1459 1484 or if they were shared before the property was changed.
1460 1485 If the new property is set to
1461 1486 .Sy off ,
1462 1487 the file systems are unshared.
1463 1488 .It Sy sharenfs Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Em opts
1464 1489 Controls whether the file system is shared via NFS, and what options are to be
1465 1490 used.
1466 1491 A file system with a
1467 1492 .Sy sharenfs
1468 1493 property of
1469 1494 .Sy off
1470 1495 is managed through traditional tools such as
1471 1496 .Xr share 1M ,
1472 1497 .Xr unshare 1M ,
1473 1498 and
1474 1499 .Xr dfstab 4 .
1475 1500 Otherwise, the file system is automatically shared and unshared with the
1476 1501 .Nm zfs Cm share
1477 1502 and
1478 1503 .Nm zfs Cm unshare
1479 1504 commands.
1480 1505 If the property is set to
1481 1506 .Sy on ,
1482 1507 .Xr share 1M
1483 1508 command is invoked with no options.
1484 1509 Otherwise, the
1485 1510 .Xr share 1M
1486 1511 command is invoked with options equivalent to the contents of this property.
1487 1512 .Pp
1488 1513 When the
1489 1514 .Sy sharenfs
1490 1515 property is changed for a dataset, the dataset and any children inheriting the
1491 1516 property are re-shared with the new options, only if the property was previously
1492 1517 .Sy off ,
1493 1518 or if they were shared before the property was changed.
1494 1519 If the new property is
1495 1520 .Sy off ,
1496 1521 the file systems are unshared.
1497 1522 .It Sy logbias Ns = Ns Sy latency Ns | Ns Sy throughput
1498 1523 Provide a hint to ZFS about handling of synchronous requests in this dataset.
1499 1524 If
1500 1525 .Sy logbias
1501 1526 is set to
1502 1527 .Sy latency
1503 1528 .Pq the default ,
1504 1529 ZFS will use pool log devices
1505 1530 .Pq if configured
1506 1531 to handle the requests at low latency.
1507 1532 If
1508 1533 .Sy logbias
1509 1534 is set to
1510 1535 .Sy throughput ,
1511 1536 ZFS will not use configured pool log devices.
1512 1537 ZFS will instead optimize synchronous operations for global pool throughput and
1513 1538 efficient use of resources.
1514 1539 .It Sy snapdir Ns = Ns Sy hidden Ns | Ns Sy visible
1515 1540 Controls whether the
1516 1541 .Pa .zfs
1517 1542 directory is hidden or visible in the root of the file system as discussed in
1518 1543 the
1519 1544 .Sx Snapshots
1520 1545 section.
1521 1546 The default value is
1522 1547 .Sy hidden .
1523 1548 .It Sy sync Ns = Ns Sy standard Ns | Ns Sy always Ns | Ns Sy disabled
1524 1549 Controls the behavior of synchronous requests
1525 1550 .Pq e.g. fsync, O_DSYNC .
1526 1551 .Sy standard
1527 1552 is the
1528 1553 .Tn POSIX
1529 1554 specified behavior of ensuring all synchronous requests are written to stable
1530 1555 storage and all devices are flushed to ensure data is not cached by device
1531 1556 controllers
1532 1557 .Pq this is the default .
1533 1558 .Sy always
1534 1559 causes every file system transaction to be written and flushed before its
1535 1560 system call returns.
1536 1561 This has a large performance penalty.
1537 1562 .Sy disabled
1538 1563 disables synchronous requests.
1539 1564 File system transactions are only committed to stable storage periodically.
1540 1565 This option will give the highest performance.
1541 1566 However, it is very dangerous as ZFS would be ignoring the synchronous
1542 1567 transaction demands of applications such as databases or NFS.
1543 1568 Administrators should only use this option when the risks are understood.
1544 1569 .It Sy version Ns = Ns Em N Ns | Ns Sy current
1545 1570 The on-disk version of this file system, which is independent of the pool
1546 1571 version.
1547 1572 This property can only be set to later supported versions.
1548 1573 See the
1549 1574 .Nm zfs Cm upgrade
1550 1575 command.
1551 1576 .It Sy volsize Ns = Ns Em size
1552 1577 For volumes, specifies the logical size of the volume.
1553 1578 By default, creating a volume establishes a reservation of equal size.
1554 1579 For storage pools with a version number of 9 or higher, a
1555 1580 .Sy refreservation
1556 1581 is set instead.
1557 1582 Any changes to
1558 1583 .Sy volsize
1559 1584 are reflected in an equivalent change to the reservation
1560 1585 .Po or
1561 1586 .Sy refreservation
1562 1587 .Pc .
1563 1588 The
1564 1589 .Sy volsize
1565 1590 can only be set to a multiple of
1566 1591 .Sy volblocksize ,
1567 1592 and cannot be zero.
1568 1593 .Pp
1569 1594 The reservation is kept equal to the volume's logical size to prevent unexpected
1570 1595 behavior for consumers.
1571 1596 Without the reservation, the volume could run out of space, resulting in
1572 1597 undefined behavior or data corruption, depending on how the volume is used.
1573 1598 These effects can also occur when the volume size is changed while it is in use
1574 1599 .Pq particularly when shrinking the size .
1575 1600 Extreme care should be used when adjusting the volume size.
1576 1601 .Pp
1577 1602 Though not recommended, a
1578 1603 .Qq sparse volume
↓ open down ↓ |
194 lines elided |
↑ open up ↑ |
1579 1604 .Po also known as
1580 1605 .Qq thin provisioning
1581 1606 .Pc
1582 1607 can be created by specifying the
1583 1608 .Fl s
1584 1609 option to the
1585 1610 .Nm zfs Cm create Fl V
1586 1611 command, or by changing the reservation after the volume has been created.
1587 1612 A
1588 1613 .Qq sparse volume
1589 -is a volume where the reservation is less then the volume size.
1614 +is a volume where the reservation is less than the size of the volume plus the
1615 +space required to store its metadata.
1590 1616 Consequently, writes to a sparse volume can fail with
1591 1617 .Er ENOSPC
1592 1618 when the pool is low on space.
1593 1619 For a sparse volume, changes to
1594 1620 .Sy volsize
1595 -are not reflected in the reservation.
1621 +are not reflected in the reservation. A sparse volume can be made dense
1622 +.Po or
1623 +.Qq not sparse
1624 +.Pc
1625 +by setting the reservation to
1626 +.Sy auto .
1596 1627 .It Sy vscan Ns = Ns Sy on Ns | Ns Sy off
1597 1628 Controls whether regular files should be scanned for viruses when a file is
1598 1629 opened and closed.
1599 1630 In addition to enabling this property, the virus scan service must also be
1600 1631 enabled for virus scanning to occur.
1601 1632 The default value is
1602 1633 .Sy off .
1603 1634 .It Sy xattr Ns = Ns Sy on Ns | Ns Sy off
1604 1635 Controls whether extended attributes are enabled for this file system.
1605 1636 The default value is
1606 1637 .Sy on .
1607 1638 .It Sy zoned Ns = Ns Sy on Ns | Ns Sy off
1608 1639 Controls whether the dataset is managed from a non-global zone.
1609 1640 See the
1610 1641 .Sx Zones
1611 1642 section for more information.
1612 1643 The default value is
1613 1644 .Sy off .
1614 1645 .El
1615 1646 .Pp
1616 1647 The following three properties cannot be changed after the file system is
1617 1648 created, and therefore, should be set when the file system is created.
1618 1649 If the properties are not set with the
1619 1650 .Nm zfs Cm create
1620 1651 or
1621 1652 .Nm zpool Cm create
1622 1653 commands, these properties are inherited from the parent dataset.
1623 1654 If the parent dataset lacks these properties due to having been created prior to
1624 1655 these features being supported, the new file system will have the default values
1625 1656 for these properties.
1626 1657 .Bl -tag -width ""
1627 1658 .It Xo
1628 1659 .Sy casesensitivity Ns = Ns Sy sensitive Ns | Ns
1629 1660 .Sy insensitive Ns | Ns Sy mixed
1630 1661 .Xc
1631 1662 Indicates whether the file name matching algorithm used by the file system
1632 1663 should be case-sensitive, case-insensitive, or allow a combination of both
1633 1664 styles of matching.
1634 1665 The default value for the
1635 1666 .Sy casesensitivity
1636 1667 property is
1637 1668 .Sy sensitive .
1638 1669 Traditionally,
1639 1670 .Ux
1640 1671 and
1641 1672 .Tn POSIX
1642 1673 file systems have case-sensitive file names.
1643 1674 .Pp
1644 1675 The
1645 1676 .Sy mixed
1646 1677 value for the
1647 1678 .Sy casesensitivity
1648 1679 property indicates that the file system can support requests for both
1649 1680 case-sensitive and case-insensitive matching behavior.
1650 1681 Currently, case-insensitive matching behavior on a file system that supports
1651 1682 mixed behavior is limited to the SMB server product.
1652 1683 For more information about the
1653 1684 .Sy mixed
1654 1685 value behavior, see the "ZFS Administration Guide".
1655 1686 .It Xo
1656 1687 .Sy normalization Ns = Ns Sy none Ns | Ns Sy formC Ns | Ns
1657 1688 .Sy formD Ns | Ns Sy formKC Ns | Ns Sy formKD
1658 1689 .Xc
1659 1690 Indicates whether the file system should perform a
1660 1691 .Sy unicode
1661 1692 normalization of file names whenever two file names are compared, and which
1662 1693 normalization algorithm should be used.
1663 1694 File names are always stored unmodified, names are normalized as part of any
1664 1695 comparison process.
1665 1696 If this property is set to a legal value other than
1666 1697 .Sy none ,
1667 1698 and the
1668 1699 .Sy utf8only
1669 1700 property was left unspecified, the
1670 1701 .Sy utf8only
1671 1702 property is automatically set to
1672 1703 .Sy on .
1673 1704 The default value of the
1674 1705 .Sy normalization
1675 1706 property is
1676 1707 .Sy none .
1677 1708 This property cannot be changed after the file system is created.
1678 1709 .It Sy utf8only Ns = Ns Sy on Ns | Ns Sy off
1679 1710 Indicates whether the file system should reject file names that include
1680 1711 characters that are not present in the
1681 1712 .Sy UTF-8
1682 1713 character code set.
1683 1714 If this property is explicitly set to
1684 1715 .Sy off ,
1685 1716 the normalization property must either not be explicitly set or be set to
1686 1717 .Sy none .
1687 1718 The default value for the
1688 1719 .Sy utf8only
1689 1720 property is
1690 1721 .Sy off .
1691 1722 This property cannot be changed after the file system is created.
1692 1723 .El
1693 1724 .Pp
1694 1725 The
1695 1726 .Sy casesensitivity ,
1696 1727 .Sy normalization ,
1697 1728 and
1698 1729 .Sy utf8only
1699 1730 properties are also new permissions that can be assigned to non-privileged users
1700 1731 by using the ZFS delegated administration feature.
1701 1732 .Ss "Temporary Mount Point Properties"
1702 1733 When a file system is mounted, either through
1703 1734 .Xr mount 1M
1704 1735 for legacy mounts or the
1705 1736 .Nm zfs Cm mount
1706 1737 command for normal file systems, its mount options are set according to its
1707 1738 properties.
1708 1739 The correlation between properties and mount options is as follows:
1709 1740 .Bd -literal
1710 1741 PROPERTY MOUNT OPTION
1711 1742 devices devices/nodevices
1712 1743 exec exec/noexec
1713 1744 readonly ro/rw
1714 1745 setuid setuid/nosetuid
1715 1746 xattr xattr/noxattr
1716 1747 .Ed
1717 1748 .Pp
1718 1749 In addition, these options can be set on a per-mount basis using the
1719 1750 .Fl o
1720 1751 option, without affecting the property that is stored on disk.
1721 1752 The values specified on the command line override the values stored in the
1722 1753 dataset.
1723 1754 The
1724 1755 .Sy nosuid
1725 1756 option is an alias for
1726 1757 .Sy nodevices Ns \&, Ns Sy nosetuid .
1727 1758 These properties are reported as
1728 1759 .Qq temporary
1729 1760 by the
1730 1761 .Nm zfs Cm get
1731 1762 command.
1732 1763 If the properties are changed while the dataset is mounted, the new setting
1733 1764 overrides any temporary settings.
1734 1765 .Ss "User Properties"
1735 1766 In addition to the standard native properties, ZFS supports arbitrary user
1736 1767 properties.
1737 1768 User properties have no effect on ZFS behavior, but applications or
1738 1769 administrators can use them to annotate datasets
1739 1770 .Pq file systems, volumes, and snapshots .
1740 1771 .Pp
1741 1772 User property names must contain a colon
1742 1773 .Pq Qq Sy \&:
1743 1774 character to distinguish them from native properties.
1744 1775 They may contain lowercase letters, numbers, and the following punctuation
1745 1776 characters: colon
1746 1777 .Pq Qq Sy \&: ,
1747 1778 dash
1748 1779 .Pq Qq Sy - ,
1749 1780 period
1750 1781 .Pq Qq Sy \&. ,
1751 1782 and underscore
1752 1783 .Pq Qq Sy _ .
1753 1784 The expected convention is that the property name is divided into two portions
1754 1785 such as
1755 1786 .Em module Ns \&: Ns Em property ,
1756 1787 but this namespace is not enforced by ZFS.
1757 1788 User property names can be at most 256 characters, and cannot begin with a dash
1758 1789 .Pq Qq Sy - .
1759 1790 .Pp
1760 1791 When making programmatic use of user properties, it is strongly suggested to use
1761 1792 a reversed
1762 1793 .Sy DNS
1763 1794 domain name for the
1764 1795 .Em module
1765 1796 component of property names to reduce the chance that two
1766 1797 independently-developed packages use the same property name for different
1767 1798 purposes.
1768 1799 .Pp
1769 1800 The values of user properties are arbitrary strings, are always inherited, and
1770 1801 are never validated.
1771 1802 All of the commands that operate on properties
1772 1803 .Po Nm zfs Cm list ,
1773 1804 .Nm zfs Cm get ,
1774 1805 .Nm zfs Cm set ,
1775 1806 and so forth
1776 1807 .Pc
1777 1808 can be used to manipulate both native properties and user properties.
1778 1809 Use the
1779 1810 .Nm zfs Cm inherit
1780 1811 command to clear a user property.
1781 1812 If the property is not defined in any parent dataset, it is removed entirely.
1782 1813 Property values are limited to 8192 bytes.
1783 1814 .Ss ZFS Volumes as Swap or Dump Devices
1784 1815 During an initial installation a swap device and dump device are created on ZFS
1785 1816 volumes in the ZFS root pool.
1786 1817 By default, the swap area size is based on 1/2 the size of physical memory up to
1787 1818 2 Gbytes.
1788 1819 The size of the dump device depends on the kernel's requirements at installation
1789 1820 time.
1790 1821 Separate ZFS volumes must be used for the swap area and dump devices.
1791 1822 Do not swap to a file on a ZFS file system.
1792 1823 A ZFS swap file configuration is not supported.
1793 1824 .Pp
1794 1825 If you need to change your swap area or dump device after the system is
1795 1826 installed or upgraded, use the
1796 1827 .Xr swap 1M
1797 1828 and
1798 1829 .Xr dumpadm 1M
1799 1830 commands.
1800 1831 .Sh SUBCOMMANDS
1801 1832 All subcommands that modify state are logged persistently to the pool in their
1802 1833 original form.
1803 1834 .Bl -tag -width ""
1804 1835 .It Nm Fl \?
1805 1836 Displays a help message.
1806 1837 .It Xo
1807 1838 .Nm
1808 1839 .Cm create
1809 1840 .Op Fl p
1810 1841 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1811 1842 .Ar filesystem
1812 1843 .Xc
1813 1844 Creates a new ZFS file system.
1814 1845 The file system is automatically mounted according to the
1815 1846 .Sy mountpoint
1816 1847 property inherited from the parent.
1817 1848 .Bl -tag -width "-o"
1818 1849 .It Fl o Ar property Ns = Ns Ar value
1819 1850 Sets the specified property as if the command
1820 1851 .Nm zfs Cm set Ar property Ns = Ns Ar value
1821 1852 was invoked at the same time the dataset was created.
1822 1853 Any editable ZFS property can also be set at creation time.
1823 1854 Multiple
1824 1855 .Fl o
1825 1856 options can be specified.
1826 1857 An error results if the same property is specified in multiple
1827 1858 .Fl o
1828 1859 options.
1829 1860 .It Fl p
1830 1861 Creates all the non-existing parent datasets.
1831 1862 Datasets created in this manner are automatically mounted according to the
1832 1863 .Sy mountpoint
1833 1864 property inherited from their parent.
1834 1865 Any property specified on the command line using the
1835 1866 .Fl o
1836 1867 option is ignored.
1837 1868 If the target filesystem already exists, the operation completes successfully.
1838 1869 .El
1839 1870 .It Xo
1840 1871 .Nm
1841 1872 .Cm create
1842 1873 .Op Fl ps
1843 1874 .Op Fl b Ar blocksize
1844 1875 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1845 1876 .Fl V Ar size Ar volume
1846 1877 .Xc
1847 1878 Creates a volume of the given size.
1848 1879 The volume is exported as a block device in
1849 1880 .Pa /dev/zvol/{dsk,rdsk}/path ,
1850 1881 where
1851 1882 .Em path
1852 1883 is the name of the volume in the ZFS namespace.
1853 1884 The size represents the logical size as exported by the device.
1854 1885 By default, a reservation of equal size is created.
1855 1886 .Pp
1856 1887 .Ar size
1857 1888 is automatically rounded up to the nearest 128 Kbytes to ensure that the volume
1858 1889 has an integral number of blocks regardless of
1859 1890 .Sy blocksize .
1860 1891 .Bl -tag -width "-b"
1861 1892 .It Fl b Ar blocksize
1862 1893 Equivalent to
1863 1894 .Fl o Sy volblocksize Ns = Ns Ar blocksize .
1864 1895 If this option is specified in conjunction with
1865 1896 .Fl o Sy volblocksize ,
1866 1897 the resulting behavior is undefined.
1867 1898 .It Fl o Ar property Ns = Ns Ar value
1868 1899 Sets the specified property as if the
1869 1900 .Nm zfs Cm set Ar property Ns = Ns Ar value
1870 1901 command was invoked at the same time the dataset was created.
1871 1902 Any editable ZFS property can also be set at creation time.
1872 1903 Multiple
1873 1904 .Fl o
1874 1905 options can be specified.
1875 1906 An error results if the same property is specified in multiple
1876 1907 .Fl o
1877 1908 options.
1878 1909 .It Fl p
1879 1910 Creates all the non-existing parent datasets.
1880 1911 Datasets created in this manner are automatically mounted according to the
1881 1912 .Sy mountpoint
1882 1913 property inherited from their parent.
1883 1914 Any property specified on the command line using the
1884 1915 .Fl o
1885 1916 option is ignored.
1886 1917 If the target filesystem already exists, the operation completes successfully.
1887 1918 .It Fl s
1888 1919 Creates a sparse volume with no reservation.
1889 1920 See
1890 1921 .Sy volsize
1891 1922 in the
1892 1923 .Sx Native Properties
1893 1924 section for more information about sparse volumes.
1894 1925 .El
1895 1926 .It Xo
1896 1927 .Nm
1897 1928 .Cm destroy
1898 1929 .Op Fl Rfnprv
1899 1930 .Ar filesystem Ns | Ns Ar volume
1900 1931 .Xc
1901 1932 Destroys the given dataset.
1902 1933 By default, the command unshares any file systems that are currently shared,
1903 1934 unmounts any file systems that are currently mounted, and refuses to destroy a
1904 1935 dataset that has active dependents
1905 1936 .Pq children or clones .
1906 1937 .Bl -tag -width "-R"
1907 1938 .It Fl R
1908 1939 Recursively destroy all dependents, including cloned file systems outside the
1909 1940 target hierarchy.
1910 1941 .It Fl f
1911 1942 Force an unmount of any file systems using the
1912 1943 .Nm unmount Fl f
1913 1944 command.
1914 1945 This option has no effect on non-file systems or unmounted file systems.
1915 1946 .It Fl n
1916 1947 Do a dry-run
1917 1948 .Pq Qq No-op
1918 1949 deletion.
1919 1950 No data will be deleted.
1920 1951 This is useful in conjunction with the
1921 1952 .Fl v
1922 1953 or
1923 1954 .Fl p
1924 1955 flags to determine what data would be deleted.
1925 1956 .It Fl p
1926 1957 Print machine-parsable verbose information about the deleted data.
1927 1958 .It Fl r
1928 1959 Recursively destroy all children.
1929 1960 .It Fl v
1930 1961 Print verbose information about the deleted data.
1931 1962 .El
1932 1963 .Pp
1933 1964 Extreme care should be taken when applying either the
1934 1965 .Fl r
1935 1966 or the
1936 1967 .Fl R
1937 1968 options, as they can destroy large portions of a pool and cause unexpected
1938 1969 behavior for mounted file systems in use.
1939 1970 .It Xo
1940 1971 .Nm
1941 1972 .Cm destroy
1942 1973 .Op Fl Rdnprv
1943 1974 .Ar filesystem Ns | Ns Ar volume Ns @ Ns Ar snap Ns
1944 1975 .Oo % Ns Ar snap Ns Oo , Ns Ar snap Ns Oo % Ns Ar snap Oc Oc Oc Ns ...
1945 1976 .Xc
1946 1977 The given snapshots are destroyed immediately if and only if the
1947 1978 .Nm zfs Cm destroy
1948 1979 command without the
1949 1980 .Fl d
1950 1981 option would have destroyed it.
1951 1982 Such immediate destruction would occur, for example, if the snapshot had no
1952 1983 clones and the user-initiated reference count were zero.
1953 1984 .Pp
1954 1985 If a snapshot does not qualify for immediate destruction, it is marked for
1955 1986 deferred deletion.
1956 1987 In this state, it exists as a usable, visible snapshot until both of the
1957 1988 preconditions listed above are met, at which point it is destroyed.
1958 1989 .Pp
1959 1990 An inclusive range of snapshots may be specified by separating the first and
1960 1991 last snapshots with a percent sign.
1961 1992 The first and/or last snapshots may be left blank, in which case the
1962 1993 filesystem's oldest or newest snapshot will be implied.
1963 1994 .Pp
1964 1995 Multiple snapshots
1965 1996 .Pq or ranges of snapshots
1966 1997 of the same filesystem or volume may be specified in a comma-separated list of
1967 1998 snapshots.
1968 1999 Only the snapshot's short name
1969 2000 .Po the part after the
1970 2001 .Sy @
1971 2002 .Pc
1972 2003 should be specified when using a range or comma-separated list to identify
1973 2004 multiple snapshots.
1974 2005 .Bl -tag -width "-R"
1975 2006 .It Fl R
1976 2007 Recursively destroy all clones of these snapshots, including the clones,
1977 2008 snapshots, and children.
1978 2009 If this flag is specified, the
1979 2010 .Fl d
1980 2011 flag will have no effect.
1981 2012 .It Fl d
1982 2013 Defer snapshot deletion.
1983 2014 .It Fl n
1984 2015 Do a dry-run
1985 2016 .Pq Qq No-op
1986 2017 deletion.
1987 2018 No data will be deleted.
1988 2019 This is useful in conjunction with the
1989 2020 .Fl p
1990 2021 or
1991 2022 .Fl v
1992 2023 flags to determine what data would be deleted.
1993 2024 .It Fl p
1994 2025 Print machine-parsable verbose information about the deleted data.
1995 2026 .It Fl r
1996 2027 Destroy
1997 2028 .Pq or mark for deferred deletion
1998 2029 all snapshots with this name in descendent file systems.
1999 2030 .It Fl v
2000 2031 Print verbose information about the deleted data.
2001 2032 .Pp
2002 2033 Extreme care should be taken when applying either the
2003 2034 .Fl r
2004 2035 or the
2005 2036 .Fl R
2006 2037 options, as they can destroy large portions of a pool and cause unexpected
2007 2038 behavior for mounted file systems in use.
2008 2039 .El
2009 2040 .It Xo
2010 2041 .Nm
2011 2042 .Cm destroy
2012 2043 .Ar filesystem Ns | Ns Ar volume Ns # Ns Ar bookmark
2013 2044 .Xc
2014 2045 The given bookmark is destroyed.
2015 2046 .It Xo
2016 2047 .Nm
2017 2048 .Cm snapshot
2018 2049 .Op Fl r
2019 2050 .Oo Fl o Ar property Ns = Ns value Oc Ns ...
2020 2051 .Ar filesystem Ns @ Ns Ar snapname Ns | Ns Ar volume Ns @ Ns Ar snapname Ns ...
2021 2052 .Xc
2022 2053 Creates snapshots with the given names.
2023 2054 All previous modifications by successful system calls to the file system are
2024 2055 part of the snapshots.
2025 2056 Snapshots are taken atomically, so that all snapshots correspond to the same
2026 2057 moment in time.
2027 2058 See the
2028 2059 .Sx Snapshots
2029 2060 section for details.
2030 2061 .Bl -tag -width "-o"
2031 2062 .It Fl o Ar property Ns = Ns Ar value
2032 2063 Sets the specified property; see
2033 2064 .Nm zfs Cm create
2034 2065 for details.
2035 2066 .It Fl r
2036 2067 Recursively create snapshots of all descendent datasets
2037 2068 .El
2038 2069 .It Xo
2039 2070 .Nm
2040 2071 .Cm rollback
2041 2072 .Op Fl Rfr
2042 2073 .Ar snapshot
2043 2074 .Xc
2044 2075 Roll back the given dataset to a previous snapshot.
2045 2076 When a dataset is rolled back, all data that has changed since the snapshot is
2046 2077 discarded, and the dataset reverts to the state at the time of the snapshot.
2047 2078 By default, the command refuses to roll back to a snapshot other than the most
2048 2079 recent one.
2049 2080 In order to do so, all intermediate snapshots and bookmarks must be destroyed by
2050 2081 specifying the
2051 2082 .Fl r
2052 2083 option.
2053 2084 .Pp
2054 2085 The
2055 2086 .Fl rR
2056 2087 options do not recursively destroy the child snapshots of a recursive snapshot.
2057 2088 Only direct snapshots of the specified filesystem are destroyed by either of
2058 2089 these options.
2059 2090 To completely roll back a recursive snapshot, you must rollback the individual
2060 2091 child snapshots.
2061 2092 .Bl -tag -width "-R"
2062 2093 .It Fl R
2063 2094 Destroy any more recent snapshots and bookmarks, as well as any clones of those
2064 2095 snapshots.
2065 2096 .It Fl f
2066 2097 Used with the
2067 2098 .Fl R
2068 2099 option to force an unmount of any clone file systems that are to be destroyed.
2069 2100 .It Fl r
2070 2101 Destroy any snapshots and bookmarks more recent than the one specified.
2071 2102 .El
2072 2103 .It Xo
2073 2104 .Nm
2074 2105 .Cm clone
2075 2106 .Op Fl p
2076 2107 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
2077 2108 .Ar snapshot Ar filesystem Ns | Ns Ar volume
2078 2109 .Xc
2079 2110 Creates a clone of the given snapshot.
2080 2111 See the
2081 2112 .Sx Clones
2082 2113 section for details.
2083 2114 The target dataset can be located anywhere in the ZFS hierarchy, and is created
2084 2115 as the same type as the original.
2085 2116 .Bl -tag -width "-o"
2086 2117 .It Fl o Ar property Ns = Ns Ar value
2087 2118 Sets the specified property; see
2088 2119 .Nm zfs Cm create
2089 2120 for details.
2090 2121 .It Fl p
2091 2122 Creates all the non-existing parent datasets.
2092 2123 Datasets created in this manner are automatically mounted according to the
2093 2124 .Sy mountpoint
2094 2125 property inherited from their parent.
2095 2126 If the target filesystem or volume already exists, the operation completes
2096 2127 successfully.
2097 2128 .El
2098 2129 .It Xo
2099 2130 .Nm
2100 2131 .Cm promote
2101 2132 .Ar clone-filesystem
2102 2133 .Xc
2103 2134 Promotes a clone file system to no longer be dependent on its
2104 2135 .Qq origin
2105 2136 snapshot.
2106 2137 This makes it possible to destroy the file system that the clone was created
2107 2138 from.
2108 2139 The clone parent-child dependency relationship is reversed, so that the origin
2109 2140 file system becomes a clone of the specified file system.
2110 2141 .Pp
2111 2142 The snapshot that was cloned, and any snapshots previous to this snapshot, are
2112 2143 now owned by the promoted clone.
2113 2144 The space they use moves from the origin file system to the promoted clone, so
2114 2145 enough space must be available to accommodate these snapshots.
2115 2146 No new space is consumed by this operation, but the space accounting is
2116 2147 adjusted.
2117 2148 The promoted clone must not have any conflicting snapshot names of its own.
2118 2149 The
2119 2150 .Cm rename
2120 2151 subcommand can be used to rename any conflicting snapshots.
2121 2152 .It Xo
2122 2153 .Nm
2123 2154 .Cm rename
2124 2155 .Op Fl f
2125 2156 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
2126 2157 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
2127 2158 .Xc
2128 2159 .It Xo
2129 2160 .Nm
2130 2161 .Cm rename
2131 2162 .Op Fl fp
2132 2163 .Ar filesystem Ns | Ns Ar volume
2133 2164 .Ar filesystem Ns | Ns Ar volume
2134 2165 .Xc
2135 2166 Renames the given dataset.
2136 2167 The new target can be located anywhere in the ZFS hierarchy, with the exception
2137 2168 of snapshots.
2138 2169 Snapshots can only be renamed within the parent file system or volume.
2139 2170 When renaming a snapshot, the parent file system of the snapshot does not need
2140 2171 to be specified as part of the second argument.
2141 2172 Renamed file systems can inherit new mount points, in which case they are
2142 2173 unmounted and remounted at the new mount point.
2143 2174 .Bl -tag -width "-a"
2144 2175 .It Fl f
2145 2176 Force unmount any filesystems that need to be unmounted in the process.
2146 2177 .It Fl p
2147 2178 Creates all the nonexistent parent datasets.
2148 2179 Datasets created in this manner are automatically mounted according to the
2149 2180 .Sy mountpoint
2150 2181 property inherited from their parent.
2151 2182 .El
2152 2183 .It Xo
2153 2184 .Nm
2154 2185 .Cm rename
2155 2186 .Fl r
2156 2187 .Ar snapshot Ar snapshot
2157 2188 .Xc
2158 2189 Recursively rename the snapshots of all descendent datasets.
2159 2190 Snapshots are the only dataset that can be renamed recursively.
2160 2191 .It Xo
2161 2192 .Nm
2162 2193 .Cm list
2163 2194 .Op Fl r Ns | Ns Fl d Ar depth
2164 2195 .Op Fl Hp
2165 2196 .Oo Fl o Ar property Ns Oo , Ns Ar property Oc Ns ... Oc
2166 2197 .Oo Fl s Ar property Oc Ns ...
2167 2198 .Oo Fl S Ar property Oc Ns ...
2168 2199 .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
2169 2200 .Oo Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Oc Ns ...
2170 2201 .Xc
2171 2202 Lists the property information for the given datasets in tabular form.
2172 2203 If specified, you can list property information by the absolute pathname or the
2173 2204 relative pathname.
2174 2205 By default, all file systems and volumes are displayed.
2175 2206 Snapshots are displayed if the
2176 2207 .Sy listsnaps
2177 2208 property is
2178 2209 .Sy on
2179 2210 .Po the default is
2180 2211 .Sy off
2181 2212 .Pc .
2182 2213 The following fields are displayed,
2183 2214 .Sy name Ns \&, Ns Sy used Ns \&, Ns Sy available Ns \&, Ns Sy referenced Ns \&, Ns
2184 2215 .Sy mountpoint .
2185 2216 .Bl -tag -width "-H"
2186 2217 .It Fl H
2187 2218 Used for scripting mode.
2188 2219 Do not print headers and separate fields by a single tab instead of arbitrary
2189 2220 white space.
2190 2221 .It Fl S Ar property
2191 2222 Same as the
2192 2223 .Fl s
2193 2224 option, but sorts by property in descending order.
2194 2225 .It Fl d Ar depth
2195 2226 Recursively display any children of the dataset, limiting the recursion to
2196 2227 .Ar depth .
2197 2228 A
2198 2229 .Ar depth
2199 2230 of
2200 2231 .Sy 1
2201 2232 will display only the dataset and its direct children.
2202 2233 .It Fl o Ar property
2203 2234 A comma-separated list of properties to display.
2204 2235 The property must be:
2205 2236 .Bl -bullet
2206 2237 .It
2207 2238 One of the properties described in the
2208 2239 .Sx Native Properties
2209 2240 section
2210 2241 .It
2211 2242 A user property
2212 2243 .It
2213 2244 The value
2214 2245 .Sy name
2215 2246 to display the dataset name
2216 2247 .It
2217 2248 The value
2218 2249 .Sy space
2219 2250 to display space usage properties on file systems and volumes.
2220 2251 This is a shortcut for specifying
2221 2252 .Fl o Sy name Ns \&, Ns Sy avail Ns \&, Ns Sy used Ns \&, Ns Sy usedsnap Ns \&, Ns
2222 2253 .Sy usedds Ns \&, Ns Sy usedrefreserv Ns \&, Ns Sy usedchild Fl t
2223 2254 .Sy filesystem Ns \&, Ns Sy volume
2224 2255 syntax.
2225 2256 .El
2226 2257 .It Fl p
2227 2258 Display numbers in parsable
2228 2259 .Pq exact
2229 2260 values.
2230 2261 .It Fl r
2231 2262 Recursively display any children of the dataset on the command line.
2232 2263 .It Fl s Ar property
2233 2264 A property for sorting the output by column in ascending order based on the
2234 2265 value of the property.
2235 2266 The property must be one of the properties described in the
2236 2267 .Sx Properties
2237 2268 section, or the special value
2238 2269 .Sy name
2239 2270 to sort by the dataset name.
2240 2271 Multiple properties can be specified at one time using multiple
2241 2272 .Fl s
2242 2273 property options.
2243 2274 Multiple
2244 2275 .Fl s
2245 2276 options are evaluated from left to right in decreasing order of importance.
2246 2277 The following is a list of sorting criteria:
2247 2278 .Bl -bullet
2248 2279 .It
2249 2280 Numeric types sort in numeric order.
2250 2281 .It
2251 2282 String types sort in alphabetical order.
2252 2283 .It
2253 2284 Types inappropriate for a row sort that row to the literal bottom, regardless of
2254 2285 the specified ordering.
2255 2286 .El
2256 2287 .Pp
2257 2288 If no sorting options are specified the existing behavior of
2258 2289 .Nm zfs Cm list
2259 2290 is preserved.
2260 2291 .It Fl t Ar type
2261 2292 A comma-separated list of types to display, where
2262 2293 .Ar type
2263 2294 is one of
2264 2295 .Sy filesystem ,
2265 2296 .Sy snapshot ,
2266 2297 .Sy volume ,
2267 2298 .Sy bookmark ,
2268 2299 or
2269 2300 .Sy all .
2270 2301 For example, specifying
2271 2302 .Fl t Sy snapshot
2272 2303 displays only snapshots.
2273 2304 .El
2274 2305 .It Xo
2275 2306 .Nm
2276 2307 .Cm set
2277 2308 .Ar property Ns = Ns Ar value Oo Ar property Ns = Ns Ar value Oc Ns ...
2278 2309 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
2279 2310 .Xc
2280 2311 Sets the property or list of properties to the given value(s) for each dataset.
2281 2312 Only some properties can be edited.
2282 2313 See the
2283 2314 .Sx Properties
2284 2315 section for more information on what properties can be set and acceptable
2285 2316 values.
2286 2317 Numeric values can be specified as exact values, or in a human-readable form
2287 2318 with a suffix of
2288 2319 .Sy B , K , M , G , T , P , E , Z
2289 2320 .Po for bytes, kilobytes, megabytes, gigabytes, terabytes, petabytes, exabytes,
2290 2321 or zettabytes, respectively
2291 2322 .Pc .
2292 2323 User properties can be set on snapshots.
2293 2324 For more information, see the
2294 2325 .Sx User Properties
2295 2326 section.
2296 2327 .It Xo
2297 2328 .Nm
2298 2329 .Cm get
2299 2330 .Op Fl r Ns | Ns Fl d Ar depth
2300 2331 .Op Fl Hp
2301 2332 .Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
2302 2333 .Oo Fl s Ar source Ns Oo , Ns Ar source Oc Ns ... Oc
2303 2334 .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
2304 2335 .Cm all | Ar property Ns Oo , Ns Ar property Oc Ns ...
2305 2336 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns | Ns Ar bookmark Ns ...
2306 2337 .Xc
2307 2338 Displays properties for the given datasets.
2308 2339 If no datasets are specified, then the command displays properties for all
2309 2340 datasets on the system.
2310 2341 For each property, the following columns are displayed:
2311 2342 .Bd -literal
2312 2343 name Dataset name
2313 2344 property Property name
2314 2345 value Property value
2315 2346 source Property source. Can either be local, default,
2316 2347 temporary, inherited, or none (-).
2317 2348 .Ed
2318 2349 .Pp
2319 2350 All columns are displayed by default, though this can be controlled by using the
2320 2351 .Fl o
2321 2352 option.
2322 2353 This command takes a comma-separated list of properties as described in the
2323 2354 .Sx Native Properties
2324 2355 and
2325 2356 .Sx User Properties
2326 2357 sections.
2327 2358 .Pp
2328 2359 The special value
2329 2360 .Sy all
2330 2361 can be used to display all properties that apply to the given dataset's type
2331 2362 .Pq filesystem, volume, snapshot, or bookmark .
2332 2363 .Bl -tag -width "-H"
2333 2364 .It Fl H
2334 2365 Display output in a form more easily parsed by scripts.
2335 2366 Any headers are omitted, and fields are explicitly separated by a single tab
2336 2367 instead of an arbitrary amount of space.
2337 2368 .It Fl d Ar depth
2338 2369 Recursively display any children of the dataset, limiting the recursion to
2339 2370 .Ar depth .
2340 2371 A depth of
2341 2372 .Sy 1
2342 2373 will display only the dataset and its direct children.
2343 2374 .It Fl o Ar field
2344 2375 A comma-separated list of columns to display.
2345 2376 .Sy name Ns \&, Ns Sy property Ns \&, Ns Sy value Ns \&, Ns Sy source
2346 2377 is the default value.
2347 2378 .It Fl p
2348 2379 Display numbers in parsable
2349 2380 .Pq exact
2350 2381 values.
2351 2382 .It Fl r
2352 2383 Recursively display properties for any children.
2353 2384 .It Fl s Ar source
2354 2385 A comma-separated list of sources to display.
2355 2386 Those properties coming from a source other than those in this list are ignored.
2356 2387 Each source must be one of the following:
2357 2388 .Sy local ,
2358 2389 .Sy default ,
2359 2390 .Sy inherited ,
2360 2391 .Sy temporary ,
2361 2392 and
2362 2393 .Sy none .
2363 2394 The default value is all sources.
2364 2395 .It Fl t Ar type
2365 2396 A comma-separated list of types to display, where
2366 2397 .Ar type
2367 2398 is one of
2368 2399 .Sy filesystem ,
2369 2400 .Sy snapshot ,
2370 2401 .Sy volume ,
2371 2402 .Sy bookmark ,
2372 2403 or
2373 2404 .Sy all .
2374 2405 .El
2375 2406 .It Xo
2376 2407 .Nm
2377 2408 .Cm inherit
2378 2409 .Op Fl rS
2379 2410 .Ar property Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
2380 2411 .Xc
2381 2412 Clears the specified property, causing it to be inherited from an ancestor,
2382 2413 restored to default if no ancestor has the property set, or with the
2383 2414 .Fl S
2384 2415 option reverted to the received value if one exists.
2385 2416 See the
2386 2417 .Sx Properties
2387 2418 section for a listing of default values, and details on which properties can be
2388 2419 inherited.
2389 2420 .Bl -tag -width "-r"
2390 2421 .It Fl r
2391 2422 Recursively inherit the given property for all children.
2392 2423 .It Fl S
2393 2424 Revert the property to the received value if one exists; otherwise operate as
2394 2425 if the
2395 2426 .Fl S
2396 2427 option was not specified.
2397 2428 .El
2398 2429 .It Xo
2399 2430 .Nm
2400 2431 .Cm remap
2401 2432 .Ar filesystem Ns | Ns Ar volume
2402 2433 .Xc
2403 2434 Remap the indirect blocks in the given fileystem or volume so that they no
2404 2435 longer reference blocks on previously removed vdevs and we can eventually
2405 2436 shrink the size of the indirect mapping objects for the previously removed
2406 2437 vdevs. Note that remapping all blocks might not be possible and that
2407 2438 references from snapshots will still exist and cannot be remapped.
2408 2439 .It Xo
2409 2440 .Nm
2410 2441 .Cm upgrade
2411 2442 .Xc
2412 2443 Displays a list of file systems that are not the most recent version.
2413 2444 .It Xo
2414 2445 .Nm
2415 2446 .Cm upgrade
2416 2447 .Fl v
2417 2448 .Xc
2418 2449 Displays a list of currently supported file system versions.
2419 2450 .It Xo
2420 2451 .Nm
2421 2452 .Cm upgrade
2422 2453 .Op Fl r
2423 2454 .Op Fl V Ar version
2424 2455 .Fl a | Ar filesystem
2425 2456 .Xc
2426 2457 Upgrades file systems to a new on-disk version.
2427 2458 Once this is done, the file systems will no longer be accessible on systems
2428 2459 running older versions of the software.
2429 2460 .Nm zfs Cm send
2430 2461 streams generated from new snapshots of these file systems cannot be accessed on
2431 2462 systems running older versions of the software.
2432 2463 .Pp
2433 2464 In general, the file system version is independent of the pool version.
2434 2465 See
2435 2466 .Xr zpool 1M
2436 2467 for information on the
2437 2468 .Nm zpool Cm upgrade
2438 2469 command.
2439 2470 .Pp
2440 2471 In some cases, the file system version and the pool version are interrelated and
2441 2472 the pool version must be upgraded before the file system version can be
2442 2473 upgraded.
2443 2474 .Bl -tag -width "-V"
2444 2475 .It Fl V Ar version
2445 2476 Upgrade to the specified
2446 2477 .Ar version .
2447 2478 If the
2448 2479 .Fl V
2449 2480 flag is not specified, this command upgrades to the most recent version.
2450 2481 This
2451 2482 option can only be used to increase the version number, and only up to the most
2452 2483 recent version supported by this software.
2453 2484 .It Fl a
2454 2485 Upgrade all file systems on all imported pools.
2455 2486 .It Ar filesystem
2456 2487 Upgrade the specified file system.
2457 2488 .It Fl r
2458 2489 Upgrade the specified file system and all descendent file systems.
2459 2490 .El
2460 2491 .It Xo
2461 2492 .Nm
2462 2493 .Cm userspace
2463 2494 .Op Fl Hinp
2464 2495 .Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
2465 2496 .Oo Fl s Ar field Oc Ns ...
2466 2497 .Oo Fl S Ar field Oc Ns ...
2467 2498 .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
2468 2499 .Ar filesystem Ns | Ns Ar snapshot
2469 2500 .Xc
2470 2501 Displays space consumed by, and quotas on, each user in the specified filesystem
2471 2502 or snapshot.
2472 2503 This corresponds to the
2473 2504 .Sy userused@ Ns Em user
2474 2505 and
2475 2506 .Sy userquota@ Ns Em user
2476 2507 properties.
2477 2508 .Bl -tag -width "-H"
2478 2509 .It Fl H
2479 2510 Do not print headers, use tab-delimited output.
2480 2511 .It Fl S Ar field
2481 2512 Sort by this field in reverse order.
2482 2513 See
2483 2514 .Fl s .
2484 2515 .It Fl i
2485 2516 Translate SID to POSIX ID.
2486 2517 The POSIX ID may be ephemeral if no mapping exists.
2487 2518 Normal POSIX interfaces
2488 2519 .Po for example,
2489 2520 .Xr stat 2 ,
2490 2521 .Nm ls Fl l
2491 2522 .Pc
2492 2523 perform this translation, so the
2493 2524 .Fl i
2494 2525 option allows the output from
2495 2526 .Nm zfs Cm userspace
2496 2527 to be compared directly with those utilities.
2497 2528 However,
2498 2529 .Fl i
2499 2530 may lead to confusion if some files were created by an SMB user before a
2500 2531 SMB-to-POSIX name mapping was established.
2501 2532 In such a case, some files will be owned by the SMB entity and some by the POSIX
2502 2533 entity.
2503 2534 However, the
2504 2535 .Fl i
2505 2536 option will report that the POSIX entity has the total usage and quota for both.
2506 2537 .It Fl n
2507 2538 Print numeric ID instead of user/group name.
2508 2539 .It Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
2509 2540 Display only the specified fields from the following set:
2510 2541 .Sy type ,
2511 2542 .Sy name ,
2512 2543 .Sy used ,
2513 2544 .Sy quota .
2514 2545 The default is to display all fields.
2515 2546 .It Fl p
2516 2547 Use exact
2517 2548 .Pq parsable
2518 2549 numeric output.
2519 2550 .It Fl s Ar field
2520 2551 Sort output by this field.
2521 2552 The
2522 2553 .Fl s
2523 2554 and
2524 2555 .Fl S
2525 2556 flags may be specified multiple times to sort first by one field, then by
2526 2557 another.
2527 2558 The default is
2528 2559 .Fl s Sy type Fl s Sy name .
2529 2560 .It Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
2530 2561 Print only the specified types from the following set:
2531 2562 .Sy all ,
2532 2563 .Sy posixuser ,
2533 2564 .Sy smbuser ,
2534 2565 .Sy posixgroup ,
2535 2566 .Sy smbgroup .
2536 2567 The default is
2537 2568 .Fl t Sy posixuser Ns \&, Ns Sy smbuser .
2538 2569 The default can be changed to include group types.
2539 2570 .El
2540 2571 .It Xo
2541 2572 .Nm
2542 2573 .Cm groupspace
2543 2574 .Op Fl Hinp
2544 2575 .Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
2545 2576 .Oo Fl s Ar field Oc Ns ...
2546 2577 .Oo Fl S Ar field Oc Ns ...
2547 2578 .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
2548 2579 .Ar filesystem Ns | Ns Ar snapshot
2549 2580 .Xc
2550 2581 Displays space consumed by, and quotas on, each group in the specified
2551 2582 filesystem or snapshot.
2552 2583 This subcommand is identical to
2553 2584 .Nm zfs Cm userspace ,
2554 2585 except that the default types to display are
2555 2586 .Fl t Sy posixgroup Ns \&, Ns Sy smbgroup .
2556 2587 .It Xo
2557 2588 .Nm
2558 2589 .Cm mount
2559 2590 .Xc
2560 2591 Displays all ZFS file systems currently mounted.
2561 2592 .It Xo
2562 2593 .Nm
2563 2594 .Cm mount
2564 2595 .Op Fl Ov
2565 2596 .Op Fl o Ar options
2566 2597 .Fl a | Ar filesystem
2567 2598 .Xc
2568 2599 Mounts ZFS file systems.
2569 2600 .Bl -tag -width "-O"
2570 2601 .It Fl O
2571 2602 Perform an overlay mount.
2572 2603 See
2573 2604 .Xr mount 1M
2574 2605 for more information.
2575 2606 .It Fl a
2576 2607 Mount all available ZFS file systems.
2577 2608 Invoked automatically as part of the boot process.
2578 2609 .It Ar filesystem
2579 2610 Mount the specified filesystem.
2580 2611 .It Fl o Ar options
2581 2612 An optional, comma-separated list of mount options to use temporarily for the
2582 2613 duration of the mount.
2583 2614 See the
2584 2615 .Sx Temporary Mount Point Properties
2585 2616 section for details.
2586 2617 .It Fl v
2587 2618 Report mount progress.
2588 2619 .El
2589 2620 .It Xo
2590 2621 .Nm
2591 2622 .Cm unmount
2592 2623 .Op Fl f
2593 2624 .Fl a | Ar filesystem Ns | Ns Ar mountpoint
2594 2625 .Xc
2595 2626 Unmounts currently mounted ZFS file systems.
2596 2627 .Bl -tag -width "-a"
2597 2628 .It Fl a
2598 2629 Unmount all available ZFS file systems.
2599 2630 Invoked automatically as part of the shutdown process.
2600 2631 .It Ar filesystem Ns | Ns Ar mountpoint
2601 2632 Unmount the specified filesystem.
2602 2633 The command can also be given a path to a ZFS file system mount point on the
2603 2634 system.
2604 2635 .It Fl f
2605 2636 Forcefully unmount the file system, even if it is currently in use.
2606 2637 .El
2607 2638 .It Xo
2608 2639 .Nm
2609 2640 .Cm share
2610 2641 .Fl a | Ar filesystem
2611 2642 .Xc
2612 2643 Shares available ZFS file systems.
2613 2644 .Bl -tag -width "-a"
2614 2645 .It Fl a
2615 2646 Share all available ZFS file systems.
2616 2647 Invoked automatically as part of the boot process.
2617 2648 .It Ar filesystem
2618 2649 Share the specified filesystem according to the
2619 2650 .Sy sharenfs
2620 2651 and
2621 2652 .Sy sharesmb
2622 2653 properties.
2623 2654 File systems are shared when the
2624 2655 .Sy sharenfs
2625 2656 or
2626 2657 .Sy sharesmb
2627 2658 property is set.
2628 2659 .El
2629 2660 .It Xo
2630 2661 .Nm
2631 2662 .Cm unshare
2632 2663 .Fl a | Ar filesystem Ns | Ns Ar mountpoint
2633 2664 .Xc
2634 2665 Unshares currently shared ZFS file systems.
2635 2666 .Bl -tag -width "-a"
2636 2667 .It Fl a
2637 2668 Unshare all available ZFS file systems.
2638 2669 Invoked automatically as part of the shutdown process.
2639 2670 .It Ar filesystem Ns | Ns Ar mountpoint
2640 2671 Unshare the specified filesystem.
2641 2672 The command can also be given a path to a ZFS file system shared on the system.
2642 2673 .El
2643 2674 .It Xo
2644 2675 .Nm
2645 2676 .Cm bookmark
2646 2677 .Ar snapshot bookmark
2647 2678 .Xc
2648 2679 Creates a bookmark of the given snapshot.
2649 2680 Bookmarks mark the point in time when the snapshot was created, and can be used
2650 2681 as the incremental source for a
2651 2682 .Nm zfs Cm send
2652 2683 command.
2653 2684 .Pp
2654 2685 This feature must be enabled to be used.
2655 2686 See
2656 2687 .Xr zpool-features 5
2657 2688 for details on ZFS feature flags and the
2658 2689 .Sy bookmarks
2659 2690 feature.
2660 2691 .It Xo
2661 2692 .Nm
2662 2693 .Cm send
2663 2694 .Op Fl DLPRcenpv
2664 2695 .Op Oo Fl I Ns | Ns Fl i Oc Ar snapshot
2665 2696 .Ar snapshot
2666 2697 .Xc
2667 2698 Creates a stream representation of the second
2668 2699 .Ar snapshot ,
2669 2700 which is written to standard output.
2670 2701 The output can be redirected to a file or to a different system
2671 2702 .Po for example, using
2672 2703 .Xr ssh 1
2673 2704 .Pc .
2674 2705 By default, a full stream is generated.
2675 2706 .Bl -tag -width "-D"
2676 2707 .It Fl D, -dedup
2677 2708 Generate a deduplicated stream.
2678 2709 Blocks which would have been sent multiple times in the send stream will only be
2679 2710 sent once.
2680 2711 The receiving system must also support this feature to receive a deduplicated
2681 2712 stream.
2682 2713 This flag can be used regardless of the dataset's
2683 2714 .Sy dedup
2684 2715 property, but performance will be much better if the filesystem uses a
2685 2716 dedup-capable checksum
2686 2717 .Po for example,
2687 2718 .Sy sha256
2688 2719 .Pc .
2689 2720 .It Fl I Ar snapshot
2690 2721 Generate a stream package that sends all intermediary snapshots from the first
2691 2722 snapshot to the second snapshot.
2692 2723 For example,
2693 2724 .Fl I Em @a Em fs@d
2694 2725 is similar to
2695 2726 .Fl i Em @a Em fs@b Ns \&; Fl i Em @b Em fs@c Ns \&; Fl i Em @c Em fs@d .
2696 2727 The incremental source may be specified as with the
2697 2728 .Fl i
2698 2729 option.
2699 2730 .It Fl L, -large-block
2700 2731 Generate a stream which may contain blocks larger than 128KB.
2701 2732 This flag has no effect if the
2702 2733 .Sy large_blocks
2703 2734 pool feature is disabled, or if the
2704 2735 .Sy recordsize
2705 2736 property of this filesystem has never been set above 128KB.
2706 2737 The receiving system must have the
2707 2738 .Sy large_blocks
2708 2739 pool feature enabled as well.
2709 2740 See
2710 2741 .Xr zpool-features 5
2711 2742 for details on ZFS feature flags and the
2712 2743 .Sy large_blocks
2713 2744 feature.
2714 2745 .It Fl P, -parsable
2715 2746 Print machine-parsable verbose information about the stream package generated.
2716 2747 .It Fl R, -replicate
2717 2748 Generate a replication stream package, which will replicate the specified
2718 2749 file system, and all descendent file systems, up to the named snapshot.
2719 2750 When received, all properties, snapshots, descendent file systems, and clones
2720 2751 are preserved.
2721 2752 .Pp
2722 2753 If the
2723 2754 .Fl i
2724 2755 or
2725 2756 .Fl I
2726 2757 flags are used in conjunction with the
2727 2758 .Fl R
2728 2759 flag, an incremental replication stream is generated.
2729 2760 The current values of properties, and current snapshot and file system names are
2730 2761 set when the stream is received.
2731 2762 If the
2732 2763 .Fl F
2733 2764 flag is specified when this stream is received, snapshots and file systems that
2734 2765 do not exist on the sending side are destroyed.
2735 2766 .It Fl e, -embed
2736 2767 Generate a more compact stream by using
2737 2768 .Sy WRITE_EMBEDDED
2738 2769 records for blocks which are stored more compactly on disk by the
2739 2770 .Sy embedded_data
2740 2771 pool feature.
2741 2772 This flag has no effect if the
2742 2773 .Sy embedded_data
2743 2774 feature is disabled.
2744 2775 The receiving system must have the
2745 2776 .Sy embedded_data
2746 2777 feature enabled.
2747 2778 If the
2748 2779 .Sy lz4_compress
2749 2780 feature is active on the sending system, then the receiving system must have
2750 2781 that feature enabled as well.
2751 2782 See
2752 2783 .Xr zpool-features 5
2753 2784 for details on ZFS feature flags and the
2754 2785 .Sy embedded_data
2755 2786 feature.
2756 2787 .It Fl c, -compressed
2757 2788 Generate a more compact stream by using compressed WRITE records for blocks
2758 2789 which are compressed on disk and in memory
2759 2790 .Po see the
2760 2791 .Sy compression
2761 2792 property for details
2762 2793 .Pc .
2763 2794 If the
2764 2795 .Sy lz4_compress
2765 2796 feature is active on the sending system, then the receiving system must have
2766 2797 that feature enabled as well.
2767 2798 If the
2768 2799 .Sy large_blocks
2769 2800 feature is enabled on the sending system but the
2770 2801 .Fl L
2771 2802 option is not supplied in conjunction with
2772 2803 .Fl c ,
2773 2804 then the data will be decompressed before sending so it can be split into
2774 2805 smaller block sizes.
2775 2806 .It Fl i Ar snapshot
2776 2807 Generate an incremental stream from the first
2777 2808 .Ar snapshot
2778 2809 .Pq the incremental source
2779 2810 to the second
2780 2811 .Ar snapshot
2781 2812 .Pq the incremental target .
2782 2813 The incremental source can be specified as the last component of the snapshot
2783 2814 name
2784 2815 .Po the
2785 2816 .Sy @
2786 2817 character and following
2787 2818 .Pc
2788 2819 and it is assumed to be from the same file system as the incremental target.
2789 2820 .Pp
2790 2821 If the destination is a clone, the source may be the origin snapshot, which must
2791 2822 be fully specified
2792 2823 .Po for example,
2793 2824 .Em pool/fs@origin ,
2794 2825 not just
2795 2826 .Em @origin
2796 2827 .Pc .
2797 2828 .It Fl n, -dryrun
2798 2829 Do a dry-run
2799 2830 .Pq Qq No-op
2800 2831 send.
2801 2832 Do not generate any actual send data.
2802 2833 This is useful in conjunction with the
2803 2834 .Fl v
2804 2835 or
2805 2836 .Fl P
2806 2837 flags to determine what data will be sent.
2807 2838 In this case, the verbose output will be written to standard output
2808 2839 .Po contrast with a non-dry-run, where the stream is written to standard output
2809 2840 and the verbose output goes to standard error
2810 2841 .Pc .
2811 2842 .It Fl p, -props
2812 2843 Include the dataset's properties in the stream.
2813 2844 This flag is implicit when
2814 2845 .Fl R
2815 2846 is specified.
2816 2847 The receiving system must also support this feature.
2817 2848 .It Fl v, -verbose
2818 2849 Print verbose information about the stream package generated.
2819 2850 This information includes a per-second report of how much data has been sent.
2820 2851 .Pp
2821 2852 The format of the stream is committed.
2822 2853 You will be able to receive your streams on future versions of ZFS .
2823 2854 .El
2824 2855 .It Xo
2825 2856 .Nm
2826 2857 .Cm send
2827 2858 .Op Fl Lce
2828 2859 .Op Fl i Ar snapshot Ns | Ns Ar bookmark
2829 2860 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
2830 2861 .Xc
2831 2862 Generate a send stream, which may be of a filesystem, and may be incremental
2832 2863 from a bookmark.
2833 2864 If the destination is a filesystem or volume, the pool must be read-only, or the
2834 2865 filesystem must not be mounted.
2835 2866 When the stream generated from a filesystem or volume is received, the default
2836 2867 snapshot name will be
2837 2868 .Qq --head-- .
2838 2869 .Bl -tag -width "-L"
2839 2870 .It Fl L, -large-block
2840 2871 Generate a stream which may contain blocks larger than 128KB.
2841 2872 This flag has no effect if the
2842 2873 .Sy large_blocks
2843 2874 pool feature is disabled, or if the
2844 2875 .Sy recordsize
2845 2876 property of this filesystem has never been set above 128KB.
2846 2877 The receiving system must have the
2847 2878 .Sy large_blocks
2848 2879 pool feature enabled as well.
2849 2880 See
2850 2881 .Xr zpool-features 5
2851 2882 for details on ZFS feature flags and the
2852 2883 .Sy large_blocks
2853 2884 feature.
2854 2885 .It Fl c, -compressed
2855 2886 Generate a more compact stream by using compressed WRITE records for blocks
2856 2887 which are compressed on disk and in memory
2857 2888 .Po see the
2858 2889 .Sy compression
2859 2890 property for details
2860 2891 .Pc .
2861 2892 If the
2862 2893 .Sy lz4_compress
2863 2894 feature is active on the sending system, then the receiving system must have
2864 2895 that feature enabled as well.
2865 2896 If the
2866 2897 .Sy large_blocks
2867 2898 feature is enabled on the sending system but the
2868 2899 .Fl L
2869 2900 option is not supplied in conjunction with
2870 2901 .Fl c ,
2871 2902 then the data will be decompressed before sending so it can be split into
2872 2903 smaller block sizes.
2873 2904 .It Fl e, -embed
2874 2905 Generate a more compact stream by using
2875 2906 .Sy WRITE_EMBEDDED
2876 2907 records for blocks which are stored more compactly on disk by the
2877 2908 .Sy embedded_data
2878 2909 pool feature.
2879 2910 This flag has no effect if the
2880 2911 .Sy embedded_data
2881 2912 feature is disabled.
2882 2913 The receiving system must have the
2883 2914 .Sy embedded_data
2884 2915 feature enabled.
2885 2916 If the
2886 2917 .Sy lz4_compress
2887 2918 feature is active on the sending system, then the receiving system must have
2888 2919 that feature enabled as well.
2889 2920 See
2890 2921 .Xr zpool-features 5
2891 2922 for details on ZFS feature flags and the
2892 2923 .Sy embedded_data
2893 2924 feature.
2894 2925 .It Fl i Ar snapshot Ns | Ns Ar bookmark
2895 2926 Generate an incremental send stream.
2896 2927 The incremental source must be an earlier snapshot in the destination's history.
2897 2928 It will commonly be an earlier snapshot in the destination's file system, in
2898 2929 which case it can be specified as the last component of the name
2899 2930 .Po the
2900 2931 .Sy #
2901 2932 or
2902 2933 .Sy @
2903 2934 character and following
2904 2935 .Pc .
2905 2936 .Pp
2906 2937 If the incremental target is a clone, the incremental source can be the origin
2907 2938 snapshot, or an earlier snapshot in the origin's filesystem, or the origin's
2908 2939 origin, etc.
2909 2940 .El
2910 2941 .It Xo
2911 2942 .Nm
2912 2943 .Cm send
2913 2944 .Op Fl Penv
2914 2945 .Fl t
2915 2946 .Ar receive_resume_token
2916 2947 .Xc
2917 2948 Creates a send stream which resumes an interrupted receive.
2918 2949 The
2919 2950 .Ar receive_resume_token
2920 2951 is the value of this property on the filesystem or volume that was being
2921 2952 received into.
2922 2953 See the documentation for
2923 2954 .Sy zfs receive -s
2924 2955 for more details.
2925 2956 .It Xo
2926 2957 .Nm
2927 2958 .Cm receive
2928 2959 .Op Fl Fnsuv
2929 2960 .Op Fl o Sy origin Ns = Ns Ar snapshot
2930 2961 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
2931 2962 .Xc
2932 2963 .It Xo
2933 2964 .Nm
2934 2965 .Cm receive
2935 2966 .Op Fl Fnsuv
2936 2967 .Op Fl d Ns | Ns Fl e
2937 2968 .Op Fl o Sy origin Ns = Ns Ar snapshot
2938 2969 .Ar filesystem
2939 2970 .Xc
2940 2971 Creates a snapshot whose contents are as specified in the stream provided on
2941 2972 standard input.
2942 2973 If a full stream is received, then a new file system is created as well.
2943 2974 Streams are created using the
2944 2975 .Nm zfs Cm send
2945 2976 subcommand, which by default creates a full stream.
2946 2977 .Nm zfs Cm recv
2947 2978 can be used as an alias for
2948 2979 .Nm zfs Cm receive.
2949 2980 .Pp
2950 2981 If an incremental stream is received, then the destination file system must
2951 2982 already exist, and its most recent snapshot must match the incremental stream's
2952 2983 source.
2953 2984 For
2954 2985 .Sy zvols ,
2955 2986 the destination device link is destroyed and recreated, which means the
2956 2987 .Sy zvol
2957 2988 cannot be accessed during the
2958 2989 .Cm receive
2959 2990 operation.
2960 2991 .Pp
2961 2992 When a snapshot replication package stream that is generated by using the
2962 2993 .Nm zfs Cm send Fl R
2963 2994 command is received, any snapshots that do not exist on the sending location are
2964 2995 destroyed by using the
2965 2996 .Nm zfs Cm destroy Fl d
2966 2997 command.
2967 2998 .Pp
2968 2999 The name of the snapshot
2969 3000 .Pq and file system, if a full stream is received
2970 3001 that this subcommand creates depends on the argument type and the use of the
2971 3002 .Fl d
2972 3003 or
2973 3004 .Fl e
2974 3005 options.
2975 3006 .Pp
2976 3007 If the argument is a snapshot name, the specified
2977 3008 .Ar snapshot
2978 3009 is created.
2979 3010 If the argument is a file system or volume name, a snapshot with the same name
2980 3011 as the sent snapshot is created within the specified
2981 3012 .Ar filesystem
2982 3013 or
2983 3014 .Ar volume .
2984 3015 If neither of the
2985 3016 .Fl d
2986 3017 or
2987 3018 .Fl e
2988 3019 options are specified, the provided target snapshot name is used exactly as
2989 3020 provided.
2990 3021 .Pp
2991 3022 The
2992 3023 .Fl d
2993 3024 and
2994 3025 .Fl e
2995 3026 options cause the file system name of the target snapshot to be determined by
2996 3027 appending a portion of the sent snapshot's name to the specified target
2997 3028 .Ar filesystem .
2998 3029 If the
2999 3030 .Fl d
3000 3031 option is specified, all but the first element of the sent snapshot's file
3001 3032 system path
3002 3033 .Pq usually the pool name
3003 3034 is used and any required intermediate file systems within the specified one are
3004 3035 created.
3005 3036 If the
3006 3037 .Fl e
3007 3038 option is specified, then only the last element of the sent snapshot's file
3008 3039 system name
3009 3040 .Pq i.e. the name of the source file system itself
3010 3041 is used as the target file system name.
3011 3042 .Bl -tag -width "-F"
3012 3043 .It Fl F
3013 3044 Force a rollback of the file system to the most recent snapshot before
3014 3045 performing the receive operation.
3015 3046 If receiving an incremental replication stream
3016 3047 .Po for example, one generated by
3017 3048 .Nm zfs Cm send Fl R Op Fl i Ns | Ns Fl I
3018 3049 .Pc ,
3019 3050 destroy snapshots and file systems that do not exist on the sending side.
3020 3051 .It Fl d
3021 3052 Discard the first element of the sent snapshot's file system name, using the
3022 3053 remaining elements to determine the name of the target file system for the new
3023 3054 snapshot as described in the paragraph above.
3024 3055 .It Fl e
3025 3056 Discard all but the last element of the sent snapshot's file system name, using
3026 3057 that element to determine the name of the target file system for the new
3027 3058 snapshot as described in the paragraph above.
3028 3059 .It Fl n
3029 3060 Do not actually receive the stream.
3030 3061 This can be useful in conjunction with the
3031 3062 .Fl v
3032 3063 option to verify the name the receive operation would use.
3033 3064 .It Fl o Sy origin Ns = Ns Ar snapshot
3034 3065 Forces the stream to be received as a clone of the given snapshot.
3035 3066 If the stream is a full send stream, this will create the filesystem
3036 3067 described by the stream as a clone of the specified snapshot.
3037 3068 Which snapshot was specified will not affect the success or failure of the
3038 3069 receive, as long as the snapshot does exist.
3039 3070 If the stream is an incremental send stream, all the normal verification will be
3040 3071 performed.
3041 3072 .It Fl u
3042 3073 File system that is associated with the received stream is not mounted.
3043 3074 .It Fl v
3044 3075 Print verbose information about the stream and the time required to perform the
3045 3076 receive operation.
3046 3077 .It Fl s
3047 3078 If the receive is interrupted, save the partially received state, rather
3048 3079 than deleting it.
3049 3080 Interruption may be due to premature termination of the stream
3050 3081 .Po e.g. due to network failure or failure of the remote system
3051 3082 if the stream is being read over a network connection
3052 3083 .Pc ,
3053 3084 a checksum error in the stream, termination of the
3054 3085 .Nm zfs Cm receive
3055 3086 process, or unclean shutdown of the system.
3056 3087 .Pp
3057 3088 The receive can be resumed with a stream generated by
3058 3089 .Nm zfs Cm send Fl t Ar token ,
3059 3090 where the
3060 3091 .Ar token
3061 3092 is the value of the
3062 3093 .Sy receive_resume_token
3063 3094 property of the filesystem or volume which is received into.
3064 3095 .Pp
3065 3096 To use this flag, the storage pool must have the
3066 3097 .Sy extensible_dataset
3067 3098 feature enabled.
3068 3099 See
3069 3100 .Xr zpool-features 5
3070 3101 for details on ZFS feature flags.
3071 3102 .El
3072 3103 .It Xo
3073 3104 .Nm
3074 3105 .Cm receive
3075 3106 .Fl A
3076 3107 .Ar filesystem Ns | Ns Ar volume
3077 3108 .Xc
3078 3109 Abort an interrupted
3079 3110 .Nm zfs Cm receive Fl s ,
3080 3111 deleting its saved partially received state.
3081 3112 .It Xo
3082 3113 .Nm
3083 3114 .Cm allow
3084 3115 .Ar filesystem Ns | Ns Ar volume
3085 3116 .Xc
3086 3117 Displays permissions that have been delegated on the specified filesystem or
3087 3118 volume.
3088 3119 See the other forms of
3089 3120 .Nm zfs Cm allow
3090 3121 for more information.
3091 3122 .It Xo
3092 3123 .Nm
3093 3124 .Cm allow
3094 3125 .Op Fl dglu
3095 3126 .Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ...
3096 3127 .Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3097 3128 .Ar setname Oc Ns ...
3098 3129 .Ar filesystem Ns | Ns Ar volume
3099 3130 .br
3100 3131 .Nm
3101 3132 .Cm allow
3102 3133 .Op Fl dl
3103 3134 .Fl e Ns | Ns Sy everyone
3104 3135 .Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3105 3136 .Ar setname Oc Ns ...
3106 3137 .Ar filesystem Ns | Ns Ar volume
3107 3138 .Xc
3108 3139 Delegates ZFS administration permission for the file systems to non-privileged
3109 3140 users.
3110 3141 .Bl -tag -width "-d"
3111 3142 .It Fl d
3112 3143 Allow only for the descendent file systems.
3113 3144 .It Fl e Ns | Ns Sy everyone
3114 3145 Specifies that the permissions be delegated to everyone.
3115 3146 .It Fl g Ar group Ns Oo , Ns Ar group Oc Ns ...
3116 3147 Explicitly specify that permissions are delegated to the group.
3117 3148 .It Fl l
3118 3149 Allow
3119 3150 .Qq locally
3120 3151 only for the specified file system.
3121 3152 .It Fl u Ar user Ns Oo , Ns Ar user Oc Ns ...
3122 3153 Explicitly specify that permissions are delegated to the user.
3123 3154 .It Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ...
3124 3155 Specifies to whom the permissions are delegated.
3125 3156 Multiple entities can be specified as a comma-separated list.
3126 3157 If neither of the
3127 3158 .Fl gu
3128 3159 options are specified, then the argument is interpreted preferentially as the
3129 3160 keyword
3130 3161 .Sy everyone ,
3131 3162 then as a user name, and lastly as a group name.
3132 3163 To specify a user or group named
3133 3164 .Qq everyone ,
3134 3165 use the
3135 3166 .Fl g
3136 3167 or
3137 3168 .Fl u
3138 3169 options.
3139 3170 To specify a group with the same name as a user, use the
3140 3171 .Fl g
3141 3172 options.
3142 3173 .It Xo
3143 3174 .Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3144 3175 .Ar setname Oc Ns ...
3145 3176 .Xc
3146 3177 The permissions to delegate.
3147 3178 Multiple permissions may be specified as a comma-separated list.
3148 3179 Permission names are the same as ZFS subcommand and property names.
3149 3180 See the property list below.
3150 3181 Property set names, which begin with
3151 3182 .Sy @ ,
3152 3183 may be specified.
3153 3184 See the
3154 3185 .Fl s
3155 3186 form below for details.
3156 3187 .El
3157 3188 .Pp
3158 3189 If neither of the
3159 3190 .Fl dl
3160 3191 options are specified, or both are, then the permissions are allowed for the
3161 3192 file system or volume, and all of its descendents.
3162 3193 .Pp
3163 3194 Permissions are generally the ability to use a ZFS subcommand or change a ZFS
3164 3195 property.
3165 3196 The following permissions are available:
3166 3197 .Bd -literal
3167 3198 NAME TYPE NOTES
3168 3199 allow subcommand Must also have the permission that is
3169 3200 being allowed
3170 3201 clone subcommand Must also have the 'create' ability and
3171 3202 'mount' ability in the origin file system
3172 3203 create subcommand Must also have the 'mount' ability
3173 3204 destroy subcommand Must also have the 'mount' ability
3174 3205 diff subcommand Allows lookup of paths within a dataset
3175 3206 given an object number, and the ability
3176 3207 to create snapshots necessary to
3177 3208 'zfs diff'.
3178 3209 mount subcommand Allows mount/umount of ZFS datasets
3179 3210 promote subcommand Must also have the 'mount' and 'promote'
3180 3211 ability in the origin file system
3181 3212 receive subcommand Must also have the 'mount' and 'create'
3182 3213 ability
3183 3214 rename subcommand Must also have the 'mount' and 'create'
3184 3215 ability in the new parent
3185 3216 rollback subcommand Must also have the 'mount' ability
3186 3217 send subcommand
3187 3218 share subcommand Allows sharing file systems over NFS
3188 3219 or SMB protocols
3189 3220 snapshot subcommand Must also have the 'mount' ability
3190 3221
3191 3222 groupquota other Allows accessing any groupquota@...
3192 3223 property
3193 3224 groupused other Allows reading any groupused@... property
3194 3225 userprop other Allows changing any user property
3195 3226 userquota other Allows accessing any userquota@...
3196 3227 property
3197 3228 userused other Allows reading any userused@... property
3198 3229
3199 3230 aclinherit property
3200 3231 aclmode property
3201 3232 atime property
3202 3233 canmount property
3203 3234 casesensitivity property
3204 3235 checksum property
3205 3236 compression property
3206 3237 copies property
3207 3238 devices property
3208 3239 exec property
3209 3240 filesystem_limit property
3210 3241 mountpoint property
3211 3242 nbmand property
3212 3243 normalization property
3213 3244 primarycache property
3214 3245 quota property
3215 3246 readonly property
3216 3247 recordsize property
3217 3248 refquota property
3218 3249 refreservation property
3219 3250 reservation property
3220 3251 secondarycache property
3221 3252 setuid property
3222 3253 sharenfs property
3223 3254 sharesmb property
3224 3255 snapdir property
3225 3256 snapshot_limit property
3226 3257 utf8only property
3227 3258 version property
3228 3259 volblocksize property
3229 3260 volsize property
3230 3261 vscan property
3231 3262 xattr property
3232 3263 zoned property
3233 3264 .Ed
3234 3265 .It Xo
3235 3266 .Nm
3236 3267 .Cm allow
3237 3268 .Fl c
3238 3269 .Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3239 3270 .Ar setname Oc Ns ...
3240 3271 .Ar filesystem Ns | Ns Ar volume
3241 3272 .Xc
3242 3273 Sets
3243 3274 .Qq create time
3244 3275 permissions.
3245 3276 These permissions are granted
3246 3277 .Pq locally
3247 3278 to the creator of any newly-created descendent file system.
3248 3279 .It Xo
3249 3280 .Nm
3250 3281 .Cm allow
3251 3282 .Fl s No @ Ns Ar setname
3252 3283 .Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3253 3284 .Ar setname Oc Ns ...
3254 3285 .Ar filesystem Ns | Ns Ar volume
3255 3286 .Xc
3256 3287 Defines or adds permissions to a permission set.
3257 3288 The set can be used by other
3258 3289 .Nm zfs Cm allow
3259 3290 commands for the specified file system and its descendents.
3260 3291 Sets are evaluated dynamically, so changes to a set are immediately reflected.
3261 3292 Permission sets follow the same naming restrictions as ZFS file systems, but the
3262 3293 name must begin with
3263 3294 .Sy @ ,
3264 3295 and can be no more than 64 characters long.
3265 3296 .It Xo
3266 3297 .Nm
3267 3298 .Cm unallow
3268 3299 .Op Fl dglru
3269 3300 .Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ...
3270 3301 .Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3271 3302 .Ar setname Oc Ns ... Oc
3272 3303 .Ar filesystem Ns | Ns Ar volume
3273 3304 .br
3274 3305 .Nm
3275 3306 .Cm unallow
3276 3307 .Op Fl dlr
3277 3308 .Fl e Ns | Ns Sy everyone
3278 3309 .Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3279 3310 .Ar setname Oc Ns ... Oc
3280 3311 .Ar filesystem Ns | Ns Ar volume
3281 3312 .br
3282 3313 .Nm
3283 3314 .Cm unallow
3284 3315 .Op Fl r
3285 3316 .Fl c
3286 3317 .Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3287 3318 .Ar setname Oc Ns ... Oc
3288 3319 .Ar filesystem Ns | Ns Ar volume
3289 3320 .Xc
3290 3321 Removes permissions that were granted with the
3291 3322 .Nm zfs Cm allow
3292 3323 command.
3293 3324 No permissions are explicitly denied, so other permissions granted are still in
3294 3325 effect.
3295 3326 For example, if the permission is granted by an ancestor.
3296 3327 If no permissions are specified, then all permissions for the specified
3297 3328 .Ar user ,
3298 3329 .Ar group ,
3299 3330 or
3300 3331 .Sy everyone
3301 3332 are removed.
3302 3333 Specifying
3303 3334 .Sy everyone
3304 3335 .Po or using the
3305 3336 .Fl e
3306 3337 option
3307 3338 .Pc
3308 3339 only removes the permissions that were granted to everyone, not all permissions
3309 3340 for every user and group.
3310 3341 See the
3311 3342 .Nm zfs Cm allow
3312 3343 command for a description of the
3313 3344 .Fl ldugec
3314 3345 options.
3315 3346 .Bl -tag -width "-r"
3316 3347 .It Fl r
3317 3348 Recursively remove the permissions from this file system and all descendents.
3318 3349 .El
3319 3350 .It Xo
3320 3351 .Nm
3321 3352 .Cm unallow
3322 3353 .Op Fl r
3323 3354 .Fl s No @ Ns Ar setname
3324 3355 .Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3325 3356 .Ar setname Oc Ns ... Oc
3326 3357 .Ar filesystem Ns | Ns Ar volume
3327 3358 .Xc
3328 3359 Removes permissions from a permission set.
3329 3360 If no permissions are specified, then all permissions are removed, thus removing
3330 3361 the set entirely.
3331 3362 .It Xo
3332 3363 .Nm
3333 3364 .Cm hold
3334 3365 .Op Fl r
3335 3366 .Ar tag Ar snapshot Ns ...
3336 3367 .Xc
3337 3368 Adds a single reference, named with the
3338 3369 .Ar tag
3339 3370 argument, to the specified snapshot or snapshots.
3340 3371 Each snapshot has its own tag namespace, and tags must be unique within that
3341 3372 space.
3342 3373 .Pp
3343 3374 If a hold exists on a snapshot, attempts to destroy that snapshot by using the
3344 3375 .Nm zfs Cm destroy
3345 3376 command return
3346 3377 .Er EBUSY .
3347 3378 .Bl -tag -width "-r"
3348 3379 .It Fl r
3349 3380 Specifies that a hold with the given tag is applied recursively to the snapshots
3350 3381 of all descendent file systems.
3351 3382 .El
3352 3383 .It Xo
3353 3384 .Nm
3354 3385 .Cm holds
3355 3386 .Op Fl r
3356 3387 .Ar snapshot Ns ...
3357 3388 .Xc
3358 3389 Lists all existing user references for the given snapshot or snapshots.
3359 3390 .Bl -tag -width "-r"
3360 3391 .It Fl r
3361 3392 Lists the holds that are set on the named descendent snapshots, in addition to
3362 3393 listing the holds on the named snapshot.
3363 3394 .El
3364 3395 .It Xo
3365 3396 .Nm
3366 3397 .Cm release
3367 3398 .Op Fl r
3368 3399 .Ar tag Ar snapshot Ns ...
3369 3400 .Xc
3370 3401 Removes a single reference, named with the
3371 3402 .Ar tag
3372 3403 argument, from the specified snapshot or snapshots.
3373 3404 The tag must already exist for each snapshot.
3374 3405 If a hold exists on a snapshot, attempts to destroy that snapshot by using the
3375 3406 .Nm zfs Cm destroy
3376 3407 command return
3377 3408 .Er EBUSY .
3378 3409 .Bl -tag -width "-r"
3379 3410 .It Fl r
3380 3411 Recursively releases a hold with the given tag on the snapshots of all
3381 3412 descendent file systems.
3382 3413 .El
3383 3414 .It Xo
3384 3415 .Nm
3385 3416 .Cm diff
3386 3417 .Op Fl FHt
3387 3418 .Ar snapshot Ar snapshot Ns | Ns Ar filesystem
3388 3419 .Xc
3389 3420 Display the difference between a snapshot of a given filesystem and another
3390 3421 snapshot of that filesystem from a later time or the current contents of the
3391 3422 filesystem.
3392 3423 The first column is a character indicating the type of change, the other columns
3393 3424 indicate pathname, new pathname
3394 3425 .Pq in case of rename ,
3395 3426 change in link count, and optionally file type and/or change time.
3396 3427 The types of change are:
3397 3428 .Bd -literal
3398 3429 - The path has been removed
3399 3430 + The path has been created
3400 3431 M The path has been modified
3401 3432 R The path has been renamed
3402 3433 .Ed
3403 3434 .Bl -tag -width "-F"
3404 3435 .It Fl F
3405 3436 Display an indication of the type of file, in a manner similar to the
3406 3437 .Fl
3407 3438 option of
3408 3439 .Xr ls 1 .
3409 3440 .Bd -literal
3410 3441 B Block device
3411 3442 C Character device
3412 3443 / Directory
3413 3444 > Door
3414 3445 | Named pipe
3415 3446 @ Symbolic link
3416 3447 P Event port
3417 3448 = Socket
3418 3449 F Regular file
3419 3450 .Ed
3420 3451 .It Fl H
3421 3452 Give more parsable tab-separated output, without header lines and without
3422 3453 arrows.
3423 3454 .It Fl t
3424 3455 Display the path's inode change time as the first column of output.
3425 3456 .El
3426 3457 .It Xo
3427 3458 .Nm
3428 3459 .Cm program
3429 3460 .Op Fl n
3430 3461 .Op Fl t Ar timeout
3431 3462 .Op Fl m Ar memory_limit
3432 3463 .Ar pool script
3433 3464 .Op Ar arg1 No ...
3434 3465 .Xc
3435 3466 Executes
3436 3467 .Ar script
3437 3468 as a ZFS channel program on
3438 3469 .Ar pool .
3439 3470 The ZFS channel
3440 3471 program interface allows ZFS administrative operations to be run
3441 3472 programmatically via a Lua script.
3442 3473 The entire script is executed atomically, with no other administrative
3443 3474 operations taking effect concurrently.
3444 3475 A library of ZFS calls is made available to channel program scripts.
3445 3476 Channel programs may only be run with root privileges.
3446 3477 .sp
3447 3478 For full documentation of the ZFS channel program interface, see the manual
3448 3479 page for
3449 3480 .Bl -tag -width ""
3450 3481 .It Fl n
3451 3482 Executes a read-only channel program, which runs faster.
3452 3483 The program cannot change on-disk state by calling functions from
3453 3484 the zfs.sync submodule.
3454 3485 The program can be used to gather information such as properties and
3455 3486 determining if changes would succeed (zfs.check.*).
3456 3487 Without this flag, all pending changes must be synced to disk before
3457 3488 a channel program can complete.
3458 3489 .It Fl t Ar timeout
3459 3490 Execution time limit, in milliseconds.
3460 3491 If a channel program executes for longer than the provided timeout, it will
3461 3492 be stopped and an error will be returned.
3462 3493 The default timeout is 1000 ms, and can be set to a maximum of 10000 ms.
3463 3494 .It Fl m Ar memory-limit
3464 3495 Memory limit, in bytes.
3465 3496 If a channel program attempts to allocate more memory than the given limit,
3466 3497 it will be stopped and an error returned.
3467 3498 The default memory limit is 10 MB, and can be set to a maximum of 100 MB.
3468 3499 .sp
3469 3500 All remaining argument strings are passed directly to the channel program as
3470 3501 arguments.
3471 3502 See
3472 3503 .Xr zfs-program 1M
3473 3504 for more information.
3474 3505 .El
3475 3506 .El
3476 3507 .Sh EXIT STATUS
3477 3508 The
3478 3509 .Nm
3479 3510 utility exits 0 on success, 1 if an error occurs, and 2 if invalid command line
3480 3511 options were specified.
3481 3512 .Sh EXAMPLES
3482 3513 .Bl -tag -width ""
3483 3514 .It Sy Example 1 No Creating a ZFS File System Hierarchy
3484 3515 The following commands create a file system named
3485 3516 .Em pool/home
3486 3517 and a file system named
3487 3518 .Em pool/home/bob .
3488 3519 The mount point
3489 3520 .Pa /export/home
3490 3521 is set for the parent file system, and is automatically inherited by the child
3491 3522 file system.
3492 3523 .Bd -literal
3493 3524 # zfs create pool/home
3494 3525 # zfs set mountpoint=/export/home pool/home
3495 3526 # zfs create pool/home/bob
3496 3527 .Ed
3497 3528 .It Sy Example 2 No Creating a ZFS Snapshot
3498 3529 The following command creates a snapshot named
3499 3530 .Sy yesterday .
3500 3531 This snapshot is mounted on demand in the
3501 3532 .Pa .zfs/snapshot
3502 3533 directory at the root of the
3503 3534 .Em pool/home/bob
3504 3535 file system.
3505 3536 .Bd -literal
3506 3537 # zfs snapshot pool/home/bob@yesterday
3507 3538 .Ed
3508 3539 .It Sy Example 3 No Creating and Destroying Multiple Snapshots
3509 3540 The following command creates snapshots named
3510 3541 .Sy yesterday
3511 3542 of
3512 3543 .Em pool/home
3513 3544 and all of its descendent file systems.
3514 3545 Each snapshot is mounted on demand in the
3515 3546 .Pa .zfs/snapshot
3516 3547 directory at the root of its file system.
3517 3548 The second command destroys the newly created snapshots.
3518 3549 .Bd -literal
3519 3550 # zfs snapshot -r pool/home@yesterday
3520 3551 # zfs destroy -r pool/home@yesterday
3521 3552 .Ed
3522 3553 .It Sy Example 4 No Disabling and Enabling File System Compression
3523 3554 The following command disables the
3524 3555 .Sy compression
3525 3556 property for all file systems under
3526 3557 .Em pool/home .
3527 3558 The next command explicitly enables
3528 3559 .Sy compression
3529 3560 for
3530 3561 .Em pool/home/anne .
3531 3562 .Bd -literal
3532 3563 # zfs set compression=off pool/home
3533 3564 # zfs set compression=on pool/home/anne
3534 3565 .Ed
3535 3566 .It Sy Example 5 No Listing ZFS Datasets
3536 3567 The following command lists all active file systems and volumes in the system.
3537 3568 Snapshots are displayed if the
3538 3569 .Sy listsnaps
3539 3570 property is
3540 3571 .Sy on .
3541 3572 The default is
3542 3573 .Sy off .
3543 3574 See
3544 3575 .Xr zpool 1M
3545 3576 for more information on pool properties.
3546 3577 .Bd -literal
3547 3578 # zfs list
3548 3579 NAME USED AVAIL REFER MOUNTPOINT
3549 3580 pool 450K 457G 18K /pool
3550 3581 pool/home 315K 457G 21K /export/home
3551 3582 pool/home/anne 18K 457G 18K /export/home/anne
3552 3583 pool/home/bob 276K 457G 276K /export/home/bob
3553 3584 .Ed
3554 3585 .It Sy Example 6 No Setting a Quota on a ZFS File System
3555 3586 The following command sets a quota of 50 Gbytes for
3556 3587 .Em pool/home/bob .
3557 3588 .Bd -literal
3558 3589 # zfs set quota=50G pool/home/bob
3559 3590 .Ed
3560 3591 .It Sy Example 7 No Listing ZFS Properties
3561 3592 The following command lists all properties for
3562 3593 .Em pool/home/bob .
3563 3594 .Bd -literal
3564 3595 # zfs get all pool/home/bob
3565 3596 NAME PROPERTY VALUE SOURCE
3566 3597 pool/home/bob type filesystem -
3567 3598 pool/home/bob creation Tue Jul 21 15:53 2009 -
3568 3599 pool/home/bob used 21K -
3569 3600 pool/home/bob available 20.0G -
3570 3601 pool/home/bob referenced 21K -
3571 3602 pool/home/bob compressratio 1.00x -
3572 3603 pool/home/bob mounted yes -
3573 3604 pool/home/bob quota 20G local
3574 3605 pool/home/bob reservation none default
3575 3606 pool/home/bob recordsize 128K default
3576 3607 pool/home/bob mountpoint /pool/home/bob default
3577 3608 pool/home/bob sharenfs off default
3578 3609 pool/home/bob checksum on default
3579 3610 pool/home/bob compression on local
3580 3611 pool/home/bob atime on default
3581 3612 pool/home/bob devices on default
3582 3613 pool/home/bob exec on default
3583 3614 pool/home/bob setuid on default
3584 3615 pool/home/bob readonly off default
3585 3616 pool/home/bob zoned off default
3586 3617 pool/home/bob snapdir hidden default
3587 3618 pool/home/bob aclmode discard default
3588 3619 pool/home/bob aclinherit restricted default
3589 3620 pool/home/bob canmount on default
3590 3621 pool/home/bob xattr on default
3591 3622 pool/home/bob copies 1 default
3592 3623 pool/home/bob version 4 -
3593 3624 pool/home/bob utf8only off -
3594 3625 pool/home/bob normalization none -
3595 3626 pool/home/bob casesensitivity sensitive -
3596 3627 pool/home/bob vscan off default
3597 3628 pool/home/bob nbmand off default
3598 3629 pool/home/bob sharesmb off default
3599 3630 pool/home/bob refquota none default
3600 3631 pool/home/bob refreservation none default
3601 3632 pool/home/bob primarycache all default
3602 3633 pool/home/bob secondarycache all default
3603 3634 pool/home/bob usedbysnapshots 0 -
3604 3635 pool/home/bob usedbydataset 21K -
3605 3636 pool/home/bob usedbychildren 0 -
3606 3637 pool/home/bob usedbyrefreservation 0 -
3607 3638 .Ed
3608 3639 .Pp
3609 3640 The following command gets a single property value.
3610 3641 .Bd -literal
3611 3642 # zfs get -H -o value compression pool/home/bob
3612 3643 on
3613 3644 .Ed
3614 3645 The following command lists all properties with local settings for
3615 3646 .Em pool/home/bob .
3616 3647 .Bd -literal
3617 3648 # zfs get -r -s local -o name,property,value all pool/home/bob
3618 3649 NAME PROPERTY VALUE
3619 3650 pool/home/bob quota 20G
3620 3651 pool/home/bob compression on
3621 3652 .Ed
3622 3653 .It Sy Example 8 No Rolling Back a ZFS File System
3623 3654 The following command reverts the contents of
3624 3655 .Em pool/home/anne
3625 3656 to the snapshot named
3626 3657 .Sy yesterday ,
3627 3658 deleting all intermediate snapshots.
3628 3659 .Bd -literal
3629 3660 # zfs rollback -r pool/home/anne@yesterday
3630 3661 .Ed
3631 3662 .It Sy Example 9 No Creating a ZFS Clone
3632 3663 The following command creates a writable file system whose initial contents are
3633 3664 the same as
3634 3665 .Em pool/home/bob@yesterday .
3635 3666 .Bd -literal
3636 3667 # zfs clone pool/home/bob@yesterday pool/clone
3637 3668 .Ed
3638 3669 .It Sy Example 10 No Promoting a ZFS Clone
3639 3670 The following commands illustrate how to test out changes to a file system, and
3640 3671 then replace the original file system with the changed one, using clones, clone
3641 3672 promotion, and renaming:
3642 3673 .Bd -literal
3643 3674 # zfs create pool/project/production
3644 3675 populate /pool/project/production with data
3645 3676 # zfs snapshot pool/project/production@today
3646 3677 # zfs clone pool/project/production@today pool/project/beta
3647 3678 make changes to /pool/project/beta and test them
3648 3679 # zfs promote pool/project/beta
3649 3680 # zfs rename pool/project/production pool/project/legacy
3650 3681 # zfs rename pool/project/beta pool/project/production
3651 3682 once the legacy version is no longer needed, it can be destroyed
3652 3683 # zfs destroy pool/project/legacy
3653 3684 .Ed
3654 3685 .It Sy Example 11 No Inheriting ZFS Properties
3655 3686 The following command causes
3656 3687 .Em pool/home/bob
3657 3688 and
3658 3689 .Em pool/home/anne
3659 3690 to inherit the
3660 3691 .Sy checksum
3661 3692 property from their parent.
3662 3693 .Bd -literal
3663 3694 # zfs inherit checksum pool/home/bob pool/home/anne
3664 3695 .Ed
3665 3696 .It Sy Example 12 No Remotely Replicating ZFS Data
3666 3697 The following commands send a full stream and then an incremental stream to a
3667 3698 remote machine, restoring them into
3668 3699 .Em poolB/received/fs@a
3669 3700 and
3670 3701 .Em poolB/received/fs@b ,
3671 3702 respectively.
3672 3703 .Em poolB
3673 3704 must contain the file system
3674 3705 .Em poolB/received ,
3675 3706 and must not initially contain
3676 3707 .Em poolB/received/fs .
3677 3708 .Bd -literal
3678 3709 # zfs send pool/fs@a | \e
3679 3710 ssh host zfs receive poolB/received/fs@a
3680 3711 # zfs send -i a pool/fs@b | \e
3681 3712 ssh host zfs receive poolB/received/fs
3682 3713 .Ed
3683 3714 .It Sy Example 13 No Using the zfs receive -d Option
3684 3715 The following command sends a full stream of
3685 3716 .Em poolA/fsA/fsB@snap
3686 3717 to a remote machine, receiving it into
3687 3718 .Em poolB/received/fsA/fsB@snap .
3688 3719 The
3689 3720 .Em fsA/fsB@snap
3690 3721 portion of the received snapshot's name is determined from the name of the sent
3691 3722 snapshot.
3692 3723 .Em poolB
3693 3724 must contain the file system
3694 3725 .Em poolB/received .
3695 3726 If
3696 3727 .Em poolB/received/fsA
3697 3728 does not exist, it is created as an empty file system.
3698 3729 .Bd -literal
3699 3730 # zfs send poolA/fsA/fsB@snap | \e
3700 3731 ssh host zfs receive -d poolB/received
3701 3732 .Ed
3702 3733 .It Sy Example 14 No Setting User Properties
3703 3734 The following example sets the user-defined
3704 3735 .Sy com.example:department
3705 3736 property for a dataset.
3706 3737 .Bd -literal
3707 3738 # zfs set com.example:department=12345 tank/accounting
3708 3739 .Ed
3709 3740 .It Sy Example 15 No Performing a Rolling Snapshot
3710 3741 The following example shows how to maintain a history of snapshots with a
3711 3742 consistent naming scheme.
3712 3743 To keep a week's worth of snapshots, the user destroys the oldest snapshot,
3713 3744 renames the remaining snapshots, and then creates a new snapshot, as follows:
3714 3745 .Bd -literal
3715 3746 # zfs destroy -r pool/users@7daysago
3716 3747 # zfs rename -r pool/users@6daysago @7daysago
3717 3748 # zfs rename -r pool/users@5daysago @6daysago
3718 3749 # zfs rename -r pool/users@yesterday @5daysago
3719 3750 # zfs rename -r pool/users@yesterday @4daysago
3720 3751 # zfs rename -r pool/users@yesterday @3daysago
3721 3752 # zfs rename -r pool/users@yesterday @2daysago
3722 3753 # zfs rename -r pool/users@today @yesterday
3723 3754 # zfs snapshot -r pool/users@today
3724 3755 .Ed
3725 3756 .It Sy Example 16 No Setting sharenfs Property Options on a ZFS File System
3726 3757 The following commands show how to set
3727 3758 .Sy sharenfs
3728 3759 property options to enable
3729 3760 .Sy rw
3730 3761 access for a set of
3731 3762 .Sy IP
3732 3763 addresses and to enable root access for system
3733 3764 .Sy neo
3734 3765 on the
3735 3766 .Em tank/home
3736 3767 file system.
3737 3768 .Bd -literal
3738 3769 # zfs set sharenfs='rw=@123.123.0.0/16,root=neo' tank/home
3739 3770 .Ed
3740 3771 .Pp
3741 3772 If you are using
3742 3773 .Sy DNS
3743 3774 for host name resolution, specify the fully qualified hostname.
3744 3775 .It Sy Example 17 No Delegating ZFS Administration Permissions on a ZFS Dataset
3745 3776 The following example shows how to set permissions so that user
3746 3777 .Sy cindys
3747 3778 can create, destroy, mount, and take snapshots on
3748 3779 .Em tank/cindys .
3749 3780 The permissions on
3750 3781 .Em tank/cindys
3751 3782 are also displayed.
3752 3783 .Bd -literal
3753 3784 # zfs allow cindys create,destroy,mount,snapshot tank/cindys
3754 3785 # zfs allow tank/cindys
3755 3786 ---- Permissions on tank/cindys --------------------------------------
3756 3787 Local+Descendent permissions:
3757 3788 user cindys create,destroy,mount,snapshot
3758 3789 .Ed
3759 3790 .Pp
3760 3791 Because the
3761 3792 .Em tank/cindys
3762 3793 mount point permission is set to 755 by default, user
3763 3794 .Sy cindys
3764 3795 will be unable to mount file systems under
3765 3796 .Em tank/cindys .
3766 3797 Add an ACE similar to the following syntax to provide mount point access:
3767 3798 .Bd -literal
3768 3799 # chmod A+user:cindys:add_subdirectory:allow /tank/cindys
3769 3800 .Ed
3770 3801 .It Sy Example 18 No Delegating Create Time Permissions on a ZFS Dataset
3771 3802 The following example shows how to grant anyone in the group
3772 3803 .Sy staff
3773 3804 to create file systems in
3774 3805 .Em tank/users .
3775 3806 This syntax also allows staff members to destroy their own file systems, but not
3776 3807 destroy anyone else's file system.
3777 3808 The permissions on
3778 3809 .Em tank/users
3779 3810 are also displayed.
3780 3811 .Bd -literal
3781 3812 # zfs allow staff create,mount tank/users
3782 3813 # zfs allow -c destroy tank/users
3783 3814 # zfs allow tank/users
3784 3815 ---- Permissions on tank/users ---------------------------------------
3785 3816 Permission sets:
3786 3817 destroy
3787 3818 Local+Descendent permissions:
3788 3819 group staff create,mount
3789 3820 .Ed
3790 3821 .It Sy Example 19 No Defining and Granting a Permission Set on a ZFS Dataset
3791 3822 The following example shows how to define and grant a permission set on the
3792 3823 .Em tank/users
3793 3824 file system.
3794 3825 The permissions on
3795 3826 .Em tank/users
3796 3827 are also displayed.
3797 3828 .Bd -literal
3798 3829 # zfs allow -s @pset create,destroy,snapshot,mount tank/users
3799 3830 # zfs allow staff @pset tank/users
3800 3831 # zfs allow tank/users
3801 3832 ---- Permissions on tank/users ---------------------------------------
3802 3833 Permission sets:
3803 3834 @pset create,destroy,mount,snapshot
3804 3835 Local+Descendent permissions:
3805 3836 group staff @pset
3806 3837 .Ed
3807 3838 .It Sy Example 20 No Delegating Property Permissions on a ZFS Dataset
3808 3839 The following example shows to grant the ability to set quotas and reservations
3809 3840 on the
3810 3841 .Em users/home
3811 3842 file system.
3812 3843 The permissions on
3813 3844 .Em users/home
3814 3845 are also displayed.
3815 3846 .Bd -literal
3816 3847 # zfs allow cindys quota,reservation users/home
3817 3848 # zfs allow users/home
3818 3849 ---- Permissions on users/home ---------------------------------------
3819 3850 Local+Descendent permissions:
3820 3851 user cindys quota,reservation
3821 3852 cindys% zfs set quota=10G users/home/marks
3822 3853 cindys% zfs get quota users/home/marks
3823 3854 NAME PROPERTY VALUE SOURCE
3824 3855 users/home/marks quota 10G local
3825 3856 .Ed
3826 3857 .It Sy Example 21 No Removing ZFS Delegated Permissions on a ZFS Dataset
3827 3858 The following example shows how to remove the snapshot permission from the
3828 3859 .Sy staff
3829 3860 group on the
3830 3861 .Em tank/users
3831 3862 file system.
3832 3863 The permissions on
3833 3864 .Em tank/users
3834 3865 are also displayed.
3835 3866 .Bd -literal
3836 3867 # zfs unallow staff snapshot tank/users
3837 3868 # zfs allow tank/users
3838 3869 ---- Permissions on tank/users ---------------------------------------
3839 3870 Permission sets:
3840 3871 @pset create,destroy,mount,snapshot
3841 3872 Local+Descendent permissions:
3842 3873 group staff @pset
3843 3874 .Ed
3844 3875 .It Sy Example 22 No Showing the differences between a snapshot and a ZFS Dataset
3845 3876 The following example shows how to see what has changed between a prior
3846 3877 snapshot of a ZFS dataset and its current state.
3847 3878 The
3848 3879 .Fl F
3849 3880 option is used to indicate type information for the files affected.
3850 3881 .Bd -literal
3851 3882 # zfs diff -F tank/test@before tank/test
3852 3883 M / /tank/test/
3853 3884 M F /tank/test/linked (+1)
3854 3885 R F /tank/test/oldname -> /tank/test/newname
3855 3886 - F /tank/test/deleted
3856 3887 + F /tank/test/created
3857 3888 M F /tank/test/modified
3858 3889 .Ed
3859 3890 .El
3860 3891 .Sh INTERFACE STABILITY
3861 3892 .Sy Committed .
3862 3893 .Sh SEE ALSO
3863 3894 .Xr gzip 1 ,
3864 3895 .Xr ssh 1 ,
3865 3896 .Xr mount 1M ,
3866 3897 .Xr share 1M ,
3867 3898 .Xr sharemgr 1M ,
3868 3899 .Xr unshare 1M ,
3869 3900 .Xr zonecfg 1M ,
3870 3901 .Xr zpool 1M ,
3871 3902 .Xr chmod 2 ,
3872 3903 .Xr stat 2 ,
3873 3904 .Xr write 2 ,
3874 3905 .Xr fsync 3C ,
3875 3906 .Xr dfstab 4 ,
3876 3907 .Xr acl 5 ,
3877 3908 .Xr attributes 5
↓ open down ↓ |
2272 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX