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