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

SUBCOMMANDS

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

EXAMPLES

2033       Example 1 Creating a ZFS File System Hierarchy
2034
2035
2036       The  following commands create a file system named pool/home and a file
2037       system named pool/home/bob. The mount point /export/home is set for the
2038       parent  file  system,  and is automatically inherited by the child file
2039       system.
2040
2041
2042         # zfs create pool/home
2043         # zfs set mountpoint=/export/home pool/home
2044         # zfs create pool/home/bob
2045
2046
2047
2048       Example 2 Creating a ZFS Snapshot
2049
2050
2051       The following command creates a snapshot named yesterday. This snapshot
2052       is  mounted on demand in the .zfs/snapshot directory at the root of the
2053       pool/home/bob file system.
2054
2055
2056         # zfs snapshot pool/home/bob@yesterday
2057
2058
2059
2060       Example 3 Creating and Destroying Multiple Snapshots
2061
2062
2063       The following command creates snapshots named  yesterday  of  pool/home
2064       and  all  of  its  descendent file systems. Each snapshot is mounted on
2065       demand in the .zfs/snapshot directory at the root of its  file  system.
2066       The second command destroys the newly created snapshots.
2067
2068
2069         # zfs snapshot -r pool/home@yesterday
2070         # zfs destroy -r pool/home@yesterday
2071
2072
2073
2074       Example 4 Disabling and Enabling File System Compression
2075
2076
2077       The  following  command  disables the compression property for all file
2078       systems under pool/home. The next command explicitly  enables  compres‐
2079       sion for pool/home/anne.
2080
2081
2082         # zfs set compression=off pool/home
2083         # zfs set compression=on pool/home/anne
2084
2085
2086
2087       Example 5 Listing ZFS Datasets
2088
2089
2090       The  following command lists all active file systems and volumes in the
2091       system. Snapshots are displayed if the listsnaps property  is  on.  The
2092       default is off. See zpool(1M) for more information on pool properties.
2093
2094
2095         # zfs list
2096            NAME                      USED  AVAIL  REFER  MOUNTPOINT
2097            pool                      450K   457G    18K  /pool
2098            pool/home                 315K   457G    21K  /export/home
2099            pool/home/anne             18K   457G    18K  /export/home/anne
2100            pool/home/bob             276K   457G   276K  /export/home/bob
2101
2102
2103
2104       Example 6 Setting a Quota on a ZFS File System
2105
2106
2107       The following command sets a quota of 50 Gbytes for pool/home/bob.
2108
2109
2110         # zfs set quota=50G pool/home/bob
2111
2112
2113
2114       Example 7 Listing ZFS Properties
2115
2116
2117       The following command lists all properties for pool/home/bob.
2118
2119
2120         # zfs get all pool/home/bob
2121         NAME           PROPERTY              VALUE                  SOURCE
2122         pool/home/bob  type                  filesystem             -
2123         pool/home/bob  creation              Tue Jul 21 15:53 2009  -
2124         pool/home/bob  used                  21K                    -
2125         pool/home/bob  available             20.0G                  -
2126         pool/home/bob  referenced            21K                    -
2127         pool/home/bob  compressratio         1.00x                  -
2128         pool/home/bob  mounted               yes                    -
2129         pool/home/bob  quota                 20G                    local
2130         pool/home/bob  reservation           none                   default
2131         pool/home/bob  recordsize            128K                   default
2132         pool/home/bob  mountpoint            /pool/home/bob         default
2133         pool/home/bob  sharenfs              off                    default
2134         pool/home/bob  checksum              on                     default
2135         pool/home/bob  compression           on                     local
2136         pool/home/bob  atime                 on                     default
2137         pool/home/bob  devices               on                     default
2138         pool/home/bob  exec                  on                     default
2139         pool/home/bob  setuid                on                     default
2140         pool/home/bob  readonly              off                    default
2141         pool/home/bob  zoned                 off                    default
2142         pool/home/bob  snapdir               hidden                 default
2143         pool/home/bob  aclmode               groupmask              default
2144         pool/home/bob  aclinherit            restricted             default
2145         pool/home/bob  canmount              on                     default
2146         pool/home/bob  shareiscsi            off                    default
2147         pool/home/bob  xattr                 on                     default
2148         pool/home/bob  copies                1                      default
2149         pool/home/bob  version               4                      -
2150         pool/home/bob  utf8only              off                    -
2151         pool/home/bob  normalization         none                   -
2152         pool/home/bob  casesensitivity       sensitive              -
2153         pool/home/bob  vscan                 off                    default
2154         pool/home/bob  nbmand                off                    default
2155         pool/home/bob  sharesmb              off                    default
2156         pool/home/bob  refquota              none                   default
2157         pool/home/bob  refreservation        none                   default
2158         pool/home/bob  primarycache          all                    default
2159         pool/home/bob  secondarycache        all                    default
2160         pool/home/bob  usedbysnapshots       0                      -
2161         pool/home/bob  usedbydataset         21K                    -
2162         pool/home/bob  usedbychildren        0                      -
2163         pool/home/bob  usedbyrefreservation  0                      -
2164
2165
2166
2167
2168       The following command gets a single property value.
2169
2170
2171         # zfs get -H -o value compression pool/home/bob
2172         on
2173
2174
2175
2176
2177       The  following  command  lists  all  properties with local settings for
2178       pool/home/bob.
2179
2180
2181         # zfs get -r -s local -o name,property,value all pool/home/bob
2182         NAME           PROPERTY              VALUE
2183         pool/home/bob  quota                 20G
2184         pool/home/bob  compression           on
2185
2186
2187
2188       Example 8 Rolling Back a ZFS File System
2189
2190
2191       The following command reverts the contents  of  pool/home/anne  to  the
2192       snapshot named yesterday, deleting all intermediate snapshots.
2193
2194
2195         # zfs rollback -r pool/home/anne@yesterday
2196
2197
2198
2199       Example 9 Creating a ZFS Clone
2200
2201
2202       The following command creates a writable file system whose initial con‐
2203       tents are the same as pool/home/bob@yesterday.
2204
2205
2206         # zfs clone pool/home/bob@yesterday pool/clone
2207
2208
2209
2210       Example 10 Promoting a ZFS Clone
2211
2212
2213       The following commands illustrate how to test out  changes  to  a  file
2214       system, and then replace the original file system with the changed one,
2215       using clones, clone promotion, and renaming:
2216
2217
2218         # zfs create pool/project/production
2219           populate /pool/project/production with data
2220         # zfs snapshot pool/project/production@today
2221         # zfs clone pool/project/production@today pool/project/beta
2222         make changes to /pool/project/beta and test them
2223         # zfs promote pool/project/beta
2224         # zfs rename pool/project/production pool/project/legacy
2225         # zfs rename pool/project/beta pool/project/production
2226         once the legacy version is no longer needed, it can be destroyed
2227         # zfs destroy pool/project/legacy
2228
2229
2230
2231       Example 11 Inheriting ZFS Properties
2232
2233
2234       The  following  command  causes  pool/home/bob  and  pool/home/anne  to
2235       inherit the checksum property from their parent.
2236
2237
2238         # zfs inherit checksum pool/home/bob pool/home/anne
2239
2240
2241
2242       Example 12 Remotely Replicating ZFS Data
2243
2244
2245       The  following  commands  send  a  full  stream and then an incremental
2246       stream to a remote machine, restoring them into  poolB/received/fs@aand
2247       poolB/received/fs@b,  respectively.  poolB must contain the file system
2248       poolB/received, and must not initially contain poolB/received/fs.
2249
2250
2251         # zfs send pool/fs@a | \
2252            ssh host zfs receive poolB/received/fs@a
2253         # zfs send -i a pool/fs@b | ssh host \
2254            zfs receive poolB/received/fs
2255
2256
2257
2258       Example 13 Using the zfs receive -d Option
2259
2260
2261       The following command sends a full stream of  poolA/fsA/fsB@snap  to  a
2262       remote  machine,  receiving  it  into  poolB/received/fsA/fsB@snap. The
2263       fsA/fsB@snap portion of the received snapshot's name is determined from
2264       the  name  of  the  sent  snapshot.  poolB must contain the file system
2265       poolB/received. If poolB/received/fsA does not exist, it is created  as
2266       an empty file system.
2267
2268
2269         # zfs send poolA/fsA/fsB@snap | \
2270            ssh host zfs receive -d poolB/received
2271
2272
2273
2274       Example 14 Setting User Properties
2275
2276
2277       The  following  example  sets  the  user-defined com.example:department
2278       property for a dataset.
2279
2280
2281         # zfs set com.example:department=12345 tank/accounting
2282
2283
2284
2285       Example 15 Creating a ZFS Volume as an iSCSI Target Device
2286
2287
2288       The following example shows how to create a ZFS volume as an iSCSI tar‐
2289       get.
2290
2291
2292         # zfs create -V 2g pool/volumes/vol1
2293         # zfs set shareiscsi=on pool/volumes/vol1
2294         # iscsitadm list target
2295         Target: pool/volumes/vol1
2296          iSCSI Name:
2297          iqn.1986-03.com.sun:02:7b4b02a6-3277-eb1b-e686-a24762c52a8c
2298          Connections: 0
2299
2300
2301
2302
2303       After the iSCSI target is created, set up the iSCSI initiator. For more
2304       information about the Solaris iSCSI initiator, see iscsitadm(1M).
2305
2306       Example 16 Performing a Rolling Snapshot
2307
2308
2309       The following example shows how to maintain a history of snapshots with
2310       a  consistent  naming  scheme. To keep a week's worth of snapshots, the
2311       user destroys the oldest snapshot, renames the remaining snapshots, and
2312       then creates a new snapshot, as follows:
2313
2314
2315         # zfs destroy -r pool/users@7daysago
2316         # zfs rename -r pool/users@6daysago @7daysago
2317         # zfs rename -r pool/users@5daysago @6daysago
2318         # zfs rename -r pool/users@yesterday @5daysago
2319         # zfs rename -r pool/users@yesterday @4daysago
2320         # zfs rename -r pool/users@yesterday @3daysago
2321         # zfs rename -r pool/users@yesterday @2daysago
2322         # zfs rename -r pool/users@today @yesterday
2323         # zfs snapshot -r pool/users@today
2324
2325
2326
2327       Example 17 Setting sharenfs Property Options on a ZFS File System
2328
2329
2330       The  following  commands  show  how to set sharenfs property options to
2331       enable rw access for a set of IP addresses and to  enable  root  access
2332       for system neo on the tank/home file system.
2333
2334
2335         # # zfs set sharenfs='rw=@123.123.0.0/16,root=neo' tank/home
2336
2337
2338
2339
2340       If you are using DNS for host name resolution, specify the fully quali‐
2341       fied hostname.
2342
2343
2344       Example 18 Delegating ZFS Administration Permissions on a ZFS Dataset
2345
2346
2347       The following example shows how to set permissions so that user  cindys
2348       can create, destroy, mount, and take snapshots on tank/cindys. The per‐
2349       missions on tank/cindys are also displayed.
2350
2351
2352         # zfs allow cindys create,destroy,mount,snapshot tank/cindys
2353         # zfs allow tank/cindys
2354         -------------------------------------------------------------
2355         Local+Descendent permissions on (tank/cindys)
2356                   user cindys create,destroy,mount,snapshot
2357         -------------------------------------------------------------
2358
2359
2360
2361
2362       Because the tank/cindys  mount  point  permission  is  set  to  755  by
2363       default,  user  cindys  will  be  unable  to  mount  file systems under
2364       tank/cindys. Set an ACL similar to  the  following  syntax  to  provide
2365       mount point access:
2366
2367         # chmod A+user:cindys:add_subdirectory:allow /tank/cindys
2368
2369
2370
2371       Example 19 Delegating Create Time Permissions on a ZFS Dataset
2372
2373
2374       The  following  example shows how to grant anyone in the group staff to
2375       create file systems in tank/users. This syntax also allows  staff  mem‐
2376       bers  to  destroy their own file systems, but not destroy anyone else's
2377       file system. The permissions on tank/users are also displayed.
2378
2379
2380         # # zfs allow staff create,mount tank/users
2381         # zfs allow -c destroy tank/users
2382         # zfs allow tank/users
2383         -------------------------------------------------------------
2384         Create time permissions on (tank/users)
2385                   create,destroy
2386         Local+Descendent permissions on (tank/users)
2387                   group staff create,mount
2388         -------------------------------------------------------------
2389
2390
2391
2392       Example 20 Defining and Granting a Permission Set on a ZFS Dataset
2393
2394
2395       The following example shows how to define and grant a permission set on
2396       the tank/users file system. The permissions on tank/users are also dis‐
2397       played.
2398
2399
2400         # zfs allow -s @pset create,destroy,snapshot,mount tank/users
2401         # zfs allow staff @pset tank/users
2402         # zfs allow tank/users
2403         -------------------------------------------------------------
2404         Permission sets on (tank/users)
2405                 @pset create,destroy,mount,snapshot
2406         Create time permissions on (tank/users)
2407                 create,destroy
2408         Local+Descendent permissions on (tank/users)
2409                 group staff @pset,create,mount
2410         -------------------------------------------------------------
2411
2412
2413
2414       Example 21 Delegating Property Permissions on a ZFS Dataset
2415
2416
2417       The following example shows to grant the  ability  to  set  quotas  and
2418       reservations   on  the  users/home  file  system.  The  permissions  on
2419       users/home are also displayed.
2420
2421
2422         # zfs allow cindys quota,reservation users/home
2423         # zfs allow users/home
2424         -------------------------------------------------------------
2425         Local+Descendent permissions on (users/home)
2426                 user cindys quota,reservation
2427         -------------------------------------------------------------
2428         cindys% zfs set quota=10G users/home/marks
2429         cindys% zfs get quota users/home/marks
2430         NAME              PROPERTY  VALUE             SOURCE
2431         users/home/marks  quota     10G               local
2432
2433
2434
2435       Example 22 Removing ZFS Delegated Permissions on a ZFS Dataset
2436
2437
2438       The following example shows how to remove the snapshot permission  from
2439       the  staff  group  on  the  tank/users  file system. The permissions on
2440       tank/users are also displayed.
2441
2442
2443         # zfs unallow staff snapshot tank/users
2444         # zfs allow tank/users
2445         -------------------------------------------------------------
2446         Permission sets on (tank/users)
2447                 @pset create,destroy,mount,snapshot
2448         Create time permissions on (tank/users)
2449                 create,destroy
2450         Local+Descendent permissions on (tank/users)
2451                 group staff @pset,create,mount
2452         -------------------------------------------------------------
2453
2454
2455

