1zfs(1M)                 System Administration Commands                 zfs(1M)
2
3
4

NAME

6       zfs - configures ZFS file systems
7

SYNOPSIS

9       zfs [-?]
10
11
12       zfs create [-p] [-o property=value] ... filesystem
13
14
15       zfs create [-ps] [-b blocksize] [-o property=value] ... -V size volume
16
17
18       zfs destroy [-rRf] filesystem|volume
19
20
21       zfs destroy [-rRd] snapshot
22
23
24       zfs snapshot [-r] [-o property=value]...
25             filesystem@snapname|volume@snapname
26
27
28       zfs rollback [-rRf] snapshot
29
30
31       zfs clone [-p] [-o property=value] ... snapshot filesystem|volume
32
33
34       zfs promote clone-filesystem
35
36
37       zfs rename filesystem|volume|snapshot
38            filesystem|volume|snapshot
39
40
41       zfs rename [-p] filesystem|volume filesystem|volume
42
43
44       zfs rename -r snapshot snapshot
45
46
47       zfs list [-r|-d depth][-H][-o property[,...]] [-t type[,...]]
48            [-s property] ... [-S property] ... [filesystem|volume|snapshot] ...
49
50
51       zfs set property=value filesystem|volume|snapshot ...
52
53
54       zfs get [-r|-d depth][-Hp][-o all | field[,...]] [-s source[,...]]
55            all | property[,...] filesystem|volume|snapshot ...
56
57
58       zfs inherit [-rS] property filesystem|volume|snapshot ...
59
60
61       zfs upgrade [-v]
62
63
64       zfs upgrade [-r] [-V version] -a | filesystem
65
66
67       zfs userspace [-niHp] [-o field[,...]] [-sS field] ...
68            [-t type [,...]] filesystem|snapshot
69
70
71       zfs groupspace [-niHp] [-o field[,...]] [-sS field] ...
72            [-t type [,...]] filesystem|snapshot
73
74
75       zfs mount
76
77
78       zfs mount [-vO] [-o options] -a | filesystem
79
80
81       zfs unmount [-f] -a | filesystem|mountpoint
82
83
84       zfs share -a | filesystem
85
86
87       zfs unshare -a filesystem|mountpoint
88
89
90       zfs send [-DvRp] [-[iI] snapshot] snapshot
91
92
93       zfs receive [-vnFu] filesystem|volume|snapshot
94
95
96       zfs receive [-vnFu] [-d | -e] filesystem
97
98
99       zfs allow filesystem|volume
100
101
102       zfs allow [-ldug] "everyone"|user|group[,...] perm|@setname[,...]
103            filesystem|volume
104
105
106       zfs allow [-ld] -e perm|@setname[,...] filesystem|volume
107
108
109       zfs allow -c perm|@setname[,...] filesystem|volume
110
111
112       zfs allow -s @setname perm|@setname[,...] filesystem|volume
113
114
115       zfs unallow [-rldug] "everyone"|user|group[,...] [perm|@setname[,... ]]
116            filesystem|volume
117
118
119       zfs unallow [-rld] -e [perm|@setname[,... ]] filesystem|volume
120
121
122       zfs unallow [-r] -c [perm|@setname[ ... ]] filesystem|volume
123
124
125       zfs unallow [-r] -s @setname [perm|@setname[,... ]] filesystem|volume
126
127
128       zfs hold [-r] tag snapshot...
129
130
131       zfs holds [-r] snapshot...
132
133
134       zfs release [-r] tag snapshot...
135
136

DESCRIPTION

