]> git.proxmox.com Git - mirror_zfs.git/blob - man/man8/zfs.8
Move properties, parameters, events, and concepts around manual sections
[mirror_zfs.git] / man / man8 / zfs.8
1 .\"
2 .\" CDDL HEADER START
3 .\"
4 .\" The contents of this file are subject to the terms of the
5 .\" Common Development and Distribution License (the "License").
6 .\" You may not use this file except in compliance with the License.
7 .\"
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 .\" or http://www.opensolaris.org/os/licensing.
10 .\" See the License for the specific language governing permissions
11 .\" and limitations under the License.
12 .\"
13 .\" When distributing Covered Code, include this CDDL HEADER in each
14 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 .\" If applicable, add the following below this CDDL HEADER, with the
16 .\" fields enclosed by brackets "[]" replaced with your own identifying
17 .\" information: Portions Copyright [yyyy] [name of copyright owner]
18 .\"
19 .\" CDDL HEADER END
20 .\"
21 .\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
22 .\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
23 .\" Copyright (c) 2011, 2019 by Delphix. All rights reserved.
24 .\" Copyright (c) 2011, Pawel Jakub Dawidek <pjd@FreeBSD.org>
25 .\" Copyright (c) 2012, Glen Barber <gjb@FreeBSD.org>
26 .\" Copyright (c) 2012, Bryan Drewery <bdrewery@FreeBSD.org>
27 .\" Copyright (c) 2013, Steven Hartland <smh@FreeBSD.org>
28 .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
29 .\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
30 .\" Copyright (c) 2014 by Adam Stevko. All rights reserved.
31 .\" Copyright (c) 2014 Integros [integros.com]
32 .\" Copyright (c) 2014, Xin LI <delphij@FreeBSD.org>
33 .\" Copyright (c) 2014-2015, The FreeBSD Foundation, All Rights Reserved.
34 .\" Copyright (c) 2016 Nexenta Systems, Inc. All Rights Reserved.
35 .\" Copyright 2019 Richard Laager. All rights reserved.
36 .\" Copyright 2018 Nexenta Systems, Inc.
37 .\" Copyright 2019 Joyent, Inc.
38 .\"
39 .Dd June 30, 2019
40 .Dt ZFS 8
41 .Os
42 .
43 .Sh NAME
44 .Nm zfs
45 .Nd configure ZFS datasets
46 .Sh SYNOPSIS
47 .Nm
48 .Fl ?V
49 .Nm
50 .Cm version
51 .Nm
52 .Cm subcommand
53 .Op Ar arguments
54 .
55 .Sh DESCRIPTION
56 The
57 .Nm
58 command configures ZFS datasets within a ZFS storage pool, as described in
59 .Xr zpool 8 .
60 A dataset is identified by a unique path within the ZFS namespace.
61 For example:
62 .Dl pool/{filesystem,volume,snapshot}
63 .Pp
64 where the maximum length of a dataset name is
65 .Sy MAXNAMELEN Pq 256B
66 and the maximum amount of nesting allowed in a path is 50 levels deep.
67 .Pp
68 A dataset can be one of the following:
69 .Bl -tag -offset Ds -width "file system"
70 .It Sy file system
71 Can be mounted within the standard system namespace and behaves like other file
72 systems.
73 While ZFS file systems are designed to be POSIX-compliant, known issues exist
74 that prevent compliance in some cases.
75 Applications that depend on standards conformance might fail due to non-standard
76 behavior when checking file system free space.
77 .It Sy volume
78 A logical volume exported as a raw or block device.
79 This type of dataset should only be used when a block device is required.
80 File systems are typically used in most environments.
81 .It Sy snapshot
82 A read-only version of a file system or volume at a given point in time.
83 It is specified as
84 .Ar filesystem Ns @ Ns Ar name
85 or
86 .Ar volume Ns @ Ns Ar name .
87 .It Sy bookmark
88 Much like a
89 .Sy snapshot ,
90 but without the hold on on-disk data.
91 It can be used as the source of a send (but not for a receive).
92 It is specified as
93 .Ar filesystem Ns # Ns Ar name
94 or
95 .Ar volume Ns # Ns Ar name .
96 .El
97 .Pp
98 See
99 .Xr zfsconcepts 7
100 for details.
101 .
102 .Ss Properties
103 Properties are divided into two types: native properties and user-defined
104 .Pq or Qq user
105 properties.
106 Native properties either export internal statistics or control ZFS behavior.
107 In addition, native properties are either editable or read-only.
108 User properties have no effect on ZFS behavior, but you can use them to annotate
109 datasets in a way that is meaningful in your environment.
110 For more information about properties, see
111 .Xr zfsprops 7 .
112 .
113 .Ss Encryption
114 Enabling the
115 .Sy encryption
116 feature allows for the creation of encrypted filesystems and volumes.
117 ZFS will encrypt file and zvol data, file attributes, ACLs, permission bits,
118 directory listings, FUID mappings, and
119 .Sy userused Ns / Ns Sy groupused Ns / Ns Sy projectused
120 data.
121 For an overview of encryption, see
122 .Xr zfs-load-key 8 .
123 .
124 .Sh SUBCOMMANDS
125 All subcommands that modify state are logged persistently to the pool in their
126 original form.
127 .Bl -tag -width ""
128 .It Nm Fl ?
129 Displays a help message.
130 .It Xo
131 .Nm
132 .Fl V , -version
133 .Xc
134 .It Xo
135 .Nm
136 .Cm version
137 .Xc
138 Displays the software version of the
139 .Nm
140 userland utility and the zfs kernel module.
141 .El
142 .
143 .Ss Dataset Management
144 .Bl -tag -width ""
145 .It Xr zfs-list 8
146 Lists the property information for the given datasets in tabular form.
147 .It Xr zfs-create 8
148 Creates a new ZFS file system or volume.
149 .It Xr zfs-destroy 8
150 Destroys the given dataset(s), snapshot(s), or bookmark.
151 .It Xr zfs-rename 8
152 Renames the given dataset (filesystem or snapshot).
153 .It Xr zfs-upgrade 8
154 Manage upgrading the on-disk version of filesystems.
155 .El
156 .
157 .Ss Snapshots
158 .Bl -tag -width ""
159 .It Xr zfs-snapshot 8
160 Creates snapshots with the given names.
161 .It Xr zfs-rollback 8
162 Roll back the given dataset to a previous snapshot.
163 .It Xr zfs-hold 8 Ns / Ns Xr zfs-release 8
164 Add or remove a hold reference to the specified snapshot or snapshots.
165 If a hold exists on a snapshot, attempts to destroy that snapshot by using the
166 .Nm zfs Cm destroy
167 command return
168 .Sy EBUSY .
169 .It Xr zfs-diff 8
170 Display the difference between a snapshot of a given filesystem and another
171 snapshot of that filesystem from a later time or the current contents of the
172 filesystem.
173 .El
174 .
175 .Ss Clones
176 .Bl -tag -width ""
177 .It Xr zfs-clone 8
178 Creates a clone of the given snapshot.
179 .It Xr zfs-promote 8
180 Promotes a clone file system to no longer be dependent on its
181 .Qq origin
182 snapshot.
183 .El
184 .
185 .Ss Send & Receive
186 .Bl -tag -width ""
187 .It Xr zfs-send 8
188 Generate a send stream, which may be of a filesystem, and may be incremental
189 from a bookmark.
190 .It Xr zfs-receive 8
191 Creates a snapshot whose contents are as specified in the stream provided on
192 standard input.
193 If a full stream is received, then a new file system is created as well.
194 Streams are created using the
195 .Xr zfs-send 8
196 subcommand, which by default creates a full stream.
197 .It Xr zfs-bookmark 8
198 Creates a new bookmark of the given snapshot or bookmark.
199 Bookmarks mark the point in time when the snapshot was created, and can be used
200 as the incremental source for a
201 .Nm zfs Cm send
202 command.
203 .It Xr zfs-redact 8
204 Generate a new redaction bookmark.
205 This feature can be used to allow clones of a filesystem to be made available on
206 a remote system, in the case where their parent need not (or needs to not) be
207 usable.
208 .El
209 .
210 .Ss Properties
211 .Bl -tag -width ""
212 .It Xr zfs-get 8
213 Displays properties for the given datasets.
214 .It Xr zfs-set 8
215 Sets the property or list of properties to the given value(s) for each dataset.
216 .It Xr zfs-inherit 8
217 Clears the specified property, causing it to be inherited from an ancestor,
218 restored to default if no ancestor has the property set, or with the
219 .Fl S
220 option reverted to the received value if one exists.
221 .El
222 .
223 .Ss Quotas
224 .Bl -tag -width ""
225 .It Xr zfs-userspace 8 Ns / Ns Xr zfs-groupspace 8 Ns / Ns Xr zfs-projectspace 8
226 Displays space consumed by, and quotas on, each user, group, or project
227 in the specified filesystem or snapshot.
228 .It Xr zfs-project 8
229 List, set, or clear project ID and/or inherit flag on the file(s) or directories.
230 .El
231 .
232 .Ss Mountpoints
233 .Bl -tag -width ""
234 .It Xr zfs-mount 8
235 Displays all ZFS file systems currently mounted, or mount ZFS filesystem
236 on a path described by its
237 .Sy mountpoint
238 property.
239 .It Xr zfs-unmount 8
240 Unmounts currently mounted ZFS file systems.
241 .El
242 .
243 .Ss Shares
244 .Bl -tag -width ""
245 .It Xr zfs-share 8
246 Shares available ZFS file systems.
247 .It Xr zfs-unshare 8
248 Unshares currently shared ZFS file systems.
249 .El
250 .
251 .Ss Delegated Administration
252 .Bl -tag -width ""
253 .It Xr zfs-allow 8
254 Delegate permissions on the specified filesystem or volume.
255 .It Xr zfs-unallow 8
256 Remove delegated permissions on the specified filesystem or volume.
257 .El
258 .
259 .Ss Encryption
260 .Bl -tag -width ""
261 .It Xr zfs-change-key 8
262 Add or change an encryption key on the specified dataset.
263 .It Xr zfs-load-key 8
264 Load the key for the specified encrypted dataset, enabling access.
265 .It Xr zfs-unload-key 8
266 Unload a key for the specified dataset, removing the ability to access the dataset.
267 .El
268 .
269 .Ss Channel Programs
270 .Bl -tag -width ""
271 .It Xr zfs-program 8
272 Execute ZFS administrative operations
273 programmatically via a Lua script-language channel program.
274 .El
275 .
276 .Ss Jails
277 .Bl -tag -width ""
278 .It Xr zfs-jail 8
279 Attaches a filesystem to a jail.
280 .It Xr zfs-unjail 8
281 Detaches a filesystem from a jail.
282 .El
283 .
284 .Ss Waiting
285 .Bl -tag -width ""
286 .It Xr zfs-wait 8
287 Wait for background activity in a filesystem to complete.
288 .El
289 .
290 .Sh EXIT STATUS
291 The
292 .Nm
293 utility exits
294 .Sy 0
295 on success,
296 .Sy 1
297 if an error occurs, and
298 .Sy 2
299 if invalid command line options were specified.
300 .
301 .Sh EXAMPLES
302 .Bl -tag -width ""
303 .
304 .It Sy Example 1 : No Creating a ZFS File System Hierarchy
305 The following commands create a file system named
306 .Ar pool/home
307 and a file system named
308 .Ar pool/home/bob .
309 The mount point
310 .Pa /export/home
311 is set for the parent file system, and is automatically inherited by the child
312 file system.
313 .Dl # Nm zfs Cm create Ar pool/home
314 .Dl # Nm zfs Cm set Sy mountpoint Ns = Ns Ar /export/home pool/home
315 .Dl # Nm zfs Cm create Ar pool/home/bob
316 .
317 .It Sy Example 2 : No Creating a ZFS Snapshot
318 The following command creates a snapshot named
319 .Ar yesterday .
320 This snapshot is mounted on demand in the
321 .Pa .zfs/snapshot
322 directory at the root of the
323 .Ar pool/home/bob
324 file system.
325 .Dl # Nm zfs Cm snapshot Ar pool/home/bob Ns @ Ns Ar yesterday
326 .
327 .It Sy Example 3 : No Creating and Destroying Multiple Snapshots
328 The following command creates snapshots named
329 .Ar yesterday No of Ar pool/home
330 and all of its descendent file systems.
331 Each snapshot is mounted on demand in the
332 .Pa .zfs/snapshot
333 directory at the root of its file system.
334 The second command destroys the newly created snapshots.
335 .Dl # Nm zfs Cm snapshot Fl r Ar pool/home Ns @ Ns Ar yesterday
336 .Dl # Nm zfs Cm destroy Fl r Ar pool/home Ns @ Ns Ar yesterday
337 .
338 .It Sy Example 4 : No Disabling and Enabling File System Compression
339 The following command disables the
340 .Sy compression
341 property for all file systems under
342 .Ar pool/home .
343 The next command explicitly enables
344 .Sy compression
345 for
346 .Ar pool/home/anne .
347 .Dl # Nm zfs Cm set Sy compression Ns = Ns Sy off Ar pool/home
348 .Dl # Nm zfs Cm set Sy compression Ns = Ns Sy on Ar pool/home/anne
349 .
350 .It Sy Example 5 : No Listing ZFS Datasets
351 The following command lists all active file systems and volumes in the system.
352 Snapshots are displayed if
353 .Sy listsnaps Ns = Ns Sy on .
354 The default is
355 .Sy off .
356 See
357 .Xr zpoolprops 7
358 for more information on pool properties.
359 .Bd -literal -compact -offset Ds
360 .No # Nm zfs Cm list
361 NAME USED AVAIL REFER MOUNTPOINT
362 pool 450K 457G 18K /pool
363 pool/home 315K 457G 21K /export/home
364 pool/home/anne 18K 457G 18K /export/home/anne
365 pool/home/bob 276K 457G 276K /export/home/bob
366 .Ed
367 .
368 .It Sy Example 6 : No Setting a Quota on a ZFS File System
369 The following command sets a quota of 50 Gbytes for
370 .Ar pool/home/bob :
371 .Dl # Nm zfs Cm set Sy quota Ns = Ns Ar 50G pool/home/bob
372 .
373 .It Sy Example 7 : No Listing ZFS Properties
374 The following command lists all properties for
375 .Ar pool/home/bob :
376 .Bd -literal -compact -offset Ds
377 .No # Nm zfs Cm get Sy all Ar pool/home/bob
378 NAME PROPERTY VALUE SOURCE
379 pool/home/bob type filesystem -
380 pool/home/bob creation Tue Jul 21 15:53 2009 -
381 pool/home/bob used 21K -
382 pool/home/bob available 20.0G -
383 pool/home/bob referenced 21K -
384 pool/home/bob compressratio 1.00x -
385 pool/home/bob mounted yes -
386 pool/home/bob quota 20G local
387 pool/home/bob reservation none default
388 pool/home/bob recordsize 128K default
389 pool/home/bob mountpoint /pool/home/bob default
390 pool/home/bob sharenfs off default
391 pool/home/bob checksum on default
392 pool/home/bob compression on local
393 pool/home/bob atime on default
394 pool/home/bob devices on default
395 pool/home/bob exec on default
396 pool/home/bob setuid on default
397 pool/home/bob readonly off default
398 pool/home/bob zoned off default
399 pool/home/bob snapdir hidden default
400 pool/home/bob acltype off default
401 pool/home/bob aclmode discard default
402 pool/home/bob aclinherit restricted default
403 pool/home/bob canmount on default
404 pool/home/bob xattr on default
405 pool/home/bob copies 1 default
406 pool/home/bob version 4 -
407 pool/home/bob utf8only off -
408 pool/home/bob normalization none -
409 pool/home/bob casesensitivity sensitive -
410 pool/home/bob vscan off default
411 pool/home/bob nbmand off default
412 pool/home/bob sharesmb off default
413 pool/home/bob refquota none default
414 pool/home/bob refreservation none default
415 pool/home/bob primarycache all default
416 pool/home/bob secondarycache all default
417 pool/home/bob usedbysnapshots 0 -
418 pool/home/bob usedbydataset 21K -
419 pool/home/bob usedbychildren 0 -
420 pool/home/bob usedbyrefreservation 0 -
421 .Ed
422 .Pp
423 The following command gets a single property value:
424 .Bd -literal -compact -offset Ds
425 .No # Nm zfs Cm get Fl H o Sy value compression Ar pool/home/bob
426 on
427 .Ed
428 .Pp
429 The following command lists all properties with local settings for
430 .Ar pool/home/bob :
431 .Bd -literal -compact -offset Ds
432 .No # Nm zfs Cm get Fl r s Sy local Fl o Sy name , Ns Sy property , Ns Sy value all Ar pool/home/bob
433 NAME PROPERTY VALUE
434 pool/home/bob quota 20G
435 pool/home/bob compression on
436 .Ed
437 .
438 .It Sy Example 8 : No Rolling Back a ZFS File System
439 The following command reverts the contents of
440 .Ar pool/home/anne
441 to the snapshot named
442 .Ar yesterday ,
443 deleting all intermediate snapshots:
444 .Dl # Nm zfs Cm rollback Fl r Ar pool/home/anne Ns @ Ns Ar yesterday
445 .
446 .It Sy Example 9 : No Creating a ZFS Clone
447 The following command creates a writable file system whose initial contents are
448 the same as
449 .Ar pool/home/bob@yesterday .
450 .Dl # Nm zfs Cm clone Ar pool/home/bob@yesterday pool/clone
451 .
452 .It Sy Example 10 : No Promoting a ZFS Clone
453 The following commands illustrate how to test out changes to a file system, and
454 then replace the original file system with the changed one, using clones, clone
455 promotion, and renaming:
456 .Bd -literal -compact -offset Ds
457 .No # Nm zfs Cm create Ar pool/project/production
458 populate /pool/project/production with data
459 .No # Nm zfs Cm snapshot Ar pool/project/production Ns @ Ns Ar today
460 .No # Nm zfs Cm clone Ar pool/project/production@today pool/project/beta
461 make changes to /pool/project/beta and test them
462 .No # Nm zfs Cm promote Ar pool/project/beta
463 .No # Nm zfs Cm rename Ar pool/project/production pool/project/legacy
464 .No # Nm zfs Cm rename Ar pool/project/beta pool/project/production
465 once the legacy version is no longer needed, it can be destroyed
466 .No # Nm zfs Cm destroy Ar pool/project/legacy
467 .Ed
468 .
469 .It Sy Example 11 : No Inheriting ZFS Properties
470 The following command causes
471 .Ar pool/home/bob No and Ar pool/home/anne
472 to inherit the
473 .Sy checksum
474 property from their parent.
475 .Dl # Nm zfs Cm inherit Sy checksum Ar pool/home/bob pool/home/anne
476 .
477 .It Sy Example 12 : No Remotely Replicating ZFS Data
478 The following commands send a full stream and then an incremental stream to a
479 remote machine, restoring them into
480 .Em poolB/received/fs@a
481 and
482 .Em poolB/received/fs@b ,
483 respectively.
484 .Em poolB
485 must contain the file system
486 .Em poolB/received ,
487 and must not initially contain
488 .Em poolB/received/fs .
489 .Bd -literal -compact -offset Ds
490 .No # Nm zfs Cm send Ar pool/fs@a |
491 .No " " Nm ssh Ar host Nm zfs Cm receive Ar poolB/received/fs Ns @ Ns Ar a
492 .No # Nm zfs Cm send Fl i Ar a pool/fs@b |
493 .No " " Nm ssh Ar host Nm zfs Cm receive Ar poolB/received/fs
494 .Ed
495 .
496 .It Sy Example 13 : No Using the Nm zfs Cm receive Fl d No Option
497 The following command sends a full stream of
498 .Ar poolA/fsA/fsB@snap
499 to a remote machine, receiving it into
500 .Ar poolB/received/fsA/fsB@snap .
501 The
502 .Ar fsA/fsB@snap
503 portion of the received snapshot's name is determined from the name of the sent
504 snapshot.
505 .Ar poolB
506 must contain the file system
507 .Ar poolB/received .
508 If
509 .Ar poolB/received/fsA
510 does not exist, it is created as an empty file system.
511 .Bd -literal -compact -offset Ds
512 .No # Nm zfs Cm send Ar poolA/fsA/fsB@snap |
513 .No " " Nm ssh Ar host Nm zfs Cm receive Fl d Ar poolB/received
514 .Ed
515 .
516 .It Sy Example 14 : No Setting User Properties
517 The following example sets the user-defined
518 .Ar com.example : Ns Ar department
519 property for a dataset:
520 .Dl # Nm zfs Cm set Ar com.example : Ns Ar department Ns = Ns Ar 12345 tank/accounting
521 .
522 .It Sy Example 15 : No Performing a Rolling Snapshot
523 The following example shows how to maintain a history of snapshots with a
524 consistent naming scheme.
525 To keep a week's worth of snapshots, the user destroys the oldest snapshot,
526 renames the remaining snapshots, and then creates a new snapshot, as follows:
527 .Bd -literal -compact -offset Ds
528 .No # Nm zfs Cm destroy Fl r Ar pool/users@7daysago
529 .No # Nm zfs Cm rename Fl r Ar pool/users@6daysago No @ Ns Ar 7daysago
530 .No # Nm zfs Cm rename Fl r Ar pool/users@5daysago No @ Ns Ar 6daysago
531 .No # Nm zfs Cm rename Fl r Ar pool/users@4daysago No @ Ns Ar 5daysago
532 .No # Nm zfs Cm rename Fl r Ar pool/users@3daysago No @ Ns Ar 4daysago
533 .No # Nm zfs Cm rename Fl r Ar pool/users@2daysago No @ Ns Ar 3daysago
534 .No # Nm zfs Cm rename Fl r Ar pool/users@yesterday No @ Ns Ar 2daysago
535 .No # Nm zfs Cm rename Fl r Ar pool/users@today No @ Ns Ar yesterday
536 .No # Nm zfs Cm snapshot Fl r Ar pool/users Ns @ Ns Ar today
537 .Ed
538 .
539 .It Sy Example 16 : No Setting sharenfs Property Options on a ZFS File System
540 The following commands show how to set
541 .Sy sharenfs
542 property options to enable read-write
543 access for a set of IP addresses and to enable root access for system
544 .Qq neo
545 on the
546 .Ar tank/home
547 file system:
548 .Dl # Nm zfs Cm set Sy sharenfs Ns = Ns ' Ns Ar rw Ns =@123.123.0.0/16,root= Ns Ar neo Ns ' tank/home
549 .Pp
550 If you are using DNS for host name resolution,
551 specify the fully-qualified hostname.
552 .
553 .It Sy Example 17 : No Delegating ZFS Administration Permissions on a ZFS Dataset
554 The following example shows how to set permissions so that user
555 .Ar cindys
556 can create, destroy, mount, and take snapshots on
557 .Ar tank/cindys .
558 The permissions on
559 .Ar tank/cindys
560 are also displayed.
561 .Bd -literal -compact -offset Ds
562 .No # Nm zfs Cm allow Sy cindys create , Ns Sy destroy , Ns Sy mount , Ns Sy snapshot Ar tank/cindys
563 .No # Nm zfs Cm allow Ar tank/cindys
564 ---- Permissions on tank/cindys --------------------------------------
565 Local+Descendent permissions:
566 user cindys create,destroy,mount,snapshot
567 .Ed
568 .Pp
569 Because the
570 .Ar tank/cindys
571 mount point permission is set to 755 by default, user
572 .Ar cindys
573 will be unable to mount file systems under
574 .Ar tank/cindys .
575 Add an ACE similar to the following syntax to provide mount point access:
576 .Dl # Cm chmod No A+user: Ns Ar cindys Ns :add_subdirectory:allow Ar /tank/cindys
577 .
578 .It Sy Example 18 : No Delegating Create Time Permissions on a ZFS Dataset
579 The following example shows how to grant anyone in the group
580 .Ar staff
581 to create file systems in
582 .Ar tank/users .
583 This syntax also allows staff members to destroy their own file systems, but not
584 destroy anyone else's file system.
585 The permissions on
586 .Ar tank/users
587 are also displayed.
588 .Bd -literal -compact -offset Ds
589 .No # Nm zfs Cm allow Ar staff Sy create , Ns Sy mount Ar tank/users
590 .No # Nm zfs Cm allow Fl c Sy destroy Ar tank/users
591 .No # Nm zfs Cm allow Ar tank/users
592 ---- Permissions on tank/users ---------------------------------------
593 Permission sets:
594 destroy
595 Local+Descendent permissions:
596 group staff create,mount
597 .Ed
598 .
599 .It Sy Example 19 : No Defining and Granting a Permission Set on a ZFS Dataset
600 The following example shows how to define and grant a permission set on the
601 .Ar tank/users
602 file system.
603 The permissions on
604 .Ar tank/users
605 are also displayed.
606 .Bd -literal -compact -offset Ds
607 .No # Nm zfs Cm allow Fl s No @ Ns Ar pset Sy create , Ns Sy destroy , Ns Sy snapshot , Ns Sy mount Ar tank/users
608 .No # Nm zfs Cm allow staff No @ Ns Ar pset tank/users
609 .No # Nm zfs Cm allow Ar tank/users
610 ---- Permissions on tank/users ---------------------------------------
611 Permission sets:
612 @pset create,destroy,mount,snapshot
613 Local+Descendent permissions:
614 group staff @pset
615 .Ed
616 .
617 .It Sy Example 20 : No Delegating Property Permissions on a ZFS Dataset
618 The following example shows to grant the ability to set quotas and reservations
619 on the
620 .Ar users/home
621 file system.
622 The permissions on
623 .Ar users/home
624 are also displayed.
625 .Bd -literal -compact -offset Ds
626 .No # Nm zfs Cm allow Ar cindys Sy quota , Ns Sy reservation Ar users/home
627 .No # Nm zfs Cm allow Ar users/home
628 ---- Permissions on users/home ---------------------------------------
629 Local+Descendent permissions:
630 user cindys quota,reservation
631 cindys% zfs set quota=10G users/home/marks
632 cindys% zfs get quota users/home/marks
633 NAME PROPERTY VALUE SOURCE
634 users/home/marks quota 10G local
635 .Ed
636 .
637 .It Sy Example 21 : No Removing ZFS Delegated Permissions on a ZFS Dataset
638 The following example shows how to remove the snapshot permission from the
639 .Ar staff
640 group on the
641 .Sy tank/users
642 file system.
643 The permissions on
644 .Sy tank/users
645 are also displayed.
646 .Bd -literal -compact -offset Ds
647 .No # Nm zfs Cm unallow Ar staff Sy snapshot Ar tank/users
648 .No # Nm zfs Cm allow Ar tank/users
649 ---- Permissions on tank/users ---------------------------------------
650 Permission sets:
651 @pset create,destroy,mount,snapshot
652 Local+Descendent permissions:
653 group staff @pset
654 .Ed
655 .
656 .It Sy Example 22 : No Showing the differences between a snapshot and a ZFS Dataset
657 The following example shows how to see what has changed between a prior
658 snapshot of a ZFS dataset and its current state.
659 The
660 .Fl F
661 option is used to indicate type information for the files affected.
662 .Bd -literal -compact -offset Ds
663 .No # Nm zfs Cm diff Fl F Ar tank/test@before tank/test
664 M / /tank/test/
665 M F /tank/test/linked (+1)
666 R F /tank/test/oldname -> /tank/test/newname
667 - F /tank/test/deleted
668 + F /tank/test/created
669 M F /tank/test/modified
670 .Ed
671 .
672 .It Sy Example 23 : No Creating a bookmark
673 The following example create a bookmark to a snapshot.
674 This bookmark can then be used instead of snapshot in send streams.
675 .Dl # Nm zfs Cm bookmark Ar rpool Ns @ Ns Ar snapshot rpool Ns # Ns Ar bookmark
676 .
677 .It Sy Example 24 : No Setting Sy sharesmb No Property Options on a ZFS File System
678 The following example show how to share SMB filesystem through ZFS.
679 Note that a user and their password must be given.
680 .Dl # Nm smbmount Ar //127.0.0.1/share_tmp /mnt/tmp Fl o No user=workgroup/turbo,password=obrut,uid=1000
681 .Pp
682 Minimal
683 .Pa /etc/samba/smb.conf
684 configuration is required, as follows.
685 .Pp
686 Samba will need to bind to the loopback interface for the ZFS utilities to
687 communicate with Samba.
688 This is the default behavior for most Linux distributions.
689 .Pp
690 Samba must be able to authenticate a user.
691 This can be done in a number of ways
692 .Pq Xr passwd 5 , LDAP , Xr smbpasswd 5 , &c.\& .
693 How to do this is outside the scope of this document – refer to
694 .Xr smb.conf 5
695 for more information.
696 .Pp
697 See the
698 .Sx USERSHARES
699 section for all configuration options,
700 in case you need to modify any options of the share afterwards.
701 Do note that any changes done with the
702 .Xr net 8
703 command will be undone if the share is ever unshared (like via a reboot).
704 .El
705 .
706 .Sh ENVIRONMENT VARIABLES
707 .Bl -tag -width "ZFS_MOUNT_HELPER"
708 .It Sy ZFS_MOUNT_HELPER
709 Cause
710 .Nm zfs Cm mount
711 to use
712 .Xr mount 8
713 to mount ZFS datasets.
714 This option is provided for backwards compatibility with older ZFS versions.
715 .El
716 .
717 .Sh INTERFACE STABILITY
718 .Sy Committed .
719 .
720 .Sh SEE ALSO
721 .Xr attr 1 ,
722 .Xr gzip 1 ,
723 .Xr ssh 1 ,
724 .Xr chmod 2 ,
725 .Xr fsync 2 ,
726 .Xr stat 2 ,
727 .Xr write 2 ,
728 .Xr acl 5 ,
729 .Xr attributes 5 ,
730 .Xr exports 5 ,
731 .Xr zfsconcepts 7 ,
732 .Xr zfsprops 7 ,
733 .Xr exportfs 8 ,
734 .Xr mount 8 ,
735 .Xr net 8 ,
736 .Xr selinux 8 ,
737 .Xr zfs-allow 8 ,
738 .Xr zfs-bookmark 8 ,
739 .Xr zfs-change-key 8 ,
740 .Xr zfs-clone 8 ,
741 .Xr zfs-create 8 ,
742 .Xr zfs-destroy 8 ,
743 .Xr zfs-diff 8 ,
744 .Xr zfs-get 8 ,
745 .Xr zfs-groupspace 8 ,
746 .Xr zfs-hold 8 ,
747 .Xr zfs-inherit 8 ,
748 .Xr zfs-jail 8 ,
749 .Xr zfs-list 8 ,
750 .Xr zfs-load-key 8 ,
751 .Xr zfs-mount 8 ,
752 .Xr zfs-program 8 ,
753 .Xr zfs-project 8 ,
754 .Xr zfs-projectspace 8 ,
755 .Xr zfs-promote 8 ,
756 .Xr zfs-receive 8 ,
757 .Xr zfs-redact 8 ,
758 .Xr zfs-release 8 ,
759 .Xr zfs-rename 8 ,
760 .Xr zfs-rollback 8 ,
761 .Xr zfs-send 8 ,
762 .Xr zfs-set 8 ,
763 .Xr zfs-share 8 ,
764 .Xr zfs-snapshot 8 ,
765 .Xr zfs-unallow 8 ,
766 .Xr zfs-unjail 8 ,
767 .Xr zfs-unload-key 8 ,
768 .Xr zfs-unmount 8 ,
769 .Xr zfs-unshare 8 ,
770 .Xr zfs-upgrade 8 ,
771 .Xr zfs-userspace 8 ,
772 .Xr zfs-wait 8 ,
773 .Xr zpool 8