EXIT STATUS

2457       The following exit values are returned:
2458
2459       0
2460
2461           Successful completion.
2462
2463
2464       1
2465
2466           An error occurred.
2467
2468
2469       2
2470
2471           Invalid command line options were specified.
2472
2473

ATTRIBUTES

2475       See attributes(5) for descriptions of the following attributes:
2476
2477
2478
2479
2480       ┌─────────────────────────────┬─────────────────────────────┐
2481       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
2482       ├─────────────────────────────┼─────────────────────────────┤
2483       │Availability                 │SUNWzfsu                     │
2484       ├─────────────────────────────┼─────────────────────────────┤
2485       │Interface Stability          │Committed                    │
2486       └─────────────────────────────┴─────────────────────────────┘
2487

SEE ALSO

2489       ssh(1), iscsitadm(1M), mount(1M), share(1M), sharemgr(1M), unshare(1M),
2490       zonecfg(1M),   zpool(1M),   chmod(2),   stat(2),  write(2),  fsync(3C),
2491       dfstab(4), attributes(5)
2492
2493
2494       See the gzip(1) man page, which is not part of the SunOS man page  col‐
2495       lection.
2496
2497
2498       For information about using the ZFS web-based management tool and other
2499       ZFS features, see the Solaris ZFS Administration Guide.
2500
2501
2502
2503SunOS 5.11                        24 Sep 2009                          zfs(1M)
Impressum