138       The  zfs  command configures ZFS datasets within a ZFS storage pool, as
139       described in zpool(1M). A dataset is identified by a unique path within
140       the ZFS namespace. For example:
141
142         pool/{filesystem,volume,snapshot}
143
144
145
146
147       where the maximum length of a dataset name is MAXNAMELEN (256 bytes).
148
149
150       A dataset can be one of the following:
151
152       file system
153
154           A ZFS dataset of type filesystem can be mounted within the standard
155           system namespace and behaves like other  file  systems.  While  ZFS
156           file systems are designed to be POSIX compliant, known issues exist
157           that prevent compliance in some cases. Applications that depend  on
158           standards  conformance  might fail due to nonstandard behavior when
159           checking file system free space.
160
161
162       volume
163
164           A logical volume exported as a raw or block device.  This  type  of
165           dataset  should only be used under special circumstances. File sys‐
166           tems are typically used in most environments.
167
168
169       snapshot
170
171           A read-only version of a file system or volume at a given point  in
172           time. It is specified as filesystem@name or volume@name.
173
174
175   ZFS File System Hierarchy
176       A  ZFS  storage  pool  is  a logical collection of devices that provide
177       space for datasets. A storage pool is also the root  of  the  ZFS  file
178       system hierarchy.
179
180
181       The root of the pool can be accessed as a file system, such as mounting
182       and unmounting, taking snapshots, and setting properties. The  physical
183       storage characteristics, however, are managed by the zpool(1M) command.
184
185
186       See zpool(1M) for more information on creating and administering pools.
187
188   Snapshots
189       A  snapshot  is  a read-only copy of a file system or volume. Snapshots
190       can be created extremely quickly, and initially consume  no  additional
191       space  within  the pool. As data within the active dataset changes, the
192       snapshot consumes more data than would otherwise  be  shared  with  the
193       active dataset.
194
195
196       Snapshots  can have arbitrary names. Snapshots of volumes can be cloned
197       or rolled back, but cannot be accessed independently.
198
199
200       File system snapshots can be accessed under the .zfs/snapshot directory
201       in  the root of the file system. Snapshots are automatically mounted on
202       demand and may be unmounted at regular intervals. The visibility of the
203       .zfs directory can be controlled by the snapdir property.
204
205   Clones
206       A  clone is a writable volume or file system whose initial contents are
207       the same as another dataset. As with snapshots,  creating  a  clone  is
208       nearly instantaneous, and initially consumes no additional space.
209
210
211       Clones  can only be created from a snapshot. When a snapshot is cloned,
212       it creates an implicit dependency between the parent  and  child.  Even
213       though  the  clone  is created somewhere else in the dataset hierarchy,
214       the original snapshot cannot be destroyed as long as  a  clone  exists.
215       The  origin  property  exposes this dependency, and the destroy command
216       lists any such dependencies, if they exist.
217
218
219       The clone parent-child dependency relationship can be reversed by using
220       the  promote subcommand. This causes the "origin" file system to become
221       a clone of the specified  file  system,  which  makes  it  possible  to
222       destroy the file system that the clone was created from.
223
224   Mount Points
225       Creating a ZFS file system is a simple operation, so the number of file
226       systems per system is likely to be numerous. To  cope  with  this,  ZFS
227       automatically  manages mounting and unmounting file systems without the
228       need to edit the /etc/vfstab file. All automatically managed file  sys‐
229       tems are mounted by ZFS at boot time.
230
231
232       By  default,  file  systems  are mounted under /path, where path is the
233       name of the file system in the ZFS namespace. Directories  are  created
234       and destroyed as needed.
235
236
237       A  file  system can also have a mount point set in the mountpoint prop‐
238       erty. This directory is created as needed, and ZFS automatically mounts
239       the file system when the zfs mount -a command is invoked (without edit‐
240       ing /etc/vfstab). The mountpoint  property  can  be  inherited,  so  if
241       pool/home has a mount point of /export/stuff, then pool/home/user auto‐
242       matically inherits a mount point of /export/stuff/user.
243
244
245       A file system mountpoint property of none prevents the file system from
246       being mounted.
247
248
249       If  needed, ZFS file systems can also be managed with traditional tools
250       (mount, umount, /etc/vfstab). If a file system's mount point is set  to
251       legacy,  ZFS makes no attempt to manage the file system, and the admin‐
252       istrator is responsible for mounting and unmounting the file system.
253
254   Zones
255       A ZFS file system can be added  to  a  non-global  zone  by  using  the
256       zonecfg  add  fs  subcommand. A ZFS file system that is added to a non-
257       global zone must have its mountpoint property set to legacy.
258
259
260       The physical properties of an added file system are controlled  by  the
261       global  administrator. However, the zone administrator can create, mod‐
262       ify, or destroy files within the added file system,  depending  on  how
263       the file system is mounted.
264
265
266       A  dataset  can  also  be  delegated  to a non-global zone by using the
267       zonecfg add dataset subcommand. You cannot delegate a  dataset  to  one
268       zone  and  the  children  of the same dataset to another zone. The zone
269       administrator can change properties of the dataset or any of its  chil‐
270       dren.  However, the quota property is controlled by the global adminis‐
271       trator.
272
273
274       A ZFS volume can be added as a device to a non-global zone by using the
275       zonecfg  add device subcommand. However, its physical properties can be
276       modified only by the global administrator.
277
278
279       For more information about zonecfg syntax, see zonecfg(1M).
280
281
282       After a dataset is delegated to a non-global zone, the  zoned  property
283       is  automatically  set.  A  zoned  file system cannot be mounted in the
284       global zone, since the zone administrator might have to set  the  mount
285       point to an unacceptable value.
286
287
288       The  global administrator can forcibly clear the zoned property, though
289       this should be done with extreme care. The global administrator  should
290       verify  that  all  the  mount points are acceptable before clearing the
291       property.
292
293   Deduplication
294       Deduplication is the process for removing redundant data at  the block-
295       level,  reducing  the total amount of data stored. If a file system has
296       the dedup  property enabled, duplicate data  blocks  are  removed  syn‐
297       chronously.   The  result is that only unique data is stored and common
298       components are shared among files.
299
300   Native Properties
301       Properties are divided into two  types,  native  properties  and  user-
302       defined  (or "user") properties. Native properties either export inter‐
303       nal statistics or control ZFS behavior. In addition, native  properties
304       are either editable or read-only. User properties have no effect on ZFS
305       behavior, but you can use them to annotate datasets in a  way  that  is
306       meaningful in your environment. For more information about user proper‐
307       ties, see the "User Properties" section, below.
308
309
310       Every dataset has a set of properties that export statistics about  the
311       dataset  as well as control various behaviors. Properties are inherited
312       from the parent unless overridden by the child. Some  properties  apply
313       only  to  certain  types  of  datasets (file systems, volumes, or snap‐
314       shots).
315
316
317       The values of numeric properties can be specified using  human-readable
318       suffixes  (for  example,  k,  KB,  M,  Gb,  and  so  forth, up to Z for
319       zettabyte). The following are all valid (and equal) specifications:
320
321         1536M, 1.5g, 1.50GB
322
323
324
325
326       The values of non-numeric properties are case  sensitive  and  must  be
327       lowercase, except for mountpoint, sharenfs, and sharesmb.
328
329
330       The  following  native properties consist of read-only statistics about
331       the dataset. These properties can be neither set, nor inherited. Native
332       properties apply to all dataset types unless otherwise noted.
333
334       available
335
336           The  amount of space available to the dataset and all its children,
337           assuming that there is no other activity in the pool. Because space
338           is  shared within a pool, availability can be limited by any number
339           of factors, including physical pool size, quotas, reservations,  or
340           other datasets within the pool.
341
342           This property can also be referred to by its shortened column name,
343           avail.
344
345
346       compressratio
347
348           The compression ratio achieved for this  dataset,  expressed  as  a
349           multiplier.  Compression  can be turned on by running: zfs set com‐
350           pression=on dataset. The default value is off.
351
352
353       creation
354
355           The time this dataset was created.
356
357
358       defer_destroy
359
360           This property is on if the snapshot has been  marked  for  deferred
361           destroy  by  using the zfs destroy -d command. Otherwise, the prop‐
362           erty is off.
363
364
365       mounted
366
367           For file systems, indicates whether the file  system  is  currently
368           mounted. This property can be either yes or no.
369
370
371       origin
372
373           For  cloned  file  systems  or volumes, the snapshot from which the
374           clone was created. The origin cannot be destroyed (even with the -r
375           or -f options) so long as a clone exists.
376
377
378       referenced
379
380           The amount of data that is accessible by this dataset, which may or
381           may not be shared with other datasets in the pool. When a  snapshot
382           or  clone  is  created,  it initially references the same amount of
383           space as the file system or snapshot it was created from, since its
384           contents are identical.
385
386           This property can also be referred to by its shortened column name,
387           refer.
388
389
390       type
391
392           The type of dataset: filesystem, volume, or snapshot.
393
394
395       used
396
397           The amount of space consumed by this dataset and  all  its  descen‐
398           dents.  This  is  the  value that is checked against this dataset's
399           quota and  reservation.  The  space  used  does  not  include  this
400           dataset's  reservation, but does take into account the reservations
401           of any descendent datasets. The amount of space that a dataset con‐
402           sumes  from  its  parent,  as  well as the amount of space that are
403           freed if this dataset is recursively destroyed, is the  greater  of
404           its space used and its reservation.
405
406           When  snapshots  (see  the  "Snapshots" section) are created, their
407           space is initially shared between the snapshot and the file system,
408           and  possibly  with previous snapshots. As the file system changes,
409           space that was previously shared becomes unique  to  the  snapshot,
410           and  counted  in  the snapshot's space used. Additionally, deleting
411           snapshots can increase the amount of space unique to (and used  by)
412           other snapshots.
413
414           The  amount  of  space used, available, or referenced does not take
415           into  account  pending  changes.  Pending  changes  are   generally
416           accounted  for  within a few seconds. Committing a change to a disk
417           using fsync(3c) or O_SYNC does not necessarily guarantee  that  the
418           space usage information is updated immediately.
419
420
421       usedby*
422
423           The usedby* properties decompose the used properties into the vari‐
424           ous reasons that space is used. Specifically, used = usedbychildren
425           +  usedbydataset  +  usedbyrefreservation +, usedbysnapshots. These
426           properties are only available for datasets created on  zpool  "ver‐
427           sion 13" pools.
428
429
430       usedbychildren
431
432           The  amount  of space used by children of this dataset, which would
433           be freed if all the dataset's children were destroyed.
434
435
436       usedbydataset
437
438           The amount of space used by this dataset  itself,  which  would  be
439           freed  if  the  dataset  were  destroyed  (after first removing any
440           refreservation and destroying any necessary  snapshots  or  descen‐
441           dents).
442
443
444       usedbyrefreservation
445
446           The  amount  of space used by a refreservation set on this dataset,
447           which would be freed if the refreservation was removed.
448
449
450       usedbysnapshots
451
452           The amount of space consumed by snapshots of this dataset. In  par‐
453           ticular,  it  is  the amount of space that would be freed if all of
454           this dataset's snapshots were destroyed. Note that this is not sim‐
455           ply  the sum of the snapshots' used properties because space can be
456           shared by multiple snapshots.
457
458
459       userused@user
460
461           The amount of space consumed by the specified user in this dataset.
462           Space  is charged to the owner of each file, as displayed by ls -l.
463           The amount of space charged is displayed by du and ls -s.  See  the
464           zfs userspace subcommand for more information.
465
466           Unprivileged  users can access only their own space usage. The root
467           user, or a user who has been granted the  userused  privilege  with
468           zfs allow, can access everyone's usage.
469
470           The  userused@...  properties are not displayed by zfs get all. The
471           user's name must be appended after the @ symbol, using one  of  the
472           following forms:
473
474               o      POSIX name (for example, joe)
475
476               o      POSIX numeric ID (for example, 789)
477
478               o      SID name (for example, joe.smith@mydomain)
479
480               o      SID numeric ID (for example, S-1-123-456-789)
481
482
483       userrefs
484
485           This  property is set to the number of user holds on this snapshot.
486           User holds are set by using the zfs hold command.
487
488
489       groupused@group
490
491           The amount of  space  consumed  by  the  specified  group  in  this
492           dataset.  Space  is charged to the group of each file, as displayed
493           by ls -l. See the userused@user property for more information.
494
495           Unprivileged users can only access their own groups'  space  usage.
496           The  root user, or a user who has been granted the groupused privi‐
497           lege with zfs allow, can access all groups' usage.
498
499
500       volblocksize=blocksize
501
502           For volumes, specifies the block size of the volume. The  blocksize
503           cannot be changed once the volume has been written, so it should be
504           set at volume creation time. The default blocksize for volumes is 8
505           Kbytes. Any power of 2 from 512 bytes to 128 Kbytes is valid.
506
507           This property can also be referred to by its shortened column name,
508           volblock.
509
510
511
512       The following native properties can be used to change the behavior of a
513       ZFS dataset.
514
515       aclinherit=discard | noallow | restricted | passthrough | passthrough-x
516
517           Controls  how  ACL entries are inherited when files and directories
518           are created. A file system with an aclinherit property  of  discard
519           does  not inherit any ACL entries. A file system with an aclinherit
520           property value of noallow only  inherits  inheritable  ACL  entries
521           that specify "deny" permissions. The property value restricted (the
522           default) removes the write_acl and write_owner permissions when the
523           ACL  entry  is inherited. A file system with an aclinherit property
524           value of passthrough inherits all inheritable ACL  entries  without
525           any  modifications made to the ACL entries when they are inherited.
526           A file system with an aclinherit property  value  of  passthrough-x
527           has  the  same  meaning  as  passthrough,  except  that the owner@,
528           group@, and everyone@ ACEs inherit the execute permission  only  if
529           the file creation mode also requests the execute bit.
530
531           When  the  property  value is set to passthrough, files are created
532           with a mode determined by the inheritable ACEs. If  no  inheritable
533           ACEs exist that affect the mode, then the mode is set in accordance
534           to the requested mode from the application.
535
536
537       aclmode=discard | groupmask | passthrough
538
539           Controls how an ACL is modified during chmod(2). A file system with
540           an  aclmode property of discard deletes all ACL entries that do not
541           represent the mode of the file. An aclmode  property  of  groupmask
542           (the  default)  reduces  user or group permissions. The permissions
543           are reduced, such that they are no greater than the  group  permis‐
544           sion  bits,  unless it is a user entry that has the same UID as the
545           owner of the file or directory. In this case, the  ACL  permissions
546           are reduced so that they are no greater than owner permission bits.
547           A file system with an aclmode  property  of  passthrough  indicates
548           that  no changes are made to the ACL other than generating the nec‐
549           essary ACL entries to represent the new mode of the file or  direc‐
550           tory.
551
552
553       atime=on | off
554
555           Controls whether the access time for files is updated when they are
556           read. Turning this property off avoids producing write traffic when
557           reading  files  and  can  result  in significant performance gains,
558           though it might confuse mailers and other  similar  utilities.  The
559           default value is on.
560
561
562       canmount=on | off | noauto
563
564           If  this property is set to off, the file system cannot be mounted,
565           and is ignored by zfs mount -a. Setting this  property  to  off  is
566           similar to setting the mountpoint property to none, except that the
567           dataset still has a normal mountpoint property, which can be inher‐
568           ited.  Setting  this  property  to  off  allows datasets to be used
569           solely as a mechanism to inherit properties. One example of setting
570           canmount=off  is  to have two datasets with the same mountpoint, so
571           that the children of both datasets appear in  the  same  directory,
572           but might have different inherited characteristics.
573
574           When  the  noauto  option is set, a dataset can only be mounted and
575           unmounted explicitly. The dataset is not mounted automatically when
576           the  dataset  is  created or imported, nor is it mounted by the zfs
577           mount -a command or unmounted by the zfs unmount -a command.
578
579           This property is not inherited.
580
581
582       checksum=on | off | fletcher2,| fletcher4 | sha256
583
584           Controls the checksum used to verify data  integrity.  The  default
585           value  is  on, which automatically selects an appropriate algorithm
586           (currently, fletcher4, but this may change in future releases). The
587           value  off  disables  integrity  checking  on  user data. Disabling
588           checksums is NOT a recommended practice.
589
590           Changing this property affects only newly-written data.
591
592
593       compression=on | off | lzjb | gzip | gzip-N | zle
594
595           Controls the compression algorithm used for this dataset. The  lzjb
596           compression  algorithm is optimized for performance while providing
597           decent data compression. Setting compression to on  uses  the  lzjb
598           compression algorithm. The gzip compression algorithm uses the same
599           compression as the gzip(1) command. You can specify the gzip  level
600           by using the value gzip-N where N is an integer from 1 (fastest) to
601           9 (best compression ratio). Currently, gzip is equivalent to gzip-6
602           (which is also the default for gzip(1)).
603
604           This  property can also be referred to by its shortened column name
605           compress. Changing this property affects only newly-written data.
606
607
608       copies=1 | 2 | 3
609
610           Controls the number of copies of  data  stored  for  this  dataset.
611           These  copies  are  in  addition  to any redundancy provided by the
612           pool, for example, mirroring or RAID-Z. The copies  are  stored  on
613           different  disks, if possible. The space used by multiple copies is
614           charged to the associated file and dataset, changing the used prop‐
615           erty and counting against quotas and reservations.
616
617           Changing  this property only affects newly-written data. Therefore,
618           set this property at file system creation  time  by  using  the  -o
619           copies=N option.
620
621
622       dedup=on | off | verify | sha256[,verify]
623
624           Controls  whether  deduplication  is  in  effect for a dataset. The
625           default value is off. The default checksum used  for  deduplication
626           is  sha256  (subject  to  change). When dedup is enabled, the dedup
627           checksum algorithm overrides the  checksum  property.  Setting  the
628           value to verify is equivalent to specifying sha256,verify.
629
630           If  the  property  is set to verify, then, whenever two blocks have
631           the same signature, ZFS will do a byte-for-byte comparison with the
632           existing block to ensure that the contents are identical.
633
634
635       devices=on | off
636
637           Controls  whether  device  nodes can be opened on this file system.
638           The default value is on.
639
640
641       exec=on | off
642
643           Controls whether processes can be executed from  within  this  file
644           system. The default value is on.
645
646
647       mlslabel=label | none
648
649           The  mlslabel  property is a sensitivity label that determines if a
650           dataset  can be mounted in a zone on a system with  Trusted  Exten‐
651           sions enabled. If the labeled dataset matches the labeled zone, the
652           dataset can be mounted  and accessed from the labeled zone.
653
654           When the mlslabel property is not set, the default value  is  none.
655           Setting  the   mlslabel  property to none is equivalent to removing
656           the property.
657
658           The mlslabel property can be modified only when Trusted  Extensions
659           is enabled and only with appropriate privilege. Rights to modify it
660           cannot be delegated. When changing a label to  a  higher  label  or
661           setting the initial dataset label, the {PRIV_FILE_UPGRADE_SL} priv‐
662           ilege is required. When changing a label to a lower  label  or  the
663           default (none), the {PRIV_FILE_DOWNGRADE_SL} privilege is required.
664           Changing the dataset to labels other than the default can  be  done
665           only  when  the  dataset  is  not  mounted. When a dataset with the
666           default label is mounted into a labeled-zone, the  mount  operation
667           automatically sets the mlslabel property to the label of that zone.
668
669           When  Trusted  Extensions  is  not  enabled, only datasets with the
670           default label (none) can be mounted.
671
672
673       mountpoint=path | none | legacy
674
675           Controls the mount point used for this file system. See the  "Mount
676           Points" section for more information on how this property is used.
677
678           When the mountpoint property is changed for a file system, the file
679           system and any children that inherit the mount point are unmounted.
680           If  the new value is legacy, then they remain unmounted. Otherwise,
681           they are automatically remounted in the new location if  the  prop‐
682           erty  was previously legacy or none, or if they were mounted before
683           the property was changed. In addition, any shared file systems  are
684           unshared and shared in the new location.
685
686
687       nbmand=on | off
688
689           Controls whether the file system should be mounted with nbmand (Non
690           Blocking mandatory locks). This is used for CIFS  clients.  Changes
691           to  this property only take effect when the file system is umounted
692           and remounted. See mount(1M) for more information on nbmand mounts.
693
694
695       primarycache=all | none | metadata
696
697           Controls what is cached in the primary cache (ARC). If  this  prop‐
698           erty  is set to all, then both user data and metadata is cached. If
699           this property is set to none, then neither user data  nor  metadata
700           is  cached. If this property is set to metadata, then only metadata
701           is cached. The default value is all.
702
703
704       quota=size | none
705
706           Limits the amount of space a dataset and its descendents  can  con‐
707           sume.  This  property  enforces a hard limit on the amount of space
708           used. This includes all space consumed  by  descendents,  including
709           file  systems  and  snapshots. Setting a quota on a descendent of a
710           dataset that already has a quota does not override  the  ancestor's
711           quota, but rather imposes an additional limit.
712
713           Quotas cannot be set on volumes, as the volsize property acts as an
714           implicit quota.
715
716
717       userquota@user=size | none
718
719           Limits the amount of space consumed by the specified user.  Similar
720           to  the refquota property, the userquota space calculation does not
721           include space that is used by descendent datasets,  such  as  snap‐
722           shots  and  clones.  User  space  consumption  is identified by the
723           userspace@user property.
724
725           Enforcement of user quotas may be delayed by several seconds.  This
726           delay  means  that  a user might exceed her quota before the system
727           notices that she is over quota. The  system  would  then  begin  to
728           refuse  additional  writes  with the EDQUOT error message . See the
729           zfs userspace subcommand for more information.
730
731           Unprivileged users can only access their own groups'  space  usage.
732           The  root user, or a user who has been granted the userquota privi‐
733           lege with zfs allow, can get and set everyone's quota.
734
735           This property is not available on volumes, on file  systems  before
736           version 4, or on pools before version 15. The userquota@... proper‐
737           ties are not displayed by zfs get all.  The  user's  name  must  be
738           appended after the @ symbol, using one of the following forms:
739
740               o      POSIX name (for example, joe)
741
742               o      POSIX numeric ID (for example, 789)
743
744               o      SID name (for example, joe.smith@mydomain)
745
746               o      SID numeric ID (for example, S-1-123-456-789)
747
748
749       groupquota@group=size | none
750
751           Limits  the  amount of space consumed by the specified group. Group
752           space consumption is identified by the userquota@user property.
753
754           Unprivileged users can access only their own groups'  space  usage.
755           The root user, or a user who has been granted the groupquota privi‐
756           lege with zfs allow, can get and set all groups' quotas.
757
758
759       readonly=on | off
760
761           Controls whether this dataset can be modified. The default value is
762           off.
763
764           This property can also be referred to by its shortened column name,
765           rdonly.
766
767
768       recordsize=size
769
770           Specifies a suggested block size for files in the file system. This
771           property  is  designed  solely for use with database workloads that
772           access files in fixed-size records. ZFS automatically  tunes  block
773           sizes according to internal algorithms optimized for typical access
774           patterns.
775
776           For databases that create very large files but access them in small
777           random  chunks,  these  algorithms  may be suboptimal. Specifying a
778           recordsize greater than or equal to the record size of the database
779           can  result  in significant performance gains. Use of this property
780           for general purpose file systems is strongly discouraged,  and  may
781           adversely affect performance.
782
783           The  size specified must be a power of two greater than or equal to
784           512 and less than or equal to 128 Kbytes.
785
786           Changing the file system's recordsize affects  only  files  created
787           afterward; existing files are unaffected.
788
789           This property can also be referred to by its shortened column name,
790           recsize.
791
792
793       refquota=size | none
794
795           Limits the amount of space a dataset  can  consume.  This  property
796           enforces  a hard limit on the amount of space used. This hard limit
797           does not include space used by descendents, including file  systems
798           and snapshots.
799
800
801       refreservation=size | none
802
803           The  minimum amount of space guaranteed to a dataset, not including
804           its descendents. When the amount of space used is below this value,
805           the  dataset is treated as if it were taking up the amount of space
806           specified by  refreservation.  The  refreservation  reservation  is
807           accounted  for  in  the  parent  datasets'  space  used, and counts
808           against the parent datasets' quotas and reservations.
809
810           If refreservation is set, a snapshot is only allowed  if  there  is
811           enough  free  pool space outside of this reservation to accommodate
812           the current number of "referenced" bytes in the dataset.
813
814           This property can also be referred to by its shortened column name,
815           refreserv.
816
817
818       reservation=size | none
819
820           The minimum amount of space guaranteed to a dataset and its descen‐
821           dents. When the amount of space  used  is  below  this  value,  the
822           dataset  is  treated  as  if  it were taking up the amount of space
823           specified by its reservation. Reservations are accounted for in the
824           parent datasets' space used, and count against the parent datasets'
825           quotas and reservations.
826
827           This property can also be referred to by its shortened column name,
828           reserv.
829
830
831       secondarycache=all | none | metadata
832
833           Controls  what  is  cached  in the secondary cache (L2ARC). If this
834           property is set to all, then both user data and metadata is cached.
835           If  this  property is set to none, then neither user data nor meta‐
836           data is cached. If this property is  set  to  metadata,  then  only
837           metadata is cached. The default value is all.
838
839
840       setuid=on | off
841
842           Controls  whether the set-UID bit is respected for the file system.
843           The default value is on.
844
845
846       shareiscsi=on | off
847
848           Like the sharenfs property, shareiscsi indicates whether a ZFS vol‐
849           ume  is exported as an iSCSI target. The acceptable values for this
850           property are on, off, and type=disk. The default value is  off.  In
851           the  future,  other  target  types might be supported. For example,
852           tape.
853
854           You might want to set shareiscsi=on for a file system so  that  all
855           ZFS  volumes within the file system are shared by default. However,
856           setting this property on a file system has no direct effect.
857
858
859       sharesmb=on | off | opts
860
861           Controls whether the file system is shared  by  using  the  Solaris
862           CIFS  service,  and what options are to be used. A file system with
863           the sharesmb property set to off  is  managed  through  traditional
864           tools such as sharemgr(1M). Otherwise, the file system is automati‐
865           cally shared and unshared with the zfs share and zfs  unshare  com‐
866           mands.  If  the  property is set to on, the sharemgr(1M) command is
867           invoked with no options. Otherwise,  the  sharemgr(1M)  command  is
868           invoked with options equivalent to the contents of this property.
869
870           Because SMB shares requires a resource name, a unique resource name
871           is constructed from the dataset name. The  constructed  name  is  a
872           copy  of the dataset name except that the characters in the dataset
873           name, which would be illegal in the  resource  name,  are  replaced
874           with  underscore  (_)  characters. A pseudo property "name" is also
875           supported that allows you to replace the data set name with a spec‐
876           ified  name.  The specified name is then used to replace the prefix
877           dataset in the case of inheritance. For  example,  if  the  dataset
878           data/home/john  is  set  to  name=john,  then  data/home/john has a
879           resource name of john. If a child dataset  of  data/home/john/back‐
880           ups, it has a resource name of john_backups.
881
882           When SMB shares are created, the SMB share name appears as an entry
883           in the .zfs/shares directory. You can use the ls or  chmod  command
884           to display the share-level ACLs on the entries in this directory.
885
886           When  the  sharesmb  property is changed for a dataset, the dataset
887           and any children inheriting the property are re-shared with the new
888           options, only if the property was previously set to off, or if they
889           were shared before the property was changed. If the new property is
890           set to off, the file systems are unshared.
891
892
893       sharenfs=on | off | opts
894
895           Controls  whether  the  file  system  is  shared  via NFS, and what
896           options are used. A file system with a sharenfs property of off  is
897           managed  through  traditional tools such as share(1M), unshare(1M),
898           and dfstab(4). Otherwise, the file system is  automatically  shared
899           and  unshared  with  the zfs share and zfs unshare commands. If the
900           property is set to on, the share(1M) command  is  invoked  with  no
901           options.  Otherwise,  the share(1M) command is invoked with options
902           equivalent to the contents of this property.
903
904           When the sharenfs property is changed for a  dataset,  the  dataset
905           and any children inheriting the property are re-shared with the new
906           options, only if the property was previously off, or if  they  were
907           shared before the property was changed. If the new property is off,
908           the file systems are unshared.
909
910
911       logbias = latency | throughput
912
913           Provides a hint to ZFS about handling of  synchronous  requests  in
914           this  dataset. If logbias is set to latency (the default), ZFS uses
915           the pool's log devices (if configured) to handle  the  requests  at
916           low  latency. If logbias is set to throughput, ZFS does not use the
917           configured pool log devices.  Instead,  ZFS  optimizes  synchronous
918           operations   for  global  pool  throughput  and  efficient  use  of
919           resources.
920
921
922       snapdir=hidden | visible
923
924           Controls whether the .zfs directory is hidden  or  visible  in  the
925           root  of  the  file system as discussed in the "Snapshots" section.
926           The default value is hidden.
927
928
929       version=1 | 2 | current
930
931           The on-disk version of this file system, which  is  independent  of
932           the  pool version. This property can only be set to later supported
933           versions. See the zfs upgrade command.
934
935
936       volsize=size
937
938           For volumes, specifies the logical size of the volume. By  default,
939           creating  a  volume  establishes  a  reservation of equal size. For
940           storage pools with a version number of 9 or higher,  a  refreserva‐
941           tion  is  set  instead.  Any changes to volsize are reflected in an
942           equivalent change to the reservation (or refreservation). The  vol‐
943           size  can  only be set to a multiple of volblocksize, and cannot be
944           zero.
945
946           The reservation is kept equal to the volume's logical size to  pre‐
947           vent  unexpected  behavior  for consumers. Without the reservation,
948           the volume could run out of space, resulting in undefined  behavior
949           or  data  corruption,  depending  on  how the volume is used. These
950           effects can also occur when the volume size is changed while it  is
951           in  use (particularly when shrinking the size). Extreme care should
952           be used when adjusting the volume size.
953
954           Though not recommended, a "sparse volume" (also known as "thin pro‐
955           visioning")  can  be created by specifying the -s option to the zfs
956           create -V command, or by changing the reservation after the  volume
957           has  been created. A "sparse volume" is a volume where the reserva‐
958           tion is less then the volume size. Consequently, writes to a sparse
959           volume  can  fail  with ENOSPC when the pool is low on space. For a
960           sparse volume, changes to volsize are not reflected in the reserva‐
961           tion.
962
963
964       vscan=on | off
965
966           Controls whether regular files should be scanned for viruses when a
967           file is opened and closed. In addition to enabling  this  property,
968           the  virus  scan service must also be enabled for virus scanning to
969           occur. The default value is off.
970
971
972       xattr=on | off
973
974           Controls whether extended attributes are enabled for this file sys‐
975           tem. The default value is on.
976
977
978       zoned=on | off
979
980           Controls whether the dataset is managed from a non-global zone. See
981           the "Zones" section for more information. The default value is off.
982
983
984
985       The following three properties cannot be changed after the file  system
986       is  created,  and therefore, should be set when the file system is cre‐
987       ated. If the properties are not set with the zfs create or zpool create
988       commands,  these  properties  are inherited from the parent dataset. If
989       the parent dataset lacks these properties due to  having  been  created
990       prior  to these features being supported, the new file system will have
991       the default values for these properties.
992
993       casesensitivity=sensitive | insensitive | mixed
994
995           Indicates whether the file name matching algorithm used by the file
996           system  should be case-sensitive, case-insensitive, or allow a com‐
997           bination of both styles of matching. The default value for the cas‐
998           esensitivity  property  is sensitive. Traditionally, UNIX and POSIX
999           file systems have case-sensitive file names.
1000
1001           The mixed value for the casesensitivity property indicates that the
1002           file  system can support requests for both case-sensitive and case-
1003           insensitive matching behavior. Currently, case-insensitive matching
1004           behavior  on  a file system that supports mixed behavior is limited
1005           to the Solaris CIFS server product. For more information about  the
1006           mixed value behavior, see the Solaris ZFS Administration Guide.
1007
1008
1009       normalization = none | formC | formD | formKC | formKD
1010
1011           Indicates  whether the file system should perform a unicode normal‐
1012           ization of file names whenever two file  names  are  compared,  and
1013           which normalization algorithm should be used. File names are always
1014           stored unmodified, names are normalized as part of  any  comparison
1015           process.  If this property is set to a legal value other than none,
1016           and the utf8only property was left unspecified, the utf8only  prop‐
1017           erty  is  automatically set to on. The default value of the normal‐
1018           ization property is none. This property cannot be changed after the
1019           file system is created.
1020
1021
1022       utf8only=on | off
1023
1024           Indicates  whether  the  file  system should reject file names that
1025           include characters that are not present in the UTF-8 character code
1026           set.  If  this property is explicitly set to off, the normalization
1027           property must either not be explicitly set or be set to  none.  The
1028           default  value for the utf8only property is off. This property can‐
1029           not be changed after the file system is created.
1030
1031
1032
1033       The casesensitivity, normalization, and utf8only  properties  are  also
1034       new  permissions  that can be assigned to non-privileged users by using
1035       the ZFS delegated administration feature.
1036
1037   Temporary Mount Point Properties
1038       When a file system is mounted,  either  through  mount(1M)  for  legacy
1039       mounts  or  the  zfs  mount  command for normal file systems, its mount
1040       options are set according to its properties.  The  correlation  between
1041       properties and mount options is as follows:
1042
1043             PROPERTY                MOUNT OPTION
1044              devices                 devices/nodevices
1045              exec                    exec/noexec
1046              readonly                ro/rw
1047              setuid                  setuid/nosetuid
1048              xattr                   xattr/noxattr
1049
1050
1051
1052
1053       In addition, these options can be set on a per-mount basis using the -o
1054       option, without affecting the property that is stored on disk. The val‐
1055       ues  specified  on  the  command line override the values stored in the
1056       dataset. The -nosuid option is an alias for  nodevices,nosetuid.  These
1057       properties  are  reported as "temporary" by the zfs get command. If the
1058       properties are changed while the dataset is mounted,  the  new  setting
1059       overrides any temporary settings.
1060
1061   User Properties
1062       In  addition  to the standard native properties, ZFS supports arbitrary
1063       user properties. User properties have no effect on  ZFS  behavior,  but
1064       applications  or administrators can use them to annotate datasets (file
1065       systems, volumes, and snapshots).
1066
1067
1068       User property names must contain a colon (:) character  to  distinguish
1069       them  from  native properties. They may contain lowercase letters, num‐
1070       bers, and the following punctuation characters: colon  (:),  dash  (-),
1071       period  (.),  and  underscore  (_). The expected convention is that the
1072       property name is divided into two portions such as module:property, but
1073       this  namespace  is  not enforced by ZFS. User property names can be at
1074       most 256 characters, and cannot begin with a dash (-).
1075
1076
1077       When making programmatic use of user properties, it  is  strongly  sug‐
1078       gested  to  use  a reversed DNS domain name for the module component of
1079       property names to reduce the chance  that  two  independently-developed
1080       packages  use  the  same property name for different purposes. Property
1081       names beginning with com.sun. are reserved for use by Sun Microsystems.
1082
1083
1084       The values of user properties are arbitrary strings, are always  inher‐
1085       ited,  and  are  never  validated.  All of the commands that operate on
1086       properties (zfs list, zfs get, zfs set, and so forth) can  be  used  to
1087       manipulate  both  native  properties  and  user properties. Use the zfs
1088       inherit command to clear a user property  .  If  the  property  is  not
1089       defined  in any parent dataset, it is removed entirely. Property values
1090       are limited to 1024 characters.
1091
1092   ZFS Volumes as Swap or Dump Devices
1093       During an initial installation or a live upgrade from a UFS  file  sys‐
1094       tem,  a  swap  device and dump device are created on ZFS volumes in the
1095       ZFS root pool. By default, the swap area size is based on 1/2 the  size
1096       of  physical memory up to 2 Gbytes. The size of the dump device depends
1097       on the kernel's requirements at installation time. Separate ZFS volumes
1098       must  be used for the swap area and dump devices. Do not swap to a file
1099       on a ZFS file system. A ZFS swap file configuration is not supported.
1100
1101
1102       If you need to change your swap area or dump device after the system is
1103       installed  or  upgraded,  use the swap(1M) and dumpadm(1M) commands. If
1104       you need to change the size of your swap area or dump device,  see  the
1105       Solaris ZFS Administration Guide.
1106

SUBCOMMANDS

1108       All  subcommands  that modify state are logged persistently to the pool
1109       in their original form.
1110
1111       zfs ?
1112
1113           Displays a help message.
1114
1115
1116       zfs create [-p] [-o property=value] ... filesystem
1117
1118           Creates a new ZFS file system. The  file  system  is  automatically
1119           mounted  according  to  the  mountpoint property inherited from the
1120           parent.
1121
1122           -p
1123
1124               Creates all the non-existing parent datasets. Datasets  created
1125               in  this  manner  are  automatically  mounted  according to the
1126               mountpoint property inherited from their parent.  Any  property
1127               specified  on  the command line using the -o option is ignored.
1128               If the target filesystem already  exists,  the  operation  com‐
1129               pletes successfully.
1130
1131
1132           -o property=value
1133
1134               Sets  the  specified  property  as if the command zfs set prop‐
1135               erty=value was invoked at the same time the  dataset  was  cre‐
1136               ated.  Any  editable  ZFS  property can also be set at creation
1137               time. Multiple -o options can be specified. An error results if
1138               the same property is specified in multiple -o options.
1139
1140
1141
1142       zfs create [-ps] [-b blocksize] [-o property=value] ... -V size volume
1143
1144           Creates  a  volume  of  the given size. The volume is exported as a
1145           block device in /dev/zvol/{dsk,rdsk}/path, where path is  the  name
1146           of the volume in the ZFS namespace. The size represents the logical
1147           size as exported by the device. By default, a reservation of  equal
1148           size is created.
1149
1150           size  is  automatically  rounded  up  to  the nearest 128 Kbytes to
1151           ensure that the volume has an integral number of blocks  regardless
1152           of blocksize.
1153
1154           -p
1155
1156               Creates  all the non-existing parent datasets. Datasets created
1157               in this manner  are  automatically  mounted  according  to  the
1158               mountpoint  property  inherited from their parent. Any property
1159               specified on the command line using the -o option  is  ignored.
1160               If  the  target  filesystem  already exists, the operation com‐
1161               pletes successfully.
1162
1163
1164           -s
1165
1166               Creates a sparse volume with no reservation. See volsize in the
1167               Native  Properties  section  for  more information about sparse
1168               volumes.
1169
1170
1171           -o property=value
1172
1173               Sets the specified property as if the  zfs  set  property=value
1174               command  was  invoked at the same time the dataset was created.
1175               Any editable ZFS property can also be  set  at  creation  time.
1176               Multiple  -o  options can be specified. An error results if the
1177               same property is specified in multiple -o options.
1178
1179
1180           -b blocksize
1181
1182               Equivalent to -o  volblocksize=blocksize.  If  this  option  is
1183               specified  in  conjunction  with -o volblocksize, the resulting
1184               behavior is undefined.
1185
1186
1187
1188       zfs destroy [-rRf] filesystem|volume
1189
1190           Destroys the given dataset. By default, the  command  unshares  any
1191           file  systems  that are currently shared, unmounts any file systems
1192           that are currently mounted, and refuses to destroy a  dataset  that
1193           has active dependents (children or clones).
1194
1195           -r
1196
1197               Recursively destroy all children.
1198
1199
1200           -R
1201
1202               Recursively  destroy all dependents, including cloned file sys‐
1203               tems outside the target hierarchy.
1204
1205
1206           -f
1207
1208               Force an unmount of any file systems using the unmount -f  com‐
1209               mand.  This  option  has  no  effect  on  non-file  systems  or
1210               unmounted file systems.
1211
1212           Extreme care should be taken when applying either the -r or the  -f
1213           options,  as  they  can  destroy large portions of a pool and cause
1214           unexpected behavior for mounted file systems in use.
1215
1216
1217       zfs destroy [-rRd] snapshot
1218
1219           The given snapshot is destroyed immediately if and only if the  zfs
1220           destroy command without the -d option would have destroyed it. Such
1221           immediate destruction would occur, for example, if the snapshot had
1222           no clones and the user-initiated reference count were zero.
1223
1224           If  the  snapshot does not qualify for immediate destruction, it is
1225           marked for deferred deletion. In this state, it exists as a usable,
1226           visible  snapshot  until both of the preconditions listed above are
1227           met, at which point it is destroyed.
1228
1229           -d
1230
1231               Defer snapshot deletion.
1232
1233
1234           -r
1235
1236               Destroy (or mark for deferred deletion) all snapshots with this
1237               name in descendent file systems.
1238
1239
1240           -R
1241
1242               Recursively destroy all dependents.
1243
1244
1245
1246       zfs snapshot [-r] [-o property=value] ... filesystem@snapname|vol‐
1247       ume@snapname
1248
1249           Creates a snapshot with the given name. All previous  modifications
1250           by successful system calls to the file system are part of the snap‐
1251           shot. See the "Snapshots" section for details.
1252
1253           -r
1254
1255               Recursively create snapshots of all descendent datasets.  Snap‐
1256               shots  are  taken  atomically,  so that all recursive snapshots
1257               correspond to the same moment in time.
1258
1259
1260           -o property=value
1261
1262               Sets the specified property; see zfs create for details.
1263
1264
1265
1266       zfs rollback [-rRf] snapshot
1267
1268           Roll back the given dataset to a previous snapshot. When a  dataset
1269           is  rolled  back,  all  data that has changed since the snapshot is
1270           discarded, and the dataset reverts to the state at the time of  the
1271           snapshot.  By  default, the command refuses to roll back to a snap‐
1272           shot other than the most recent one. In order to do so, all  inter‐
1273           mediate snapshots must be destroyed by specifying the -r option.
1274
1275           The -rR options do not recursively destroy the child snapshots of a
1276           recursive  snapshot.  Only  the  top-level  recursive  snapshot  is
1277           destroyed  by  either  of  these options. To completely roll back a
1278           recursive snapshot, you must rollback the  individual  child  snap‐
1279           shots.
1280
1281           -r
1282
1283               Recursively  destroy  any  snapshots  more  recent than the one
1284               specified.
1285
1286
1287           -R
1288
1289               Recursively destroy any more recent snapshots, as well  as  any
1290               clones of those snapshots.
1291
1292
1293           -f
1294
1295               Used  with  the -R option to force an unmount of any clone file
1296               systems that are to be destroyed.
1297
1298
1299
1300       zfs clone [-p] [-o property=value] ... snapshot filesystem|volume
1301
1302           Creates a clone of the given snapshot. See the "Clones" section for
1303           details.  The  target  dataset  can  be located anywhere in the ZFS
1304           hierarchy, and is created as the same type as the original.
1305
1306           -p
1307
1308               Creates all the non-existing parent datasets. Datasets  created
1309               in  this  manner  are  automatically  mounted  according to the
1310               mountpoint property inherited from their parent. If the  target
1311               filesystem  or  volume  already exists, the operation completes
1312               successfully.
1313
1314
1315           -o property=value
1316
1317               Sets the specified property; see zfs create for details.
1318
1319
1320
1321       zfs promote clone-filesystem
1322
1323           Promotes a clone file system to no longer be dependent on its "ori‐
1324           gin"  snapshot.  This  makes it possible to destroy the file system
1325           that the clone was created from. The clone parent-child  dependency
1326           relationship  is reversed, so that the origin file system becomes a
1327           clone of the specified file system.
1328
1329           The snapshot that was cloned, and any snapshots  previous  to  this
1330           snapshot,  are  now owned by the promoted clone. The space they use
1331           moves from the origin file system to the promoted clone, so  enough
1332           space  must  be  available  to  accommodate these snapshots. No new
1333           space is consumed by this operation, but the  space  accounting  is
1334           adjusted. The promoted clone must not have any conflicting snapshot
1335           names of its own. The rename subcommand can be used to  rename  any
1336           conflicting snapshots.
1337
1338
1339       zfs rename filesystem|volume|snapshot
1340       filesystem|volume|snapshot
1341       zfs rename [-p] filesystem|volume filesystem|volume
1342
1343           Renames  the  given dataset. The new target can be located anywhere
1344           in the ZFS hierarchy, with the exception  of  snapshots.  Snapshots
1345           can  only  be renamed within the parent file system or volume. When
1346           renaming a snapshot, the parent file system of  the  snapshot  does
1347           not  need  to  be specified as part of the second argument. Renamed
1348           file systems can inherit new mount points, in which case  they  are
1349           unmounted and remounted at the new mount point.
1350
1351           -p
1352
1353               Creates  all  the nonexistent parent datasets. Datasets created
1354               in this manner  are  automatically  mounted  according  to  the
1355               mountpoint property inherited from their parent.
1356
1357
1358
1359       zfs rename -r snapshot snapshot
1360
1361           Recursively  rename the snapshots of all descendent datasets. Snap‐
1362           shots are the only dataset that can be renamed recursively.
1363
1364
1365       zfs list [-r|-d depth] [-H] [-o property[,...]] [ -t type[,...]] [ -s
1366       property ] ... [ -S property ] ... [filesystem|volume|snapshot] ...
1367
1368           Lists  the  property  information for the given datasets in tabular
1369           form. If specified, you can list property information by the  abso‐
1370           lute  pathname  or the relative pathname. By default, all file sys‐
1371           tems and volumes are displayed.  Snapshots  are  displayed  if  the
1372           listsnaps  property  is  on  (the  default  is off) . The following
1373           fields are displayed, name,used,available,referenced,mountpoint.
1374
1375           -H
1376
1377               Used for scripting mode. Do  not  print  headers  and  separate
1378               fields by a single tab instead of arbitrary white space.
1379
1380
1381           -r
1382
1383               Recursively  display any children of the dataset on the command
1384               line.
1385
1386
1387           -d depth
1388
1389               Recursively display any children of the dataset,  limiting  the
1390               recursion  to depth. A depth of 1 will display only the dataset
1391               and its direct children.
1392
1393
1394           -o property
1395
1396               A comma-separated list of properties to display.  The  property
1397               must be:
1398
1399                   o      One of the properties described in the "Native Prop‐
1400                          erties" section
1401
1402                   o      A user property
1403
1404                   o      The value name to display the dataset name
1405
1406                   o      The value space to display space usage properties on
1407                          file  systems  and  volumes.  This is a shortcut for
1408                          specifying  -o  name,avail,used,usedsnap,usedds,use‐
1409                          drefreserv,usedchild -t filesystem,volume syntax.
1410
1411
1412           -s property
1413
1414               A  property for sorting the output by column in ascending order
1415               based on the value of the property. The property must be one of
1416               the  properties  described  in the "Properties" section, or the
1417               special value name to sort by the dataset name. Multiple  prop‐
1418               erties  can be specified at one time using multiple -s property
1419               options. Multiple -s options are evaluated from left  to  right
1420               in decreasing order of importance.
1421
1422               The following is a list of sorting criteria:
1423
1424                   o      Numeric types sort in numeric order.
1425
1426                   o      String types sort in alphabetical order.
1427
1428                   o      Types  inappropriate  for a row sort that row to the
1429                          literal bottom, regardless of the  specified  order‐
1430                          ing.
1431
1432                   o      If  no  sorting  options  are specified the existing
1433                          behavior of zfs list is preserved.
1434
1435
1436           -S property
1437
1438               Same as the -s option, but  sorts  by  property  in  descending
1439               order.
1440
1441
1442           -t type
1443
1444               A  comma-separated  list of types to display, where type is one
1445               of filesystem, snapshot , volume, or all. For example, specify‐
1446               ing -t snapshot displays only snapshots.
1447
1448
1449
1450       zfs set property=value filesystem|volume|snapshot ...
1451
1452           Sets  the  property  to the given value for each dataset. Only some
1453           properties can be edited. See the  "Properties"  section  for  more
1454           information  on  what  properties can be set and acceptable values.
1455           Numeric values can be specified as exact values,  or  in  a  human-
1456           readable  form  with a suffix of B, K, M, G, T, P, E, Z (for bytes,
1457           kilobytes, megabytes, gigabytes, terabytes, petabytes, exabytes, or
1458           zettabytes, respectively). User properties can be set on snapshots.
1459           For more information, see the "User Properties" section.
1460
1461
1462       zfs get [-r|-d depth] [-Hp] [-o all | field[,...] [-s source[,...]] all
1463       | property[,...] filesystem|volume|snapshot ...
1464
1465           Displays  properties  for  the  given  datasets. If no datasets are
1466           specified, then the command displays properties for all datasets on
1467           the system. For each property, the following columns are displayed:
1468
1469                 name      Dataset name
1470                  property  Property name
1471                  value     Property value
1472                  source    Property source. Can either be local, default,
1473                            temporary, inherited, or none (-).
1474
1475
1476           All  columns  except  the RECEIVED column are displayed by default;
1477           specify particular or all columns, using the -o option.  This  com‐
1478           mand takes a comma-separated list of properties as described in the
1479           "Native Properties" and "User Properties" sections.
1480
1481           The special value all can be used to display  all  properties  that
1482           apply  to  the  given  dataset's type (filesystem, volume, or snap‐
1483           shot).
1484
1485           -r
1486
1487               Recursively display properties for any children.
1488
1489
1490           -d depth
1491
1492               Recursively display any children of the dataset,  limiting  the
1493               recursion  to depth. A depth of 1 will display only the dataset
1494               and its direct children.
1495
1496
1497           -H
1498
1499               Display output in a form more easily  parsed  by  scripts.  Any
1500               headers  are  omitted, and fields are explicitly separated by a
1501               single tab instead of an arbitrary amount of space.
1502
1503
1504           -o field
1505
1506               Set of fields to display. One or more of:
1507
1508                 name,property,value,received,source
1509
1510
1511               Present multiple fields as a comma-separated list. The  default
1512               value is:
1513
1514                 name,property,value,source
1515
1516
1517               The keyword all specifies all sources.
1518
1519
1520           -s source
1521
1522               A  comma-separated list of sources to display. Those properties
1523               coming from a source other than those in this list are ignored.
1524               Each source must be one of the following:
1525
1526                 local,default,inherited,temporary,received,none
1527
1528
1529               The default value is all sources.
1530
1531
1532           -p
1533
1534               Display numbers in parseable (exact) values.
1535
1536
1537
1538       zfs inherit [-rS] property filesystem|volume|snapshot ...
1539
1540           Clears  the  specified property, causing it to be inherited from an
1541           ancestor. If no ancestor has the property  set,  then  the  default
1542           value  is  used.  See  the  "Properties"  section  for a listing of
1543           default values, and details on which properties can be inherited.
1544
1545           -r
1546
1547               Recursively inherit the given property for all children.
1548
1549
1550           -S
1551
1552               Revert to the received property value, if any. If the  property
1553               does  not have a received value, the behavior of zfs inherit -S
1554               is the same as zfs inherit without -S.  If  the  property  does
1555               have  a  received  value,  zfs inherit masks the received value
1556               with the inherited value until zfs inherit -S  reverts  to  the
1557               received value.
1558
1559
1560
1561       zfs upgrade [-v]
1562
1563           Displays  a  list of file systems that are not the most recent ver‐
1564           sion.
1565
1566
1567       zfs upgrade [-r] [-V version] [-a | filesystem]
1568
1569           Upgrades file systems to a new on-disk version. Once this is  done,
1570           the  file  systems  will no longer be accessible on systems running
1571           older versions of the software. zfs send streams generated from new
1572           snapshots  of these file systems cannot be accessed on systems run‐
1573           ning older versions of the software.
1574
1575           In general, the file system version is independent of the pool ver‐
1576           sion. See zpool(1M) for information on the zpool upgrade command.
1577
1578           In  some  cases,  the  file system version and the pool version are
1579           interrelated and the pool version must be upgraded before the  file
1580           system version can be upgraded.
1581
1582           -a
1583
1584               Upgrade all file systems on all imported pools.
1585
1586
1587           filesystem
1588
1589               Upgrade the specified file system.
1590
1591
1592           -r
1593
1594               Upgrade  the specified file system and all descendent file sys‐
1595               tems
1596
1597
1598           -V version
1599
1600               Upgrade to the specified version. If the -V flag is not  speci‐
1601               fied,  this  command  upgrades to the most recent version. This
1602               option can only be used to increase  the  version  number,  and
1603               only up to the most recent version supported by this software.
1604
1605
1606
1607       zfs userspace [-niHp] [-o field[,...]] [-sS field]... [-t type [,...]]
1608       filesystem | snapshot
1609
1610           Displays space consumed by, and quotas on, each user in the  speci‐
1611           fied  filesystem or snapshot. This corresponds to the userused@user
1612           and userquota@user properties.
1613
1614           -n
1615
1616               Print numeric ID instead of user/group name.
1617
1618
1619           -H
1620
1621               Do not print headers, use tab-delimited output.
1622
1623
1624           -p
1625
1626               Use exact (parseable) numeric output.
1627
1628
1629           -o field[,...]
1630
1631               Display only the  specified  fields  from  the  following  set,
1632               type,name,used,quota.The default is to display all fields.
1633
1634
1635           -s field
1636
1637               Sort  output  by this field. The s and S flags may be specified
1638               multiple times to sort first by one field, then by another. The
1639               default is -s type -s name.
1640
1641
1642           -S field
1643
1644               Sort by this field in reverse order. See -s.
1645
1646
1647           -t type[,...]
1648
1649               Print   only  the  specified  types  from  the  following  set,
1650               all,posixuser,smbuser,posixgroup,smbgroup.
1651
1652               The default is -t posixuser,smbuser
1653
1654               The default can be changed to include group types.
1655
1656
1657           -i
1658
1659               Translate SID to POSIX ID. The POSIX ID may be ephemeral if  no
1660               mapping  exists. Normal POSIX interfaces (for example, stat(2),
1661               ls -l) perform this translation, so the -i  option  allows  the
1662               output  from  zfs  userspace to be compared directly with those
1663               utilities. However, -i may lead to confusion if some files were
1664               created  by  an SMB user before a SMB-to-POSIX name mapping was
1665               established. In such a case, some files are owned  by  the  SMB
1666               entity  and  some  by  the POSIX entity. However, the -i option
1667               will report that the POSIX entity has the total usage and quota
1668               for both.
1669
1670
1671
1672       zfs groupspace [-niHp] [-o field[,...]] [-sS field]... [-t type [,...]]
1673       filesystem | snapshot
1674
1675           Displays space consumed by, and quotas on, each group in the speci‐
1676           fied  filesystem  or  snapshot. This subcommand is identical to zfs
1677           userspace, except that the default types to display are  -t  posix‐
1678           group,smbgroup.
1679
1680             -
1681
1682
1683
1684
1685       zfs mount
1686
1687           Displays all ZFS file systems currently mounted.
1688
1689
1690       zfs mount [-vO] [-o options] -a | filesystem
1691
1692           Mounts  ZFS file systems. Invoked automatically as part of the boot
1693           process.
1694
1695           -o options
1696
1697               An optional, comma-separated list of mount options to use  tem‐
1698               porarily  for  the  duration  of  the mount. See the "Temporary
1699               Mount Point Properties" section for details.
1700
1701
1702           -O
1703
1704               Perform an overlay mount. See mount(1M) for more information.
1705
1706
1707           -v
1708
1709               Report mount progress.
1710
1711
1712           -a
1713
1714               Mount all available ZFS file systems. Invoked automatically  as
1715               part of the boot process.
1716
1717
1718           filesystem
1719
1720               Mount the specified filesystem.
1721
1722
1723
1724       zfs unmount [-f] -a | filesystem|mountpoint
1725
1726           Unmounts  currently mounted ZFS file systems. Invoked automatically
1727           as part of the shutdown process.
1728
1729           -f
1730
1731               Forcefully unmount the file system, even if it is currently  in
1732               use.
1733
1734
1735           -a
1736
1737               Unmount  all  available ZFS file systems. Invoked automatically
1738               as part of the boot process.
1739
1740
1741           filesystem|mountpoint
1742
1743               Unmount the specified filesystem. The command can also be given
1744               a path to a ZFS file system mount point on the system.
1745
1746
1747
1748       zfs share -a | filesystem
1749
1750           Shares available ZFS file systems.
1751
1752           -a
1753
1754               Share  all available ZFS file systems. Invoked automatically as
1755               part of the boot process.
1756
1757
1758           filesystem
1759
1760               Share the specified filesystem according to  the  sharenfs  and
1761               sharesmb  properties. File systems are shared when the sharenfs
1762               or sharesmb property is set.
1763
1764
1765
1766       zfs unshare -a | filesystem|mountpoint
1767
1768           Unshares currently shared ZFS file systems. This is  invoked  auto‐
1769           matically as part of the shutdown process.
1770
1771           -a
1772
1773               Unshare  all  available ZFS file systems. Invoked automatically
1774               as part of the boot process.
1775
1776
1777           filesystem|mountpoint
1778
1779               Unshare the specified filesystem. The command can also be given
1780               a path to a ZFS file system shared on the system.
1781
1782
1783
1784       zfs send [-DvRp] [-[iI] snapshot] snapshot
1785
1786           Creates  a  stream  representation of the second snapshot, which is
1787           written to standard output. The output can be redirected to a  file
1788           or  to a different system (for example, using ssh(1). By default, a
1789           full stream is generated.
1790
1791           -D
1792
1793               Perform dedup processing on the  stream.  Deduplicated  streams
1794               cannot  be  received  on systems that do not support the stream
1795               deduplication feature.
1796
1797
1798           -i snapshot
1799
1800               Generate an incremental stream from the first snapshot  to  the
1801               second  snapshot.  The  incremental source (the first snapshot)
1802               can be specified as the last component  of  the  snapshot  name
1803               (for  example,  the  part after the @), and it is assumed to be
1804               from the same file system as the second snapshot.
1805
1806               If the destination is a clone, the source  may  be  the  origin
1807               snapshot,   which   must   be  fully  specified  (for  example,
1808               pool/fs@origin, not just @origin).
1809
1810
1811           -I snapshot
1812
1813               Generate a stream package that sends all intermediary snapshots
1814               from the first snapshot to the second snapshot. For example, -I
1815               @a fs@d is similar to -i @a fs@b; -i @b fs@c; -i @c  fs@d.  The
1816               incremental  source  snapshot  may  be specified as with the -i
1817               option.
1818
1819
1820           -R
1821
1822               Generate a replication stream package, which will replicate the
1823               specified  filesystem,  and  all descendent file systems, up to
1824               the named snapshot. When received, all  properties,  snapshots,
1825               descendent file systems, and clones are preserved.
1826
1827               If the -i or -I flags are used in conjunction with the -R flag,
1828               an incremental replication stream  is  generated.  The  current
1829               values  of  properties,  and  current  snapshot and file system
1830               names are set when the stream is received. If the  -F  flag  is
1831               specified when this stream is received, snapshots and file sys‐
1832               tems that do not exist on the sending side are destroyed.
1833
1834
1835           -p
1836
1837               Send properties.
1838
1839
1840           -v
1841
1842               Print verbose information about the stream package generated.
1843
1844           The format of the stream is committed. You will be able to  receive
1845           your streams on future versions of ZFS.
1846
1847
1848       zfs receive [-vnFu] filesystem|volume|snapshot
1849       zfs receive [-vnFu] [-d | -e] filesystem
1850
1851           Creates  a  snapshot  whose contents are as specified in the stream
1852           provided on standard input. If a full stream is  received,  then  a
1853           new  file  system is created as well. Streams are created using the
1854           zfs send subcommand, which by default creates a  full  stream.  zfs
1855           recv can be used as an alias for zfs receive.
1856
1857           If  an  incremental  stream  is received, then the destination file
1858           system must already exist, and its most recent snapshot must  match
1859           the  incremental stream's source. For zvols, the destination device
1860           link is destroyed and recreated, which means  the  zvol  cannot  be
1861           accessed during the receive operation.
1862
1863           When  a  snapshot  replication  package stream that is generated by
1864           using the zfs send -R command is  received, any snapshots  that  do
1865           not  exist  on  the sending location are destroyed by using the zfs
1866           destroy -d command.
1867
1868           The name of the snapshot (and file system,  if  a  full  stream  is
1869           received) that this subcommand creates depends on the argument type
1870           and the -d or -e option.
1871
1872           If the argument is a snapshot name, the specified snapshot is  cre‐
1873           ated.  If  the argument is a file system or volume name, a snapshot
1874           with the same name as the sent snapshot is created within the spec‐
1875           ified  filesystem  or  volume. If the -d or -e option is specified,
1876           the snapshot name is determined by appending  the  sent  snapshot's
1877           name  to  the  specified filesystem. If the -d option is specified,
1878           all but the pool name of the sent snapshot path  is  appended  (for
1879           example,  b/c@1 appended from sent snapshot a/b/c@1), and if the -e
1880           option is specified, only the tail of the  sent  snapshot  path  is
1881           appended (for example, c@1 appended from sent snapshot a/b/c@1). In
1882           the case of -d, any file systems needed to replicate  the  path  of
1883           the sent snapshot are created within the specified file system.
1884
1885           -d
1886
1887               Use  all  but  the first element of the sent snapshot path (all
1888               but the pool name) to determine the name of the new snapshot as
1889               described in the paragraph above.
1890
1891
1892           -e
1893
1894               Use the last element of the sent snapshot path to determine the
1895               name of the new snapshot as described in the paragraph above.
1896
1897
1898           -u
1899
1900               File system that is associated with the received stream is  not
1901               mounted.
1902
1903
1904           -v
1905
1906               Print  verbose  information  about  the  stream  and  the  time
1907               required to perform the receive operation.
1908
1909
1910           -n
1911
1912               Do not actually receive the stream. This can be useful in  con‐
1913               junction  with  the  -v  option  to verify the name the receive
1914               operation would use.
1915
1916
1917           -F
1918
1919               Force a rollback of the file system to the most recent snapshot
1920               before performing the receive operation. If receiving an incre‐
1921               mental replication stream (for example, one  generated  by  zfs
1922               send  -R -[iI]), destroy snapshots and file systems that do not
1923               exist on the sending side.
1924
1925
1926
1927       zfs allow filesystem | volume
1928
1929           Displays permissions that have  been  delegated  on  the  specified
1930           filesystem  or  volume.  See  the other forms of zfs allow for more
1931           information.
1932
1933
1934       zfs allow [-ldug] "everyone"|user|group[,...] perm|@setname[,...]
1935       filesystem| volume
1936       zfs allow [-ld] -e perm|@setname[,...] filesystem | volume
1937
1938           Delegates  ZFS  administration  permission  for the file systems to
1939           non-privileged users.
1940
1941           [-ug] "everyone"|user|group[,...]
1942
1943               Specifies to whom the permissions are delegated. Multiple enti‐
1944               ties  can be specified as a comma-separated list. If neither of
1945               the -ug options are specified, then the argument is interpreted
1946               preferentially  as the keyword "everyone", then as a user name,
1947               and lastly as a group name. To specify a user  or  group  named
1948               "everyone",  use  the -u or -g options. To specify a group with
1949               the same name as a user, use the -g options.
1950
1951
1952           [-e] perm|@setname[,...]
1953
1954               Specifies that the permissions be delegated to "everyone." Mul‐
1955               tiple  permissions  may be specified as a comma-separated list.
1956               Permission names are the same as ZFS  subcommand  and  property
1957               names.  See  the property list below. Property set names, which
1958               begin with an at sign (@) , may be specified. See the  -s  form
1959               below for details.
1960
1961
1962           [-ld] filesystem|volume
1963
1964               Specifies  where  the  permissions are delegated. If neither of
1965               the -ld options are specified, or both are,  then  the  permis‐
1966               sions are allowed for the file system or volume, and all of its
1967               descendents. If only the -l option is  used,  then  is  allowed
1968               "locally"  only  for  the specified file system. If only the -d
1969               option is used, then is allowed only for  the  descendent  file
1970               systems.
1971
1972
1973
1974
1975       Permissions are generally the ability to use a ZFS subcommand or change
1976       a ZFS property. The following permissions are available:
1977
1978         NAME             TYPE           NOTES
1979         allow            subcommand     Must also have the permission that is
1980                                         being allowed
1981         clone            subcommand     Must also have the 'create' ability and
1982                                         'mount'
1983                                         ability in the origin file system
1984         create           subcommand     Must also have the 'mount' ability
1985         destroy          subcommand     Must also have the 'mount' ability
1986         hold             subcommand     Allows adding a user hold to a snapshot
1987         mount            subcommand     Allows mount/umount of ZFS datasets
1988         promote          subcommand     Must also have the 'mount' and 'promote'
1989                                         ability in the origin file system
1990         receive          subcommand     Must also have the 'mount' and 'create'
1991                                         ability
1992         release          subcommand     Allows releasing a user hold which
1993                                         might destroy the snapshot
1994         rename           subcommand     Must also have the 'mount' and 'create'
1995                                         ability in the new parent
1996         rollback         subcommand
1997         send             subcommand
1998         share            subcommand     Allows sharing file systems over NFS or
1999                                         SMB protocols
2000         snapshot         subcommand
2001         groupquota       other          Allows accessing any groupquota@...
2002                                         property
2003         groupused        other          Allows reading any groupused@... property
2004         userprop         other          Allows changing any user property
2005         userquota        other          Allows accessing any userquota@...
2006                                         property
2007         userused         other          Allows reading any userused@... property
2008         aclinherit       property
2009         aclmode          property
2010         atime            property
2011         canmount         property
2012         casesensitivity  property
2013         checksum         property
2014         compression      property
2015         copies           property
2016         dedup            property
2017         devices          property
2018         exec             property
2019         logbias          property
2020         mlslabel         property
2021         mountpoint       property
2022         nbmand           property
2023         normalization    property
2024         primarycache     property
2025         quota            property
2026         readonly         property
2027         recordsize       property
2028         refquota         property
2029         refreservation   property
2030         reservation      property
2031         secondarycache   property
2032         setuid           property
2033         shareiscsi       property
2034         sharenfs         property
2035         sharesmb         property
2036         snapdir          property
2037         utf8only         property
2038         version          property
2039         volblocksize     property
2040         volsize          property
2041         vscan            property
2042         xattr            property
2043         zoned            property
2044
2045
2046
2047       zfs allow -c perm|@setname[,...] filesystem|volume
2048
2049           Sets "create  time"  permissions.  These  permissions  are  granted
2050           (locally)  to the creator of any newly-created descendent file sys‐
2051           tem.
2052
2053
2054       zfs allow -s @setname perm|@setname[,...] filesystem|volume
2055
2056           Defines or adds permissions to a permission set.  The  set  can  be
2057           used  by other zfs allow commands for the specified file system and
2058           its descendents. Sets are evaluated dynamically, so  changes  to  a
2059           set are immediately reflected. Permission sets follow the same nam‐
2060           ing restrictions as ZFS file systems, but the name must begin  with
2061           an "at sign" (@), and can be no more than 64 characters long.
2062
2063
2064       zfs unallow [-rldug] "everyone"|user|group[,...] [perm|@setname[, ...]]
2065       filesystem|volume
2066       zfs unallow [-rld] -e [perm|@setname [,...]] filesystem|volume
2067       zfs unallow [-r] -c [perm|@setname[,...]]
2068       filesystem|volume
2069
2070           Removes permissions that were granted with the zfs  allow  command.
2071           No  permissions are explicitly denied, so other permissions granted
2072           are still in effect. For example, if the permission is  granted  by
2073           an  ancestor. If no permissions are specified, then all permissions
2074           for the specified user, group, or everyone are removed.  Specifying
2075           "everyone"  (or  using  the -e option) only removes the permissions
2076           that were granted to "everyone", not all permissions for every user
2077           and  group.  See  the  zfs  allow  command for a description of the
2078           -ldugec options.
2079
2080           -r
2081
2082               Recursively remove the permissions from this  file  system  and
2083               all descendents.
2084
2085
2086
2087       zfs unallow [-r] -s @setname [perm|@setname[,...]]
2088       filesystem|volume
2089
2090           Removes  permissions  from  a permission set. If no permissions are
2091           specified, then all permissions are removed, thus removing the  set
2092           entirely.
2093
2094
2095       zfs hold [-r] tag snapshot...
2096
2097           Adds a single reference, named with the tag argument, to the speci‐
2098           fied snapshot or snapshots. Each snapshot has its  own  tag  names‐
2099           pace, and tags must be unique within that space.
2100
2101           If  a  hold exists on a snapshot, attempts to destroy that snapshot
2102           by using the zfs destroy command return EBUSY.
2103
2104           -r
2105
2106               Specifies that a hold with the given tag is applied recursively
2107               to the snapshots of all descendent file systems.
2108
2109
2110
2111       zfs holds [-r] snapshot...
2112
2113           Lists  all existing user references for the given snapshot or snap‐
2114           shots.
2115
2116           -r
2117
2118               Lists the holds that are set on the named descendent snapshots,
2119               in addition to listing the holds on the named snapshot.
2120
2121
2122
2123       zfs release [-r] tag snapshot...
2124
2125           Removes  a  single reference, named with the tag argument, from the
2126           specified snapshot or snapshots. The tag  must  already  exist  for
2127           each snapshot.
2128
2129           If  a  hold exists on a snapshot, attempts to destroy that snapshot
2130           by using the zfs destroy command return EBUSY.
2131
2132           -r
2133
2134               Recursively releases a hold with the given tag on the snapshots
2135               of all descendent file systems.
2136
2137
2138

EXAMPLES

2140       Example 1 Creating a ZFS File System Hierarchy
2141
2142
2143       The  following commands create a file system named pool/home and a file
2144       system named pool/home/bob. The mount point /export/home is set for the
2145       parent  file  system,  and is automatically inherited by the child file
2146       system.
2147
2148
2149         # zfs create pool/home
2150         # zfs set mountpoint=/export/home pool/home
2151         # zfs create pool/home/bob
2152
2153
2154
2155       Example 2 Creating a ZFS Snapshot
2156
2157
2158       The following command creates a snapshot named yesterday. This snapshot
2159       is  mounted on demand in the .zfs/snapshot directory at the root of the
2160       pool/home/bob file system.
2161
2162
2163         # zfs snapshot pool/home/bob@yesterday
2164
2165
2166
2167       Example 3 Creating and Destroying Multiple Snapshots
2168
2169
2170       The following command creates snapshots named  yesterday  of  pool/home
2171       and  all  of  its  descendent file systems. Each snapshot is mounted on
2172       demand in the .zfs/snapshot directory at the root of its  file  system.
2173       The second command destroys the newly created snapshots.
2174
2175
2176         # zfs snapshot -r pool/home@yesterday
2177         # zfs destroy -r pool/home@yesterday
2178
2179
2180
2181       Example 4 Disabling and Enabling File System Compression
2182
2183
2184       The  following  command  disables the compression property for all file
2185       systems under pool/home. The next command explicitly  enables  compres‐
2186       sion for pool/home/anne.
2187
2188
2189         # zfs set compression=off pool/home
2190         # zfs set compression=on pool/home/anne
2191
2192
2193
2194       Example 5 Listing ZFS Datasets
2195
2196
2197       The  following command lists all active file systems and volumes in the
2198       system. Snapshots are displayed if the listsnaps property  is  on.  The
2199       default is off. See zpool(1M) for more information on pool properties.
2200
2201
2202         # zfs list
2203            NAME                      USED  AVAIL  REFER  MOUNTPOINT
2204            pool                      450K   457G    18K  /pool
2205            pool/home                 315K   457G    21K  /export/home
2206            pool/home/anne             18K   457G    18K  /export/home/anne
2207            pool/home/bob             276K   457G   276K  /export/home/bob
2208
2209
2210
2211       Example 6 Setting a Quota on a ZFS File System
2212
2213
2214       The following command sets a quota of 50 Gbytes for pool/home/bob.
2215
2216
2217         # zfs set quota=50G pool/home/bob
2218
2219
2220
2221       Example 7 Listing ZFS Properties
2222
2223
2224       The following command lists all properties for pool/home/bob.
2225
2226
2227         # zfs get all pool/home/bob
2228         NAME           PROPERTY              VALUE                  SOURCE
2229         pool/home/bob  type                  filesystem             -
2230         pool/home/bob  creation              Mon Nov  9 15:05 2009  -
2231         pool/home/bob  used                  282M                   -
2232         pool/home/bob  available             134G                   -
2233         pool/home/bob  referenced            282M                   -
2234         pool/home/bob  compressratio         1.00x                  -
2235         pool/home/bob  mounted               yes                    -
2236         pool/home/bob  quota                 none                   default
2237         pool/home/bob  reservation           none                   default
2238         pool/home/bob  recordsize            128K                   default
2239         pool/home/bob  mountpoint            /pool/home/bob         default
2240         pool/home/bob  sharenfs              off                    default
2241         pool/home/bob  checksum              on                     default
2242         pool/home/bob  compression           on                     local
2243         pool/home/bob  atime                 on                     default
2244         pool/home/bob  devices               on                     default
2245         pool/home/bob  exec                  on                     default
2246         pool/home/bob  setuid                on                     default
2247         pool/home/bob  readonly              off                    default
2248         pool/home/bob  zoned                 off                    default
2249         pool/home/bob  snapdir               hidden                 default
2250         pool/home/bob  aclmode               groupmask              default
2251         pool/home/bob  aclinherit            restricted             default
2252         pool/home/bob  canmount              on                     default
2253         pool/home/bob  shareiscsi            off                    default
2254         pool/home/bob  xattr                 on                     default
2255         pool/home/bob  copies                1                      default
2256         pool/home/bob  version               4                      -
2257         pool/home/bob  utf8only              off                    -
2258         pool/home/bob  normalization         none                   -
2259         pool/home/bob  casesensitivity       sensitive              -
2260         pool/home/bob  vscan                 off                    default
2261         pool/home/bob  nbmand                off                    default
2262         pool/home/bob  sharesmb              off                    default
2263         pool/home/bob  refquota              none                   default
2264         pool/home/bob  refreservation        none                   default
2265         pool/home/bob  primarycache          all                    default
2266         pool/home/bob  secondarycache        all                    default
2267         pool/home/bob  usedbysnapshots       0                      -
2268         pool/home/bob  usedbydataset         282M                   -
2269         pool/home/bob  usedbychildren        0                      -
2270         pool/home/bob  usedbyrefreservation  0                      -
2271         pool/home/bob  logbias               latency                default
2272         pool/home/bob  dedup                 off                    default
2273         pool/home/bob  mlslabel              none                   default
2274
2275
2276
2277
2278       The following command gets a single property value.
2279
2280
2281         # zfs get -H -o value compression pool/home/bob
2282         on
2283
2284
2285
2286
2287       The  following  command  lists  all  properties with local settings for
2288       pool/home/bob.
2289
2290
2291         # zfs get -r -s local -o name,property,value all pool/home/bob
2292         NAME           PROPERTY              VALUE
2293         pool/home/bob  quota                 20G
2294         pool/home/bob  compression           on
2295
2296
2297
2298       Example 8 Rolling Back a ZFS File System
2299
2300
2301       The following command reverts the contents  of  pool/home/anne  to  the
2302       snapshot named yesterday, deleting all intermediate snapshots.
2303
2304
2305         # zfs rollback -r pool/home/anne@yesterday
2306
2307
2308
2309       Example 9 Creating a ZFS Clone
2310
2311
2312       The following command creates a writable file system whose initial con‐
2313       tents are the same as pool/home/bob@yesterday.
2314
2315
2316         # zfs clone pool/home/bob@yesterday pool/clone
2317
2318
2319
2320       Example 10 Promoting a ZFS Clone
2321
2322
2323       The following commands illustrate how to test out  changes  to  a  file
2324       system, and then replace the original file system with the changed one,
2325       using clones, clone promotion, and renaming:
2326
2327
2328         # zfs create pool/project/production
2329           populate /pool/project/production with data
2330         # zfs snapshot pool/project/production@today
2331         # zfs clone pool/project/production@today pool/project/beta
2332         make changes to /pool/project/beta and test them
2333         # zfs promote pool/project/beta
2334         # zfs rename pool/project/production pool/project/legacy
2335         # zfs rename pool/project/beta pool/project/production
2336         once the legacy version is no longer needed, it can be destroyed
2337         # zfs destroy pool/project/legacy
2338
2339
2340
2341       Example 11 Inheriting ZFS Properties
2342
2343
2344       The  following  command  causes  pool/home/bob  and  pool/home/anne  to
2345       inherit the checksum property from their parent.
2346
2347
2348         # zfs inherit checksum pool/home/bob pool/home/anne
2349
2350
2351
2352       Example 12 Remotely Replicating ZFS Data
2353
2354
2355       The  following  commands  send  a  full  stream and then an incremental
2356       stream to a remote machine, restoring them into  poolB/received/fs@aand
2357       poolB/received/fs@b,  respectively.  poolB must contain the file system
2358       poolB/received, and must not initially contain poolB/received/fs.
2359
2360
2361         # zfs send pool/fs@a | \
2362            ssh host zfs receive poolB/received/fs@a
2363         # zfs send -i a pool/fs@b | ssh host \
2364            zfs receive poolB/received/fs
2365
2366
2367
2368       Example 13 Using the zfs receive -d Option
2369
2370
2371       The following command sends a full stream of  poolA/fsA/fsB@snap  to  a
2372       remote  machine,  receiving  it  into  poolB/received/fsA/fsB@snap. The
2373       fsA/fsB@snap portion of the received snapshot's name is determined from
2374       the  name  of  the  sent  snapshot.  poolB must contain the file system
2375       poolB/received. If poolB/received/fsA does not exist, it is created  as
2376       an empty file system.
2377
2378
2379         # zfs send poolA/fsA/fsB@snap | \
2380            ssh host zfs receive -d poolB/received
2381
2382
2383
2384       Example 14 Setting User Properties
2385
2386
2387       The  following  example  sets  the  user-defined com.example:department
2388       property for a dataset.
2389
2390
2391         # zfs set com.example:department=12345 tank/accounting
2392
2393
2394
2395       Example 15 Creating a ZFS Volume as an iSCSI Target Device
2396
2397
2398       The following example shows how to create a ZFS volume as an iSCSI tar‐
2399       get.
2400
2401
2402         # zfs create -V 2g pool/volumes/vol1
2403         # zfs set shareiscsi=on pool/volumes/vol1
2404         # iscsitadm list target
2405         Target: pool/volumes/vol1
2406          iSCSI Name:
2407          iqn.1986-03.com.sun:02:7b4b02a6-3277-eb1b-e686-a24762c52a8c
2408          Connections: 0
2409
2410
2411
2412
2413       After the iSCSI target is created, set up the iSCSI initiator. For more
2414       information about the Solaris iSCSI initiator, see iscsitadm(1M).
2415
2416       Example 16 Performing a Rolling Snapshot
2417
2418
2419       The following example shows how to maintain a history of snapshots with
2420       a  consistent  naming  scheme. To keep a week's worth of snapshots, the
2421       user destroys the oldest snapshot, renames the remaining snapshots, and
2422       then creates a new snapshot, as follows:
2423
2424
2425         # zfs destroy -r pool/users@7daysago
2426         # zfs rename -r pool/users@6daysago @7daysago
2427         # zfs rename -r pool/users@5daysago @6daysago
2428         # zfs rename -r pool/users@yesterday @5daysago
2429         # zfs rename -r pool/users@yesterday @4daysago
2430         # zfs rename -r pool/users@yesterday @3daysago
2431         # zfs rename -r pool/users@yesterday @2daysago
2432         # zfs rename -r pool/users@today @yesterday
2433         # zfs snapshot -r pool/users@today
2434
2435
2436
2437       Example 17 Setting sharenfs Property Options on a ZFS File System
2438
2439
2440       The  following  commands  show  how to set sharenfs property options to
2441       enable rw access for a set of IP addresses and to  enable  root  access
2442       for system neo on the tank/home file system.
2443
2444
2445         # # zfs set sharenfs='rw=@123.123.0.0/16,root=neo' tank/home
2446
2447
2448
2449
2450       If you are using DNS for host name resolution, specify the fully quali‐
2451       fied hostname.
2452
2453
2454       Example 18 Delegating ZFS Administration Permissions on a ZFS Dataset
2455
2456
2457       The following example shows how to set permissions so that user  cindys
2458       can create, destroy, mount, and take snapshots on tank/cindys. The per‐
2459       missions on tank/cindys are also displayed.
2460
2461
2462         # zfs allow cindys create,destroy,mount,snapshot tank/cindys
2463         # zfs allow tank/cindys
2464         -------------------------------------------------------------
2465         Local+Descendent permissions on (tank/cindys)
2466                   user cindys create,destroy,mount,snapshot
2467         -------------------------------------------------------------
2468
2469
2470
2471
2472       Because the tank/cindys  mount  point  permission  is  set  to  755  by
2473       default,  user  cindys  will  be  unable  to  mount  file systems under
2474       tank/cindys. Set an ACL similar to  the  following  syntax  to  provide
2475       mount point access:
2476
2477         # chmod A+user:cindys:add_subdirectory:allow /tank/cindys
2478
2479
2480
2481       Example 19 Delegating Create Time Permissions on a ZFS Dataset
2482
2483
2484       The  following  example shows how to grant anyone in the group staff to
2485       create file systems in tank/users. This syntax also allows  staff  mem‐
2486       bers  to  destroy their own file systems, but not destroy anyone else's
2487       file system. The permissions on tank/users are also displayed.
2488
2489
2490         # # zfs allow staff create,mount tank/users
2491         # zfs allow -c destroy tank/users
2492         # zfs allow tank/users
2493         -------------------------------------------------------------
2494         Create time permissions on (tank/users)
2495                   create,destroy
2496         Local+Descendent permissions on (tank/users)
2497                   group staff create,mount
2498         -------------------------------------------------------------
2499
2500
2501
2502       Example 20 Defining and Granting a Permission Set on a ZFS Dataset
2503
2504
2505       The following example shows how to define and grant a permission set on
2506       the tank/users file system. The permissions on tank/users are also dis‐
2507       played.
2508
2509
2510         # zfs allow -s @pset create,destroy,snapshot,mount tank/users
2511         # zfs allow staff @pset tank/users
2512         # zfs allow tank/users
2513         -------------------------------------------------------------
2514         Permission sets on (tank/users)
2515                 @pset create,destroy,mount,snapshot
2516         Create time permissions on (tank/users)
2517                 create,destroy
2518         Local+Descendent permissions on (tank/users)
2519                 group staff @pset,create,mount
2520         -------------------------------------------------------------
2521
2522
2523
2524       Example 21 Delegating Property Permissions on a ZFS Dataset
2525
2526
2527       The following example shows to grant the  ability  to  set  quotas  and
2528       reservations   on  the  users/home  file  system.  The  permissions  on
2529       users/home are also displayed.
2530
2531
2532         # zfs allow cindys quota,reservation users/home
2533         # zfs allow users/home
2534         -------------------------------------------------------------
2535         Local+Descendent permissions on (users/home)
2536                 user cindys quota,reservation
2537         -------------------------------------------------------------
2538         cindys% zfs set quota=10G users/home/marks
2539         cindys% zfs get quota users/home/marks
2540         NAME              PROPERTY  VALUE             SOURCE
2541         users/home/marks  quota     10G               local
2542
2543
2544
2545       Example 22 Removing ZFS Delegated Permissions on a ZFS Dataset
2546
2547
2548       The following example shows how to remove the snapshot permission  from
2549       the  staff  group  on  the  tank/users  file system. The permissions on
2550       tank/users are also displayed.
2551
2552
2553         # zfs unallow staff snapshot tank/users
2554         # zfs allow tank/users
2555         -------------------------------------------------------------
2556         Permission sets on (tank/users)
2557                 @pset create,destroy,mount,snapshot
2558         Create time permissions on (tank/users)
2559                 create,destroy
2560         Local+Descendent permissions on (tank/users)
2561                 group staff @pset,create,mount
2562         -------------------------------------------------------------
2563
2564
2565

EXIT STATUS

2567       The following exit values are returned:
2568
2569       0
2570
2571           Successful completion.
2572
2573
2574       1
2575
2576           An error occurred.
2577
2578
2579       2
2580
2581           Invalid command line options were specified.
2582
2583

ATTRIBUTES

2585       See attributes(5) for descriptions of the following attributes:
2586
2587
2588
2589
2590       ┌─────────────────────────────┬─────────────────────────────┐
2591       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
2592       ├─────────────────────────────┼─────────────────────────────┤
2593       │Availability                 │SUNWzfsu                     │
2594       ├─────────────────────────────┼─────────────────────────────┤
2595       │Interface Stability          │Committed                    │
2596       └─────────────────────────────┴─────────────────────────────┘
2597

SEE ALSO

2599       ssh(1), iscsitadm(1M), mount(1M), share(1M), sharemgr(1M), unshare(1M),
2600       zonecfg(1M),   zpool(1M),   chmod(2),   stat(2),  write(2),  fsync(3C),
2601       dfstab(4), attributes(5)
2602
2603
2604       See the gzip(1) man page, which is not part of the SunOS man page  col‐
2605       lection.
2606
2607
2608       For information about using the ZFS web-based management tool and other
2609       ZFS features, see the Solaris ZFS Administration Guide.
2610
2611
2612
2613SunOS 5.11                        21 Dec 2009                          zfs(1M)
Impressum