Print this page
9286 want refreservation=auto
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man1m/zfs.1m.man.txt
+++ new/usr/src/man/man1m/zfs.1m.man.txt
1 1 ZFS(1M) Maintenance Commands ZFS(1M)
2 2
3 3 NAME
4 4 zfs - configures ZFS file systems
5 5
6 6 SYNOPSIS
7 7 zfs [-?]
8 8 zfs create [-p] [-o property=value]... filesystem
9 9 zfs create [-ps] [-b blocksize] [-o property=value]... -V size volume
10 10 zfs destroy [-Rfnprv] filesystem|volume
11 11 zfs destroy [-Rdnprv] filesystem|volume@snap[%snap[,snap[%snap]]]...
12 12 zfs destroy filesystem|volume#bookmark
13 13 zfs snapshot [-r] [-o property=value]...
14 14 filesystem@snapname|volume@snapname...
15 15 zfs rollback [-Rfr] snapshot
16 16 zfs clone [-p] [-o property=value]... snapshot filesystem|volume
17 17 zfs promote clone-filesystem
18 18 zfs rename [-f] filesystem|volume|snapshot filesystem|volume|snapshot
19 19 zfs rename [-fp] filesystem|volume filesystem|volume
20 20 zfs rename -r snapshot snapshot
21 21 zfs list [-r|-d depth] [-Hp] [-o property[,property]...] [-s property]...
22 22 [-S property]... [-t type[,type]...] [filesystem|volume|snapshot]...
23 23 zfs remap filesystem|volume
24 24 zfs set property=value [property=value]... filesystem|volume|snapshot...
25 25 zfs get [-r|-d depth] [-Hp] [-o field[,field]...] [-s source[,source]...]
26 26 [-t type[,type]...] all | property[,property]...
27 27 filesystem|volume|snapshot|bookmark...
28 28 zfs inherit [-rS] property filesystem|volume|snapshot...
29 29 zfs upgrade
30 30 zfs upgrade -v
31 31 zfs upgrade [-r] [-V version] -a | filesystem
32 32 zfs userspace [-Hinp] [-o field[,field]...] [-s field]... [-S field]...
33 33 [-t type[,type]...] filesystem|snapshot
34 34 zfs groupspace [-Hinp] [-o field[,field]...] [-s field]... [-S field]...
35 35 [-t type[,type]...] filesystem|snapshot
36 36 zfs mount
37 37 zfs mount [-Ov] [-o options] -a | filesystem
38 38 zfs unmount [-f] -a | filesystem|mountpoint
39 39 zfs share -a | filesystem
40 40 zfs unshare -a | filesystem|mountpoint
41 41 zfs bookmark snapshot bookmark
42 42 zfs send [-DLPRcenpv] [[-I|-i] snapshot] snapshot
43 43 zfs send [-Lce] [-i snapshot|bookmark] filesystem|volume|snapshot
44 44 zfs send [-Penv] -t receive_resume_token
45 45 zfs receive [-Fnsuv] [-o origin=snapshot] filesystem|volume|snapshot
46 46 zfs receive [-Fnsuv] [-d|-e] [-o origin=snapshot] filesystem
47 47 zfs receive -A filesystem|volume
48 48 zfs allow filesystem|volume
49 49 zfs allow [-dglu] user|group[,user|group]...
50 50 perm|@setname[,perm|@setname]... filesystem|volume
51 51 zfs allow [-dl] -e|everyone perm|@setname[,perm|@setname]...
52 52 filesystem|volume
53 53 zfs allow -c perm|@setname[,perm|@setname]... filesystem|volume
54 54 zfs allow -s @setname perm|@setname[,perm|@setname]... filesystem|volume
55 55 zfs unallow [-dglru] user|group[,user|group]...
56 56 [perm|@setname[,perm|@setname]...] filesystem|volume
57 57 zfs unallow [-dlr] -e|everyone [perm|@setname[,perm|@setname]...]
58 58 filesystem|volume
59 59 zfs unallow [-r] -c [perm|@setname[,perm|@setname]...] filesystem|volume
60 60 zfs unallow [-r] -s -@setname [perm|@setname[,perm|@setname]...]
61 61 filesystem|volume
62 62 zfs hold [-r] tag snapshot...
63 63 zfs holds [-r] snapshot...
64 64 zfs release [-r] tag snapshot...
65 65 zfs diff [-FHt] snapshot snapshot|filesystem
66 66 zfs program [-n] [-t timeout] [-m memory_limit] pool script [arg1 ...]
67 67
68 68 DESCRIPTION
69 69 The zfs command configures ZFS datasets within a ZFS storage pool, as
70 70 described in zpool(1M). A dataset is identified by a unique path within
71 71 the ZFS namespace. For example:
72 72
73 73 pool/{filesystem,volume,snapshot}
74 74
75 75 where the maximum length of a dataset name is MAXNAMELEN (256 bytes).
76 76
77 77 A dataset can be one of the following:
78 78
79 79 file system A ZFS dataset of type filesystem can be mounted within the
80 80 standard system namespace and behaves like other file
81 81 systems. While ZFS file systems are designed to be POSIX
82 82 compliant, known issues exist that prevent compliance in
83 83 some cases. Applications that depend on standards
84 84 conformance might fail due to non-standard behavior when
85 85 checking file system free space.
86 86
87 87 volume A logical volume exported as a raw or block device. This
88 88 type of dataset should only be used under special
89 89 circumstances. File systems are typically used in most
90 90 environments.
91 91
92 92 snapshot A read-only version of a file system or volume at a given
93 93 point in time. It is specified as filesystem@name or
94 94 volume@name.
95 95
96 96 ZFS File System Hierarchy
97 97 A ZFS storage pool is a logical collection of devices that provide space
98 98 for datasets. A storage pool is also the root of the ZFS file system
99 99 hierarchy.
100 100
101 101 The root of the pool can be accessed as a file system, such as mounting
102 102 and unmounting, taking snapshots, and setting properties. The physical
103 103 storage characteristics, however, are managed by the zpool(1M) command.
104 104
105 105 See zpool(1M) for more information on creating and administering pools.
106 106
107 107 Snapshots
108 108 A snapshot is a read-only copy of a file system or volume. Snapshots can
109 109 be created extremely quickly, and initially consume no additional space
110 110 within the pool. As data within the active dataset changes, the snapshot
111 111 consumes more data than would otherwise be shared with the active
112 112 dataset.
113 113
114 114 Snapshots can have arbitrary names. Snapshots of volumes can be cloned
115 115 or rolled back, but cannot be accessed independently.
116 116
117 117 File system snapshots can be accessed under the .zfs/snapshot directory
118 118 in the root of the file system. Snapshots are automatically mounted on
119 119 demand and may be unmounted at regular intervals. The visibility of the
120 120 .zfs directory can be controlled by the snapdir property.
121 121
122 122 Clones
123 123 A clone is a writable volume or file system whose initial contents are
124 124 the same as another dataset. As with snapshots, creating a clone is
125 125 nearly instantaneous, and initially consumes no additional space.
126 126
127 127 Clones can only be created from a snapshot. When a snapshot is cloned,
128 128 it creates an implicit dependency between the parent and child. Even
129 129 though the clone is created somewhere else in the dataset hierarchy, the
130 130 original snapshot cannot be destroyed as long as a clone exists. The
131 131 origin property exposes this dependency, and the destroy command lists
132 132 any such dependencies, if they exist.
133 133
134 134 The clone parent-child dependency relationship can be reversed by using
135 135 the promote subcommand. This causes the "origin" file system to become a
136 136 clone of the specified file system, which makes it possible to destroy
137 137 the file system that the clone was created from.
138 138
139 139 Mount Points
140 140 Creating a ZFS file system is a simple operation, so the number of file
141 141 systems per system is likely to be numerous. To cope with this, ZFS
142 142 automatically manages mounting and unmounting file systems without the
143 143 need to edit the /etc/vfstab file. All automatically managed file
144 144 systems are mounted by ZFS at boot time.
145 145
146 146 By default, file systems are mounted under /path, where path is the name
147 147 of the file system in the ZFS namespace. Directories are created and
148 148 destroyed as needed.
149 149
150 150 A file system can also have a mount point set in the mountpoint property.
151 151 This directory is created as needed, and ZFS automatically mounts the
152 152 file system when the zfs mount -a command is invoked (without editing
153 153 /etc/vfstab). The mountpoint property can be inherited, so if pool/home
154 154 has a mount point of /export/stuff, then pool/home/user automatically
155 155 inherits a mount point of /export/stuff/user.
156 156
157 157 A file system mountpoint property of none prevents the file system from
158 158 being mounted.
159 159
160 160 If needed, ZFS file systems can also be managed with traditional tools
161 161 (mount, umount, /etc/vfstab). If a file system's mount point is set to
162 162 legacy, ZFS makes no attempt to manage the file system, and the
163 163 administrator is responsible for mounting and unmounting the file system.
164 164
165 165 Zones
166 166 A ZFS file system can be added to a non-global zone by using the zonecfg
167 167 add fs subcommand. A ZFS file system that is added to a non-global zone
168 168 must have its mountpoint property set to legacy.
169 169
170 170 The physical properties of an added file system are controlled by the
171 171 global administrator. However, the zone administrator can create,
172 172 modify, or destroy files within the added file system, depending on how
173 173 the file system is mounted.
174 174
175 175 A dataset can also be delegated to a non-global zone by using the zonecfg
176 176 add dataset subcommand. You cannot delegate a dataset to one zone and
177 177 the children of the same dataset to another zone. The zone administrator
178 178 can change properties of the dataset or any of its children. However,
179 179 the quota, filesystem_limit and snapshot_limit properties of the
180 180 delegated dataset can be modified only by the global administrator.
181 181
182 182 A ZFS volume can be added as a device to a non-global zone by using the
183 183 zonecfg add device subcommand. However, its physical properties can be
184 184 modified only by the global administrator.
185 185
186 186 For more information about zonecfg syntax, see zonecfg(1M).
187 187
188 188 After a dataset is delegated to a non-global zone, the zoned property is
189 189 automatically set. A zoned file system cannot be mounted in the global
190 190 zone, since the zone administrator might have to set the mount point to
191 191 an unacceptable value.
192 192
193 193 The global administrator can forcibly clear the zoned property, though
194 194 this should be done with extreme care. The global administrator should
195 195 verify that all the mount points are acceptable before clearing the
196 196 property.
197 197
198 198 Native Properties
199 199 Properties are divided into two types, native properties and user-defined
200 200 (or "user") properties. Native properties either export internal
201 201 statistics or control ZFS behavior. In addition, native properties are
202 202 either editable or read-only. User properties have no effect on ZFS
203 203 behavior, but you can use them to annotate datasets in a way that is
204 204 meaningful in your environment. For more information about user
205 205 properties, see the User Properties section, below.
206 206
207 207 Every dataset has a set of properties that export statistics about the
208 208 dataset as well as control various behaviors. Properties are inherited
209 209 from the parent unless overridden by the child. Some properties apply
210 210 only to certain types of datasets (file systems, volumes, or snapshots).
211 211
212 212 The values of numeric properties can be specified using human-readable
213 213 suffixes (for example, k, KB, M, Gb, and so forth, up to Z for
214 214 zettabyte). The following are all valid (and equal) specifications:
215 215 1536M, 1.5g, 1.50GB.
216 216
217 217 The values of non-numeric properties are case sensitive and must be
218 218 lowercase, except for mountpoint, sharenfs, and sharesmb.
219 219
220 220 The following native properties consist of read-only statistics about the
221 221 dataset. These properties can be neither set, nor inherited. Native
222 222 properties apply to all dataset types unless otherwise noted.
223 223
224 224 available The amount of space available to the dataset and
225 225 all its children, assuming that there is no other
226 226 activity in the pool. Because space is shared
227 227 within a pool, availability can be limited by any
228 228 number of factors, including physical pool size,
229 229 quotas, reservations, or other datasets within the
230 230 pool.
231 231
232 232 This property can also be referred to by its
233 233 shortened column name, avail.
234 234
235 235 compressratio For non-snapshots, the compression ratio achieved
236 236 for the used space of this dataset, expressed as a
237 237 multiplier. The used property includes descendant
238 238 datasets, and, for clones, does not include the
239 239 space shared with the origin snapshot. For
240 240 snapshots, the compressratio is the same as the
241 241 refcompressratio property. Compression can be
242 242 turned on by running: zfs set compression=on
243 243 dataset. The default value is off.
244 244
245 245 creation The time this dataset was created.
246 246
247 247 clones For snapshots, this property is a comma-separated
248 248 list of filesystems or volumes which are clones of
249 249 this snapshot. The clones' origin property is this
250 250 snapshot. If the clones property is not empty,
251 251 then this snapshot can not be destroyed (even with
252 252 the -r or -f options).
253 253
254 254 defer_destroy This property is on if the snapshot has been marked
255 255 for deferred destroy by using the zfs destroy -d
256 256 command. Otherwise, the property is off.
257 257
258 258 filesystem_count The total number of filesystems and volumes that
259 259 exist under this location in the dataset tree.
260 260 This value is only available when a
261 261 filesystem_limit has been set somewhere in the tree
262 262 under which the dataset resides.
263 263
264 264 logicalreferenced The amount of space that is "logically" accessible
265 265 by this dataset. See the referenced property. The
266 266 logical space ignores the effect of the compression
267 267 and copies properties, giving a quantity closer to
268 268 the amount of data that applications see. However,
269 269 it does include space consumed by metadata.
270 270
271 271 This property can also be referred to by its
272 272 shortened column name, lrefer.
273 273
274 274 logicalused The amount of space that is "logically" consumed by
275 275 this dataset and all its descendents. See the used
276 276 property. The logical space ignores the effect of
277 277 the compression and copies properties, giving a
278 278 quantity closer to the amount of data that
279 279 applications see. However, it does include space
280 280 consumed by metadata.
281 281
282 282 This property can also be referred to by its
283 283 shortened column name, lused.
284 284
285 285 mounted For file systems, indicates whether the file system
286 286 is currently mounted. This property can be either
287 287 yes or no.
288 288
289 289 origin For cloned file systems or volumes, the snapshot
290 290 from which the clone was created. See also the
291 291 clones property.
292 292
293 293 receive_resume_token For filesystems or volumes which have saved
294 294 partially-completed state from zfs receive -s, this
295 295 opaque token can be provided to zfs send -t to
296 296 resume and complete the zfs receive.
297 297
298 298 referenced The amount of data that is accessible by this
299 299 dataset, which may or may not be shared with other
300 300 datasets in the pool. When a snapshot or clone is
301 301 created, it initially references the same amount of
302 302 space as the file system or snapshot it was created
303 303 from, since its contents are identical.
304 304
305 305 This property can also be referred to by its
306 306 shortened column name, refer.
307 307
308 308 refcompressratio The compression ratio achieved for the referenced
309 309 space of this dataset, expressed as a multiplier.
310 310 See also the compressratio property.
311 311
312 312 snapshot_count The total number of snapshots that exist under this
313 313 location in the dataset tree. This value is only
314 314 available when a snapshot_limit has been set
315 315 somewhere in the tree under which the dataset
316 316 resides.
317 317
318 318 type The type of dataset: filesystem, volume, or
319 319 snapshot.
320 320
321 321 used The amount of space consumed by this dataset and
322 322 all its descendents. This is the value that is
323 323 checked against this dataset's quota and
324 324 reservation. The space used does not include this
325 325 dataset's reservation, but does take into account
326 326 the reservations of any descendent datasets. The
327 327 amount of space that a dataset consumes from its
328 328 parent, as well as the amount of space that is
329 329 freed if this dataset is recursively destroyed, is
330 330 the greater of its space used and its reservation.
331 331
332 332 The used space of a snapshot (see the Snapshots
333 333 section) is space that is referenced exclusively by
334 334 this snapshot. If this snapshot is destroyed, the
335 335 amount of used space will be freed. Space that is
336 336 shared by multiple snapshots isn't accounted for in
337 337 this metric. When a snapshot is destroyed, space
338 338 that was previously shared with this snapshot can
339 339 become unique to snapshots adjacent to it, thus
340 340 changing the used space of those snapshots. The
341 341 used space of the latest snapshot can also be
342 342 affected by changes in the file system. Note that
343 343 the used space of a snapshot is a subset of the
344 344 written space of the snapshot.
345 345
346 346 The amount of space used, available, or referenced
347 347 does not take into account pending changes.
348 348 Pending changes are generally accounted for within
349 349 a few seconds. Committing a change to a disk using
350 350 fsync(3C) or O_SYNC does not necessarily guarantee
351 351 that the space usage information is updated
352 352 immediately.
353 353
354 354 usedby* The usedby* properties decompose the used
355 355 properties into the various reasons that space is
356 356 used. Specifically, used = usedbychildren +
357 357 usedbydataset + usedbyrefreservation +
358 358 usedbysnapshots. These properties are only
359 359 available for datasets created on zpool "version
360 360 13" pools.
361 361
362 362 usedbychildren The amount of space used by children of this
363 363 dataset, which would be freed if all the dataset's
364 364 children were destroyed.
365 365
366 366 usedbydataset The amount of space used by this dataset itself,
367 367 which would be freed if the dataset were destroyed
368 368 (after first removing any refreservation and
369 369 destroying any necessary snapshots or descendents).
370 370
371 371 usedbyrefreservation The amount of space used by a refreservation set on
372 372 this dataset, which would be freed if the
373 373 refreservation was removed.
374 374
375 375 usedbysnapshots The amount of space consumed by snapshots of this
376 376 dataset. In particular, it is the amount of space
377 377 that would be freed if all of this dataset's
378 378 snapshots were destroyed. Note that this is not
379 379 simply the sum of the snapshots' used properties
380 380 because space can be shared by multiple snapshots.
381 381
382 382 userused@user The amount of space consumed by the specified user
383 383 in this dataset. Space is charged to the owner of
384 384 each file, as displayed by ls -l. The amount of
385 385 space charged is displayed by du and ls -s. See
386 386 the zfs userspace subcommand for more information.
387 387
388 388 Unprivileged users can access only their own space
389 389 usage. The root user, or a user who has been
390 390 granted the userused privilege with zfs allow, can
391 391 access everyone's usage.
392 392
393 393 The userused@... properties are not displayed by
394 394 zfs get all. The user's name must be appended
395 395 after the @ symbol, using one of the following
396 396 forms:
397 397
398 398 o POSIX name (for example, joe)
399 399
400 400 o POSIX numeric ID (for example, 789)
401 401
402 402 o SID name (for example, joe.smith@mydomain)
403 403
404 404 o SID numeric ID (for example, S-1-123-456-789)
405 405
406 406 userrefs This property is set to the number of user holds on
407 407 this snapshot. User holds are set by using the zfs
408 408 hold command.
409 409
410 410 groupused@group The amount of space consumed by the specified group
411 411 in this dataset. Space is charged to the group of
412 412 each file, as displayed by ls -l. See the
413 413 userused@user property for more information.
414 414
415 415 Unprivileged users can only access their own
416 416 groups' space usage. The root user, or a user who
417 417 has been granted the groupused privilege with zfs
418 418 allow, can access all groups' usage.
419 419
420 420 volblocksize For volumes, specifies the block size of the
421 421 volume. The blocksize cannot be changed once the
422 422 volume has been written, so it should be set at
423 423 volume creation time. The default blocksize for
424 424 volumes is 8 Kbytes. Any power of 2 from 512 bytes
425 425 to 128 Kbytes is valid.
426 426
427 427 This property can also be referred to by its
428 428 shortened column name, volblock.
429 429
430 430 written The amount of space referenced by this dataset,
431 431 that was written since the previous snapshot (i.e.
432 432 that is not referenced by the previous snapshot).
433 433
434 434 written@snapshot The amount of referenced space written to this
435 435 dataset since the specified snapshot. This is the
436 436 space that is referenced by this dataset but was
437 437 not referenced by the specified snapshot.
438 438
439 439 The snapshot may be specified as a short snapshot
440 440 name (just the part after the @), in which case it
441 441 will be interpreted as a snapshot in the same
442 442 filesystem as this dataset. The snapshot may be a
443 443 full snapshot name (filesystem@snapshot), which for
444 444 clones may be a snapshot in the origin's filesystem
445 445 (or the origin of the origin's filesystem, etc.)
446 446
447 447 The following native properties can be used to change the behavior of a
448 448 ZFS dataset.
449 449
450 450 aclinherit=discard|noallow|restricted|passthrough|passthrough-x
451 451 Controls how ACEs are inherited when files and directories are created.
452 452
453 453 discard does not inherit any ACEs.
454 454
455 455 noallow only inherits inheritable ACEs that specify "deny"
456 456 permissions.
457 457
458 458 restricted default, removes the write_acl and write_owner
459 459 permissions when the ACE is inherited.
460 460
461 461 passthrough inherits all inheritable ACEs without any modifications.
462 462
463 463 passthrough-x same meaning as passthrough, except that the owner@,
464 464 group@, and everyone@ ACEs inherit the execute
465 465 permission only if the file creation mode also requests
466 466 the execute bit.
467 467
468 468 When the property value is set to passthrough, files are created with a
469 469 mode determined by the inheritable ACEs. If no inheritable ACEs exist
470 470 that affect the mode, then the mode is set in accordance to the
471 471 requested mode from the application.
472 472
473 473 aclmode=discard|groupmask|passthrough|restricted
474 474 Controls how an ACL is modified during chmod(2) and how inherited ACEs
475 475 are modified by the file creation mode.
476 476
477 477 discard default, deletes all ACEs except for those representing
478 478 the mode of the file or directory requested by chmod(2).
479 479
480 480 groupmask reduces permissions granted by all ALLOW entries found in
481 481 the ACL such that they are no greater than the group
482 482 permissions specified by the mode.
483 483
484 484 passthrough indicates that no changes are made to the ACL other than
485 485 creating or updating the necessary ACEs to represent the
486 486 new mode of the file or directory.
487 487
488 488 restricted causes the chmod(2) operation to return an error when used
489 489 on any file or directory which has a non-trivial ACL, with
490 490 entries in addition to those that represent the mode.
491 491
492 492 chmod(2) is required to change the set user ID, set group ID, or sticky
493 493 bit on a file or directory, as they do not have equivalent ACEs. In
494 494 order to use chmod(2) on a file or directory with a non-trivial ACL
495 495 when aclmode is set to restricted, you must first remove all ACEs
496 496 except for those that represent the current mode.
497 497
498 498 atime=on|off
499 499 Controls whether the access time for files is updated when they are
500 500 read. Turning this property off avoids producing write traffic when
501 501 reading files and can result in significant performance gains, though
502 502 it might confuse mailers and other similar utilities. The default
503 503 value is on.
504 504
505 505 canmount=on|off|noauto
506 506 If this property is set to off, the file system cannot be mounted, and
507 507 is ignored by zfs mount -a. Setting this property to off is similar to
508 508 setting the mountpoint property to none, except that the dataset still
509 509 has a normal mountpoint property, which can be inherited. Setting this
510 510 property to off allows datasets to be used solely as a mechanism to
511 511 inherit properties. One example of setting canmount=off is to have two
512 512 datasets with the same mountpoint, so that the children of both
513 513 datasets appear in the same directory, but might have different
514 514 inherited characteristics.
515 515
516 516 When set to noauto, a dataset can only be mounted and unmounted
517 517 explicitly. The dataset is not mounted automatically when the dataset
518 518 is created or imported, nor is it mounted by the zfs mount -a command
519 519 or unmounted by the zfs unmount -a command.
520 520
521 521 This property is not inherited.
522 522
523 523 checksum=on|off|fletcher2|fletcher4|sha256|noparity|sha512|skein|edonr
524 524 Controls the checksum used to verify data integrity. The default value
525 525 is on, which automatically selects an appropriate algorithm (currently,
526 526 fletcher4, but this may change in future releases). The value off
527 527 disables integrity checking on user data. The value noparity not only
528 528 disables integrity but also disables maintaining parity for user data.
529 529 This setting is used internally by a dump device residing on a RAID-Z
530 530 pool and should not be used by any other dataset. Disabling checksums
531 531 is NOT a recommended practice.
532 532
533 533 The sha512, skein, and edonr checksum algorithms require enabling the
534 534 appropriate features on the pool. Please see zpool-features(5) for
535 535 more information on these algorithms.
536 536
537 537 Changing this property affects only newly-written data.
538 538
539 539 Salted checksum algorithms (edonr, skein) are currently not supported
540 540 for any filesystem on the boot pools.
541 541
542 542 compression=on|off|gzip|gzip-N|lz4|lzjb|zle
543 543 Controls the compression algorithm used for this dataset.
544 544
545 545 Setting compression to on indicates that the current default
546 546 compression algorithm should be used. The default balances compression
547 547 and decompression speed, with compression ratio and is expected to work
548 548 well on a wide variety of workloads. Unlike all other settings for
549 549 this property, on does not select a fixed compression type. As new
550 550 compression algorithms are added to ZFS and enabled on a pool, the
551 551 default compression algorithm may change. The current default
552 552 compression algorithm is either lzjb or, if the lz4_compress feature is
553 553 enabled, lz4.
554 554
555 555 The lz4 compression algorithm is a high-performance replacement for the
556 556 lzjb algorithm. It features significantly faster compression and
557 557 decompression, as well as a moderately higher compression ratio than
558 558 lzjb, but can only be used on pools with the lz4_compress feature set
559 559 to enabled. See zpool-features(5) for details on ZFS feature flags and
560 560 the lz4_compress feature.
561 561
562 562 The lzjb compression algorithm is optimized for performance while
563 563 providing decent data compression.
564 564
565 565 The gzip compression algorithm uses the same compression as the gzip(1)
566 566 command. You can specify the gzip level by using the value gzip-N,
567 567 where N is an integer from 1 (fastest) to 9 (best compression ratio).
568 568 Currently, gzip is equivalent to gzip-6 (which is also the default for
569 569 gzip(1)).
570 570
571 571 The zle compression algorithm compresses runs of zeros.
572 572
573 573 This property can also be referred to by its shortened column name
574 574 compress. Changing this property affects only newly-written data.
575 575
576 576 copies=1|2|3
577 577 Controls the number of copies of data stored for this dataset. These
578 578 copies are in addition to any redundancy provided by the pool, for
579 579 example, mirroring or RAID-Z. The copies are stored on different
580 580 disks, if possible. The space used by multiple copies is charged to
581 581 the associated file and dataset, changing the used property and
582 582 counting against quotas and reservations.
583 583
584 584 Changing this property only affects newly-written data. Therefore, set
585 585 this property at file system creation time by using the -o copies=N
586 586 option.
587 587
588 588 devices=on|off
589 589 Controls whether device nodes can be opened on this file system. The
590 590 default value is on.
591 591
592 592 exec=on|off
593 593 Controls whether processes can be executed from within this file
594 594 system. The default value is on.
595 595
596 596 filesystem_limit=count|none
597 597 Limits the number of filesystems and volumes that can exist under this
598 598 point in the dataset tree. The limit is not enforced if the user is
599 599 allowed to change the limit. Setting a filesystem_limit to on a
600 600 descendent of a filesystem that already has a filesystem_limit does not
601 601 override the ancestor's filesystem_limit, but rather imposes an
602 602 additional limit. This feature must be enabled to be used (see
603 603 zpool-features(5)).
604 604
605 605 mountpoint=path|none|legacy
606 606 Controls the mount point used for this file system. See the Mount
607 607 Points section for more information on how this property is used.
608 608
609 609 When the mountpoint property is changed for a file system, the file
610 610 system and any children that inherit the mount point are unmounted. If
611 611 the new value is legacy, then they remain unmounted. Otherwise, they
612 612 are automatically remounted in the new location if the property was
613 613 previously legacy or none, or if they were mounted before the property
614 614 was changed. In addition, any shared file systems are unshared and
615 615 shared in the new location.
616 616
617 617 nbmand=on|off
618 618 Controls whether the file system should be mounted with nbmand (Non
619 619 Blocking mandatory locks). This is used for SMB clients. Changes to
620 620 this property only take effect when the file system is umounted and
621 621 remounted. See mount(1M) for more information on nbmand mounts.
622 622
623 623 primarycache=all|none|metadata
624 624 Controls what is cached in the primary cache (ARC). If this property
625 625 is set to all, then both user data and metadata is cached. If this
626 626 property is set to none, then neither user data nor metadata is cached.
627 627 If this property is set to metadata, then only metadata is cached. The
628 628 default value is all.
629 629
630 630 quota=size|none
631 631 Limits the amount of space a dataset and its descendents can consume.
632 632 This property enforces a hard limit on the amount of space used. This
633 633 includes all space consumed by descendents, including file systems and
634 634 snapshots. Setting a quota on a descendent of a dataset that already
635 635 has a quota does not override the ancestor's quota, but rather imposes
636 636 an additional limit.
637 637
638 638 Quotas cannot be set on volumes, as the volsize property acts as an
639 639 implicit quota.
640 640
641 641 snapshot_limit=count|none
642 642 Limits the number of snapshots that can be created on a dataset and its
643 643 descendents. Setting a snapshot_limit on a descendent of a dataset
644 644 that already has a snapshot_limit does not override the ancestor's
645 645 snapshot_limit, but rather imposes an additional limit. The limit is
646 646 not enforced if the user is allowed to change the limit. For example,
647 647 this means that recursive snapshots taken from the global zone are
648 648 counted against each delegated dataset within a zone. This feature
649 649 must be enabled to be used (see zpool-features(5)).
650 650
651 651 userquota@user=size|none
652 652 Limits the amount of space consumed by the specified user. User space
653 653 consumption is identified by the userspace@user property.
654 654
655 655 Enforcement of user quotas may be delayed by several seconds. This
656 656 delay means that a user might exceed their quota before the system
657 657 notices that they are over quota and begins to refuse additional writes
658 658 with the EDQUOT error message. See the zfs userspace subcommand for
659 659 more information.
660 660
661 661 Unprivileged users can only access their own groups' space usage. The
662 662 root user, or a user who has been granted the userquota privilege with
663 663 zfs allow, can get and set everyone's quota.
664 664
665 665 This property is not available on volumes, on file systems before
666 666 version 4, or on pools before version 15. The userquota@... properties
667 667 are not displayed by zfs get all. The user's name must be appended
668 668 after the @ symbol, using one of the following forms:
669 669
670 670 o POSIX name (for example, joe)
671 671
672 672 o POSIX numeric ID (for example, 789)
673 673
674 674 o SID name (for example, joe.smith@mydomain)
675 675
676 676 o SID numeric ID (for example, S-1-123-456-789)
677 677
678 678 groupquota@group=size|none
679 679 Limits the amount of space consumed by the specified group. Group
680 680 space consumption is identified by the groupused@group property.
681 681
682 682 Unprivileged users can access only their own groups' space usage. The
683 683 root user, or a user who has been granted the groupquota privilege with
684 684 zfs allow, can get and set all groups' quotas.
685 685
686 686 readonly=on|off
687 687 Controls whether this dataset can be modified. The default value is
688 688 off.
689 689
690 690 This property can also be referred to by its shortened column name,
691 691 rdonly.
692 692
693 693 recordsize=size
694 694 Specifies a suggested block size for files in the file system. This
695 695 property is designed solely for use with database workloads that access
696 696 files in fixed-size records. ZFS automatically tunes block sizes
697 697 according to internal algorithms optimized for typical access patterns.
698 698
699 699 For databases that create very large files but access them in small
700 700 random chunks, these algorithms may be suboptimal. Specifying a
701 701 recordsize greater than or equal to the record size of the database can
702 702 result in significant performance gains. Use of this property for
703 703 general purpose file systems is strongly discouraged, and may adversely
704 704 affect performance.
705 705
706 706 The size specified must be a power of two greater than or equal to 512
707 707 and less than or equal to 128 Kbytes. If the large_blocks feature is
708 708 enabled on the pool, the size may be up to 1 Mbyte. See
709 709 zpool-features(5) for details on ZFS feature flags.
710 710
711 711 Changing the file system's recordsize affects only files created
712 712 afterward; existing files are unaffected.
713 713
714 714 This property can also be referred to by its shortened column name,
715 715 recsize.
716 716
717 717 redundant_metadata=all|most
718 718 Controls what types of metadata are stored redundantly. ZFS stores an
719 719 extra copy of metadata, so that if a single block is corrupted, the
720 720 amount of user data lost is limited. This extra copy is in addition to
721 721 any redundancy provided at the pool level (e.g. by mirroring or
722 722 RAID-Z), and is in addition to an extra copy specified by the copies
723 723 property (up to a total of 3 copies). For example if the pool is
724 724 mirrored, copies=2, and redundant_metadata=most, then ZFS stores 6
725 725 copies of most metadata, and 4 copies of data and some metadata.
726 726
727 727 When set to all, ZFS stores an extra copy of all metadata. If a single
728 728 on-disk block is corrupt, at worst a single block of user data (which
729 729 is recordsize bytes long) can be lost.
730 730
731 731 When set to most, ZFS stores an extra copy of most types of metadata.
732 732 This can improve performance of random writes, because less metadata
733 733 must be written. In practice, at worst about 100 blocks (of recordsize
734 734 bytes each) of user data can be lost if a single on-disk block is
735 735 corrupt. The exact behavior of which metadata blocks are stored
↓ open down ↓ |
735 lines elided |
↑ open up ↑ |
736 736 redundantly may change in future releases.
737 737
738 738 The default value is all.
739 739
740 740 refquota=size|none
741 741 Limits the amount of space a dataset can consume. This property
742 742 enforces a hard limit on the amount of space used. This hard limit
743 743 does not include space used by descendents, including file systems and
744 744 snapshots.
745 745
746 - refreservation=size|none
746 + refreservation=size|none|auto
747 747 The minimum amount of space guaranteed to a dataset, not including its
748 748 descendents. When the amount of space used is below this value, the
749 749 dataset is treated as if it were taking up the amount of space
750 750 specified by refreservation. The refreservation reservation is
751 751 accounted for in the parent datasets' space used, and counts against
752 752 the parent datasets' quotas and reservations.
753 753
754 754 If refreservation is set, a snapshot is only allowed if there is enough
755 755 free pool space outside of this reservation to accommodate the current
756 756 number of "referenced" bytes in the dataset.
757 757
758 + If refreservation is set to auto, a volume is made dense (or "not
759 + sparse"). refreservation=auto is only supported on volumes. See
760 + volsize in the Native Properties section for more information about
761 + sparse volumes.
762 +
758 763 This property can also be referred to by its shortened column name,
759 764 refreserv.
760 765
761 - reservation=size|none
766 + reservation=size|none|auto
762 767 The minimum amount of space guaranteed to a dataset and its
763 768 descendants. When the amount of space used is below this value, the
764 769 dataset is treated as if it were taking up the amount of space
765 770 specified by its reservation. Reservations are accounted for in the
766 771 parent datasets' space used, and count against the parent datasets'
767 772 quotas and reservations.
768 773
774 + See refreservation=auto above for a description of the behavior of
775 + setting reservation to auto. If the pool is at version 9 or later,
776 + refreservation=auto should be used instead.
777 +
769 778 This property can also be referred to by its shortened column name,
770 779 reserv.
771 780
772 781 secondarycache=all|none|metadata
773 782 Controls what is cached in the secondary cache (L2ARC). If this
774 783 property is set to all, then both user data and metadata is cached. If
775 784 this property is set to none, then neither user data nor metadata is
776 785 cached. If this property is set to metadata, then only metadata is
777 786 cached. The default value is all.
778 787
779 788 setuid=on|off
780 789 Controls whether the setuid bit is respected for the file system. The
781 790 default value is on.
782 791
783 792 sharesmb=on|off|opts
784 793 Controls whether the file system is shared via SMB, and what options
785 794 are to be used. A file system with the sharesmb property set to off is
786 795 managed through traditional tools such as sharemgr(1M). Otherwise, the
787 796 file system is automatically shared and unshared with the zfs share and
788 797 zfs unshare commands. If the property is set to on, the sharemgr(1M)
789 798 command is invoked with no options. Otherwise, the sharemgr(1M)
790 799 command is invoked with options equivalent to the contents of this
791 800 property.
792 801
793 802 Because SMB shares requires a resource name, a unique resource name is
794 803 constructed from the dataset name. The constructed name is a copy of
795 804 the dataset name except that the characters in the dataset name, which
796 805 would be invalid in the resource name, are replaced with underscore (_)
797 806 characters. A pseudo property "name" is also supported that allows you
798 807 to replace the data set name with a specified name. The specified name
799 808 is then used to replace the prefix dataset in the case of inheritance.
800 809 For example, if the dataset data/home/john is set to name=john, then
801 810 data/home/john has a resource name of john. If a child dataset
802 811 data/home/john/backups is shared, it has a resource name of
803 812 john_backups.
804 813
805 814 When SMB shares are created, the SMB share name appears as an entry in
806 815 the .zfs/shares directory. You can use the ls or chmod command to
807 816 display the share-level ACLs on the entries in this directory.
808 817
809 818 When the sharesmb property is changed for a dataset, the dataset and
810 819 any children inheriting the property are re-shared with the new
811 820 options, only if the property was previously set to off, or if they
812 821 were shared before the property was changed. If the new property is
813 822 set to off, the file systems are unshared.
814 823
815 824 sharenfs=on|off|opts
816 825 Controls whether the file system is shared via NFS, and what options
817 826 are to be used. A file system with a sharenfs property of off is
818 827 managed through traditional tools such as share(1M), unshare(1M), and
819 828 dfstab(4). Otherwise, the file system is automatically shared and
820 829 unshared with the zfs share and zfs unshare commands. If the property
821 830 is set to on, share(1M) command is invoked with no options. Otherwise,
822 831 the share(1M) command is invoked with options equivalent to the
823 832 contents of this property.
824 833
825 834 When the sharenfs property is changed for a dataset, the dataset and
826 835 any children inheriting the property are re-shared with the new
827 836 options, only if the property was previously off, or if they were
828 837 shared before the property was changed. If the new property is off,
829 838 the file systems are unshared.
830 839
831 840 logbias=latency|throughput
832 841 Provide a hint to ZFS about handling of synchronous requests in this
833 842 dataset. If logbias is set to latency (the default), ZFS will use pool
834 843 log devices (if configured) to handle the requests at low latency. If
835 844 logbias is set to throughput, ZFS will not use configured pool log
836 845 devices. ZFS will instead optimize synchronous operations for global
837 846 pool throughput and efficient use of resources.
838 847
839 848 snapdir=hidden|visible
840 849 Controls whether the .zfs directory is hidden or visible in the root of
841 850 the file system as discussed in the Snapshots section. The default
842 851 value is hidden.
843 852
844 853 sync=standard|always|disabled
845 854 Controls the behavior of synchronous requests (e.g. fsync, O_DSYNC).
846 855 standard is the POSIX specified behavior of ensuring all synchronous
847 856 requests are written to stable storage and all devices are flushed to
848 857 ensure data is not cached by device controllers (this is the default).
849 858 always causes every file system transaction to be written and flushed
850 859 before its system call returns. This has a large performance penalty.
851 860 disabled disables synchronous requests. File system transactions are
852 861 only committed to stable storage periodically. This option will give
853 862 the highest performance. However, it is very dangerous as ZFS would be
854 863 ignoring the synchronous transaction demands of applications such as
855 864 databases or NFS. Administrators should only use this option when the
856 865 risks are understood.
857 866
858 867 version=N|current
859 868 The on-disk version of this file system, which is independent of the
860 869 pool version. This property can only be set to later supported
861 870 versions. See the zfs upgrade command.
862 871
863 872 volsize=size
864 873 For volumes, specifies the logical size of the volume. By default,
865 874 creating a volume establishes a reservation of equal size. For storage
866 875 pools with a version number of 9 or higher, a refreservation is set
867 876 instead. Any changes to volsize are reflected in an equivalent change
868 877 to the reservation (or refreservation). The volsize can only be set to
869 878 a multiple of volblocksize, and cannot be zero.
870 879
871 880 The reservation is kept equal to the volume's logical size to prevent
872 881 unexpected behavior for consumers. Without the reservation, the volume
↓ open down ↓ |
94 lines elided |
↑ open up ↑ |
873 882 could run out of space, resulting in undefined behavior or data
874 883 corruption, depending on how the volume is used. These effects can
875 884 also occur when the volume size is changed while it is in use
876 885 (particularly when shrinking the size). Extreme care should be used
877 886 when adjusting the volume size.
878 887
879 888 Though not recommended, a "sparse volume" (also known as "thin
880 889 provisioning") can be created by specifying the -s option to the zfs
881 890 create -V command, or by changing the reservation after the volume has
882 891 been created. A "sparse volume" is a volume where the reservation is
883 - less then the volume size. Consequently, writes to a sparse volume can
884 - fail with ENOSPC when the pool is low on space. For a sparse volume,
885 - changes to volsize are not reflected in the reservation.
892 + less than the size of the volume plus the space required to store its
893 + metadata. Consequently, writes to a sparse volume can fail with ENOSPC
894 + when the pool is low on space. For a sparse volume, changes to volsize
895 + are not reflected in the reservation. A sparse volume can be made
896 + dense (or "not sparse") by setting the reservation to auto.
886 897
887 898 vscan=on|off
888 899 Controls whether regular files should be scanned for viruses when a
889 900 file is opened and closed. In addition to enabling this property, the
890 901 virus scan service must also be enabled for virus scanning to occur.
891 902 The default value is off.
892 903
893 904 xattr=on|off
894 905 Controls whether extended attributes are enabled for this file system.
895 906 The default value is on.
896 907
897 908 zoned=on|off
898 909 Controls whether the dataset is managed from a non-global zone. See
899 910 the Zones section for more information. The default value is off.
900 911
901 912 The following three properties cannot be changed after the file system is
902 913 created, and therefore, should be set when the file system is created.
903 914 If the properties are not set with the zfs create or zpool create
904 915 commands, these properties are inherited from the parent dataset. If the
905 916 parent dataset lacks these properties due to having been created prior to
906 917 these features being supported, the new file system will have the default
907 918 values for these properties.
908 919
909 920 casesensitivity=sensitive|insensitive|mixed
910 921 Indicates whether the file name matching algorithm used by the file
911 922 system should be case-sensitive, case-insensitive, or allow a
912 923 combination of both styles of matching. The default value for the
913 924 casesensitivity property is sensitive. Traditionally, UNIX and POSIX
914 925 file systems have case-sensitive file names.
915 926
916 927 The mixed value for the casesensitivity property indicates that the
917 928 file system can support requests for both case-sensitive and case-
918 929 insensitive matching behavior. Currently, case-insensitive matching
919 930 behavior on a file system that supports mixed behavior is limited to
920 931 the SMB server product. For more information about the mixed value
921 932 behavior, see the "ZFS Administration Guide".
922 933
923 934 normalization=none|formC|formD|formKC|formKD
924 935 Indicates whether the file system should perform a unicode
925 936 normalization of file names whenever two file names are compared, and
926 937 which normalization algorithm should be used. File names are always
927 938 stored unmodified, names are normalized as part of any comparison
928 939 process. If this property is set to a legal value other than none, and
929 940 the utf8only property was left unspecified, the utf8only property is
930 941 automatically set to on. The default value of the normalization
931 942 property is none. This property cannot be changed after the file
932 943 system is created.
933 944
934 945 utf8only=on|off
935 946 Indicates whether the file system should reject file names that include
936 947 characters that are not present in the UTF-8 character code set. If
937 948 this property is explicitly set to off, the normalization property must
938 949 either not be explicitly set or be set to none. The default value for
939 950 the utf8only property is off. This property cannot be changed after
940 951 the file system is created.
941 952
942 953 The casesensitivity, normalization, and utf8only properties are also new
943 954 permissions that can be assigned to non-privileged users by using the ZFS
944 955 delegated administration feature.
945 956
946 957 Temporary Mount Point Properties
947 958 When a file system is mounted, either through mount(1M) for legacy mounts
948 959 or the zfs mount command for normal file systems, its mount options are
949 960 set according to its properties. The correlation between properties and
950 961 mount options is as follows:
951 962
952 963 PROPERTY MOUNT OPTION
953 964 devices devices/nodevices
954 965 exec exec/noexec
955 966 readonly ro/rw
956 967 setuid setuid/nosetuid
957 968 xattr xattr/noxattr
958 969
959 970 In addition, these options can be set on a per-mount basis using the -o
960 971 option, without affecting the property that is stored on disk. The
961 972 values specified on the command line override the values stored in the
962 973 dataset. The nosuid option is an alias for nodevices,nosetuid. These
963 974 properties are reported as "temporary" by the zfs get command. If the
964 975 properties are changed while the dataset is mounted, the new setting
965 976 overrides any temporary settings.
966 977
967 978 User Properties
968 979 In addition to the standard native properties, ZFS supports arbitrary
969 980 user properties. User properties have no effect on ZFS behavior, but
970 981 applications or administrators can use them to annotate datasets (file
971 982 systems, volumes, and snapshots).
972 983
973 984 User property names must contain a colon (":") character to distinguish
974 985 them from native properties. They may contain lowercase letters,
975 986 numbers, and the following punctuation characters: colon (":"), dash
976 987 ("-"), period ("."), and underscore ("_"). The expected convention is
977 988 that the property name is divided into two portions such as
978 989 module:property, but this namespace is not enforced by ZFS. User
979 990 property names can be at most 256 characters, and cannot begin with a
980 991 dash ("-").
981 992
982 993 When making programmatic use of user properties, it is strongly suggested
983 994 to use a reversed DNS domain name for the module component of property
984 995 names to reduce the chance that two independently-developed packages use
985 996 the same property name for different purposes.
986 997
987 998 The values of user properties are arbitrary strings, are always
988 999 inherited, and are never validated. All of the commands that operate on
989 1000 properties (zfs list, zfs get, zfs set, and so forth) can be used to
990 1001 manipulate both native properties and user properties. Use the zfs
991 1002 inherit command to clear a user property. If the property is not defined
992 1003 in any parent dataset, it is removed entirely. Property values are
993 1004 limited to 8192 bytes.
994 1005
995 1006 ZFS Volumes as Swap or Dump Devices
996 1007 During an initial installation a swap device and dump device are created
997 1008 on ZFS volumes in the ZFS root pool. By default, the swap area size is
998 1009 based on 1/2 the size of physical memory up to 2 Gbytes. The size of the
999 1010 dump device depends on the kernel's requirements at installation time.
1000 1011 Separate ZFS volumes must be used for the swap area and dump devices. Do
1001 1012 not swap to a file on a ZFS file system. A ZFS swap file configuration
1002 1013 is not supported.
1003 1014
1004 1015 If you need to change your swap area or dump device after the system is
1005 1016 installed or upgraded, use the swap(1M) and dumpadm(1M) commands.
1006 1017
1007 1018 SUBCOMMANDS
1008 1019 All subcommands that modify state are logged persistently to the pool in
1009 1020 their original form.
1010 1021
1011 1022 zfs -?
1012 1023 Displays a help message.
1013 1024
1014 1025 zfs create [-p] [-o property=value]... filesystem
1015 1026 Creates a new ZFS file system. The file system is automatically
1016 1027 mounted according to the mountpoint property inherited from the parent.
1017 1028
1018 1029 -o property=value
1019 1030 Sets the specified property as if the command zfs set
1020 1031 property=value was invoked at the same time the dataset was
1021 1032 created. Any editable ZFS property can also be set at creation
1022 1033 time. Multiple -o options can be specified. An error results if
1023 1034 the same property is specified in multiple -o options.
1024 1035
1025 1036 -p Creates all the non-existing parent datasets. Datasets created in
1026 1037 this manner are automatically mounted according to the mountpoint
1027 1038 property inherited from their parent. Any property specified on
1028 1039 the command line using the -o option is ignored. If the target
1029 1040 filesystem already exists, the operation completes successfully.
1030 1041
1031 1042 zfs create [-ps] [-b blocksize] [-o property=value]... -V size volume
1032 1043 Creates a volume of the given size. The volume is exported as a block
1033 1044 device in /dev/zvol/{dsk,rdsk}/path, where path is the name of the
1034 1045 volume in the ZFS namespace. The size represents the logical size as
1035 1046 exported by the device. By default, a reservation of equal size is
1036 1047 created.
1037 1048
1038 1049 size is automatically rounded up to the nearest 128 Kbytes to ensure
1039 1050 that the volume has an integral number of blocks regardless of
1040 1051 blocksize.
1041 1052
1042 1053 -b blocksize
1043 1054 Equivalent to -o volblocksize=blocksize. If this option is
1044 1055 specified in conjunction with -o volblocksize, the resulting
1045 1056 behavior is undefined.
1046 1057
1047 1058 -o property=value
1048 1059 Sets the specified property as if the zfs set property=value
1049 1060 command was invoked at the same time the dataset was created. Any
1050 1061 editable ZFS property can also be set at creation time. Multiple
1051 1062 -o options can be specified. An error results if the same property
1052 1063 is specified in multiple -o options.
1053 1064
1054 1065 -p Creates all the non-existing parent datasets. Datasets created in
1055 1066 this manner are automatically mounted according to the mountpoint
1056 1067 property inherited from their parent. Any property specified on
1057 1068 the command line using the -o option is ignored. If the target
1058 1069 filesystem already exists, the operation completes successfully.
1059 1070
1060 1071 -s Creates a sparse volume with no reservation. See volsize in the
1061 1072 Native Properties section for more information about sparse
1062 1073 volumes.
1063 1074
1064 1075 zfs destroy [-Rfnprv] filesystem|volume
1065 1076 Destroys the given dataset. By default, the command unshares any file
1066 1077 systems that are currently shared, unmounts any file systems that are
1067 1078 currently mounted, and refuses to destroy a dataset that has active
1068 1079 dependents (children or clones).
1069 1080
1070 1081 -R Recursively destroy all dependents, including cloned file systems
1071 1082 outside the target hierarchy.
1072 1083
1073 1084 -f Force an unmount of any file systems using the unmount -f command.
1074 1085 This option has no effect on non-file systems or unmounted file
1075 1086 systems.
1076 1087
1077 1088 -n Do a dry-run ("No-op") deletion. No data will be deleted. This is
1078 1089 useful in conjunction with the -v or -p flags to determine what
1079 1090 data would be deleted.
1080 1091
1081 1092 -p Print machine-parsable verbose information about the deleted data.
1082 1093
1083 1094 -r Recursively destroy all children.
1084 1095
1085 1096 -v Print verbose information about the deleted data.
1086 1097
1087 1098 Extreme care should be taken when applying either the -r or the -R
1088 1099 options, as they can destroy large portions of a pool and cause
1089 1100 unexpected behavior for mounted file systems in use.
1090 1101
1091 1102 zfs destroy [-Rdnprv] filesystem|volume@snap[%snap[,snap[%snap]]]...
1092 1103 The given snapshots are destroyed immediately if and only if the zfs
1093 1104 destroy command without the -d option would have destroyed it. Such
1094 1105 immediate destruction would occur, for example, if the snapshot had no
1095 1106 clones and the user-initiated reference count were zero.
1096 1107
1097 1108 If a snapshot does not qualify for immediate destruction, it is marked
1098 1109 for deferred deletion. In this state, it exists as a usable, visible
1099 1110 snapshot until both of the preconditions listed above are met, at which
1100 1111 point it is destroyed.
1101 1112
1102 1113 An inclusive range of snapshots may be specified by separating the
1103 1114 first and last snapshots with a percent sign. The first and/or last
1104 1115 snapshots may be left blank, in which case the filesystem's oldest or
1105 1116 newest snapshot will be implied.
1106 1117
1107 1118 Multiple snapshots (or ranges of snapshots) of the same filesystem or
1108 1119 volume may be specified in a comma-separated list of snapshots. Only
1109 1120 the snapshot's short name (the part after the @) should be specified
1110 1121 when using a range or comma-separated list to identify multiple
1111 1122 snapshots.
1112 1123
1113 1124 -R Recursively destroy all clones of these snapshots, including the
1114 1125 clones, snapshots, and children. If this flag is specified, the -d
1115 1126 flag will have no effect.
1116 1127
1117 1128 -d Defer snapshot deletion.
1118 1129
1119 1130 -n Do a dry-run ("No-op") deletion. No data will be deleted. This is
1120 1131 useful in conjunction with the -p or -v flags to determine what
1121 1132 data would be deleted.
1122 1133
1123 1134 -p Print machine-parsable verbose information about the deleted data.
1124 1135
1125 1136 -r Destroy (or mark for deferred deletion) all snapshots with this
1126 1137 name in descendent file systems.
1127 1138
1128 1139 -v Print verbose information about the deleted data.
1129 1140
1130 1141 Extreme care should be taken when applying either the -r or the -R
1131 1142 options, as they can destroy large portions of a pool and cause
1132 1143 unexpected behavior for mounted file systems in use.
1133 1144
1134 1145 zfs destroy filesystem|volume#bookmark
1135 1146 The given bookmark is destroyed.
1136 1147
1137 1148 zfs snapshot [-r] [-o property=value]...
1138 1149 filesystem@snapname|volume@snapname...
1139 1150 Creates snapshots with the given names. All previous modifications by
1140 1151 successful system calls to the file system are part of the snapshots.
1141 1152 Snapshots are taken atomically, so that all snapshots correspond to the
1142 1153 same moment in time. See the Snapshots section for details.
1143 1154
1144 1155 -o property=value
1145 1156 Sets the specified property; see zfs create for details.
1146 1157
1147 1158 -r Recursively create snapshots of all descendent datasets
1148 1159
1149 1160 zfs rollback [-Rfr] snapshot
1150 1161 Roll back the given dataset to a previous snapshot. When a dataset is
1151 1162 rolled back, all data that has changed since the snapshot is discarded,
1152 1163 and the dataset reverts to the state at the time of the snapshot. By
1153 1164 default, the command refuses to roll back to a snapshot other than the
1154 1165 most recent one. In order to do so, all intermediate snapshots and
1155 1166 bookmarks must be destroyed by specifying the -r option.
1156 1167
1157 1168 The -rR options do not recursively destroy the child snapshots of a
1158 1169 recursive snapshot. Only direct snapshots of the specified filesystem
1159 1170 are destroyed by either of these options. To completely roll back a
1160 1171 recursive snapshot, you must rollback the individual child snapshots.
1161 1172
1162 1173 -R Destroy any more recent snapshots and bookmarks, as well as any
1163 1174 clones of those snapshots.
1164 1175
1165 1176 -f Used with the -R option to force an unmount of any clone file
1166 1177 systems that are to be destroyed.
1167 1178
1168 1179 -r Destroy any snapshots and bookmarks more recent than the one
1169 1180 specified.
1170 1181
1171 1182 zfs clone [-p] [-o property=value]... snapshot filesystem|volume
1172 1183 Creates a clone of the given snapshot. See the Clones section for
1173 1184 details. The target dataset can be located anywhere in the ZFS
1174 1185 hierarchy, and is created as the same type as the original.
1175 1186
1176 1187 -o property=value
1177 1188 Sets the specified property; see zfs create for details.
1178 1189
1179 1190 -p Creates all the non-existing parent datasets. Datasets created in
1180 1191 this manner are automatically mounted according to the mountpoint
1181 1192 property inherited from their parent. If the target filesystem or
1182 1193 volume already exists, the operation completes successfully.
1183 1194
1184 1195 zfs promote clone-filesystem
1185 1196 Promotes a clone file system to no longer be dependent on its "origin"
1186 1197 snapshot. This makes it possible to destroy the file system that the
1187 1198 clone was created from. The clone parent-child dependency relationship
1188 1199 is reversed, so that the origin file system becomes a clone of the
1189 1200 specified file system.
1190 1201
1191 1202 The snapshot that was cloned, and any snapshots previous to this
1192 1203 snapshot, are now owned by the promoted clone. The space they use
1193 1204 moves from the origin file system to the promoted clone, so enough
1194 1205 space must be available to accommodate these snapshots. No new space
1195 1206 is consumed by this operation, but the space accounting is adjusted.
1196 1207 The promoted clone must not have any conflicting snapshot names of its
1197 1208 own. The rename subcommand can be used to rename any conflicting
1198 1209 snapshots.
1199 1210
1200 1211 zfs rename [-f] filesystem|volume|snapshot filesystem|volume|snapshot
1201 1212
1202 1213 zfs rename [-fp] filesystem|volume filesystem|volume
1203 1214 Renames the given dataset. The new target can be located anywhere in
1204 1215 the ZFS hierarchy, with the exception of snapshots. Snapshots can only
1205 1216 be renamed within the parent file system or volume. When renaming a
1206 1217 snapshot, the parent file system of the snapshot does not need to be
1207 1218 specified as part of the second argument. Renamed file systems can
1208 1219 inherit new mount points, in which case they are unmounted and
1209 1220 remounted at the new mount point.
1210 1221
1211 1222 -f Force unmount any filesystems that need to be unmounted in the
1212 1223 process.
1213 1224
1214 1225 -p Creates all the nonexistent parent datasets. Datasets created in
1215 1226 this manner are automatically mounted according to the mountpoint
1216 1227 property inherited from their parent.
1217 1228
1218 1229 zfs rename -r snapshot snapshot
1219 1230 Recursively rename the snapshots of all descendent datasets. Snapshots
1220 1231 are the only dataset that can be renamed recursively.
1221 1232
1222 1233 zfs list [-r|-d depth] [-Hp] [-o property[,property]...] [-s property]...
1223 1234 [-S property]... [-t type[,type]...] [filesystem|volume|snapshot]...
1224 1235 Lists the property information for the given datasets in tabular form.
1225 1236 If specified, you can list property information by the absolute
1226 1237 pathname or the relative pathname. By default, all file systems and
1227 1238 volumes are displayed. Snapshots are displayed if the listsnaps
1228 1239 property is on (the default is off). The following fields are
1229 1240 displayed, name,used,available,referenced,mountpoint.
1230 1241
1231 1242 -H Used for scripting mode. Do not print headers and separate fields
1232 1243 by a single tab instead of arbitrary white space.
1233 1244
1234 1245 -S property
1235 1246 Same as the -s option, but sorts by property in descending order.
1236 1247
1237 1248 -d depth
1238 1249 Recursively display any children of the dataset, limiting the
1239 1250 recursion to depth. A depth of 1 will display only the dataset and
1240 1251 its direct children.
1241 1252
1242 1253 -o property
1243 1254 A comma-separated list of properties to display. The property must
1244 1255 be:
1245 1256
1246 1257 o One of the properties described in the Native Properties
1247 1258 section
1248 1259
1249 1260 o A user property
1250 1261
1251 1262 o The value name to display the dataset name
1252 1263
1253 1264 o The value space to display space usage properties on file
1254 1265 systems and volumes. This is a shortcut for specifying -o
1255 1266 name,avail,used,usedsnap,usedds,usedrefreserv,usedchild -t
1256 1267 filesystem,volume syntax.
1257 1268
1258 1269 -p Display numbers in parsable (exact) values.
1259 1270
1260 1271 -r Recursively display any children of the dataset on the command
1261 1272 line.
1262 1273
1263 1274 -s property
1264 1275 A property for sorting the output by column in ascending order
1265 1276 based on the value of the property. The property must be one of
1266 1277 the properties described in the Properties section, or the special
1267 1278 value name to sort by the dataset name. Multiple properties can be
1268 1279 specified at one time using multiple -s property options. Multiple
1269 1280 -s options are evaluated from left to right in decreasing order of
1270 1281 importance. The following is a list of sorting criteria:
1271 1282
1272 1283 o Numeric types sort in numeric order.
1273 1284
1274 1285 o String types sort in alphabetical order.
1275 1286
1276 1287 o Types inappropriate for a row sort that row to the literal
1277 1288 bottom, regardless of the specified ordering.
1278 1289
1279 1290 If no sorting options are specified the existing behavior of zfs
1280 1291 list is preserved.
1281 1292
1282 1293 -t type
1283 1294 A comma-separated list of types to display, where type is one of
1284 1295 filesystem, snapshot, volume, bookmark, or all. For example,
1285 1296 specifying -t snapshot displays only snapshots.
1286 1297
1287 1298 zfs set property=value [property=value]... filesystem|volume|snapshot...
1288 1299 Sets the property or list of properties to the given value(s) for each
1289 1300 dataset. Only some properties can be edited. See the Properties
1290 1301 section for more information on what properties can be set and
1291 1302 acceptable values. Numeric values can be specified as exact values, or
1292 1303 in a human-readable form with a suffix of B, K, M, G, T, P, E, Z (for
1293 1304 bytes, kilobytes, megabytes, gigabytes, terabytes, petabytes, exabytes,
1294 1305 or zettabytes, respectively). User properties can be set on snapshots.
1295 1306 For more information, see the User Properties section.
1296 1307
1297 1308 zfs get [-r|-d depth] [-Hp] [-o field[,field]...] [-s source[,source]...]
1298 1309 [-t type[,type]...] all | property[,property]...
1299 1310 filesystem|volume|snapshot|bookmark...
1300 1311 Displays properties for the given datasets. If no datasets are
1301 1312 specified, then the command displays properties for all datasets on the
1302 1313 system. For each property, the following columns are displayed:
1303 1314
1304 1315 name Dataset name
1305 1316 property Property name
1306 1317 value Property value
1307 1318 source Property source. Can either be local, default,
1308 1319 temporary, inherited, or none (-).
1309 1320
1310 1321 All columns are displayed by default, though this can be controlled by
1311 1322 using the -o option. This command takes a comma-separated list of
1312 1323 properties as described in the Native Properties and User Properties
1313 1324 sections.
1314 1325
1315 1326 The special value all can be used to display all properties that apply
1316 1327 to the given dataset's type (filesystem, volume, snapshot, or
1317 1328 bookmark).
1318 1329
1319 1330 -H Display output in a form more easily parsed by scripts. Any
1320 1331 headers are omitted, and fields are explicitly separated by a
1321 1332 single tab instead of an arbitrary amount of space.
1322 1333
1323 1334 -d depth
1324 1335 Recursively display any children of the dataset, limiting the
1325 1336 recursion to depth. A depth of 1 will display only the dataset and
1326 1337 its direct children.
1327 1338
1328 1339 -o field
1329 1340 A comma-separated list of columns to display.
1330 1341 name,property,value,source is the default value.
1331 1342
1332 1343 -p Display numbers in parsable (exact) values.
1333 1344
1334 1345 -r Recursively display properties for any children.
1335 1346
1336 1347 -s source
1337 1348 A comma-separated list of sources to display. Those properties
1338 1349 coming from a source other than those in this list are ignored.
1339 1350 Each source must be one of the following: local, default,
1340 1351 inherited, temporary, and none. The default value is all sources.
1341 1352
1342 1353 -t type
1343 1354 A comma-separated list of types to display, where type is one of
1344 1355 filesystem, snapshot, volume, bookmark, or all.
1345 1356
1346 1357 zfs inherit [-rS] property filesystem|volume|snapshot...
1347 1358 Clears the specified property, causing it to be inherited from an
1348 1359 ancestor, restored to default if no ancestor has the property set, or
1349 1360 with the -S option reverted to the received value if one exists. See
1350 1361 the Properties section for a listing of default values, and details on
1351 1362 which properties can be inherited.
1352 1363
1353 1364 -r Recursively inherit the given property for all children.
1354 1365
1355 1366 -S Revert the property to the received value if one exists; otherwise
1356 1367 operate as if the -S option was not specified.
1357 1368
1358 1369 zfs remap filesystem|volume
1359 1370 Remap the indirect blocks in the given fileystem or volume so that they
1360 1371 no longer reference blocks on previously removed vdevs and we can
1361 1372 eventually shrink the size of the indirect mapping objects for the
1362 1373 previously removed vdevs. Note that remapping all blocks might not be
1363 1374 possible and that references from snapshots will still exist and cannot
1364 1375 be remapped.
1365 1376
1366 1377 zfs upgrade
1367 1378 Displays a list of file systems that are not the most recent version.
1368 1379
1369 1380 zfs upgrade -v
1370 1381 Displays a list of currently supported file system versions.
1371 1382
1372 1383 zfs upgrade [-r] [-V version] -a | filesystem
1373 1384 Upgrades file systems to a new on-disk version. Once this is done, the
1374 1385 file systems will no longer be accessible on systems running older
1375 1386 versions of the software. zfs send streams generated from new
1376 1387 snapshots of these file systems cannot be accessed on systems running
1377 1388 older versions of the software.
1378 1389
1379 1390 In general, the file system version is independent of the pool version.
1380 1391 See zpool(1M) for information on the zpool upgrade command.
1381 1392
1382 1393 In some cases, the file system version and the pool version are
1383 1394 interrelated and the pool version must be upgraded before the file
1384 1395 system version can be upgraded.
1385 1396
1386 1397 -V version
1387 1398 Upgrade to the specified version. If the -V flag is not specified,
1388 1399 this command upgrades to the most recent version. This option can
1389 1400 only be used to increase the version number, and only up to the
1390 1401 most recent version supported by this software.
1391 1402
1392 1403 -a Upgrade all file systems on all imported pools.
1393 1404
1394 1405 filesystem
1395 1406 Upgrade the specified file system.
1396 1407
1397 1408 -r Upgrade the specified file system and all descendent file systems.
1398 1409
1399 1410 zfs userspace [-Hinp] [-o field[,field]...] [-s field]... [-S field]...
1400 1411 [-t type[,type]...] filesystem|snapshot
1401 1412 Displays space consumed by, and quotas on, each user in the specified
1402 1413 filesystem or snapshot. This corresponds to the userused@user and
1403 1414 userquota@user properties.
1404 1415
1405 1416 -H Do not print headers, use tab-delimited output.
1406 1417
1407 1418 -S field
1408 1419 Sort by this field in reverse order. See -s.
1409 1420
1410 1421 -i Translate SID to POSIX ID. The POSIX ID may be ephemeral if no
1411 1422 mapping exists. Normal POSIX interfaces (for example, stat(2), ls
1412 1423 -l) perform this translation, so the -i option allows the output
1413 1424 from zfs userspace to be compared directly with those utilities.
1414 1425 However, -i may lead to confusion if some files were created by an
1415 1426 SMB user before a SMB-to-POSIX name mapping was established. In
1416 1427 such a case, some files will be owned by the SMB entity and some by
1417 1428 the POSIX entity. However, the -i option will report that the
1418 1429 POSIX entity has the total usage and quota for both.
1419 1430
1420 1431 -n Print numeric ID instead of user/group name.
1421 1432
1422 1433 -o field[,field]...
1423 1434 Display only the specified fields from the following set: type,
1424 1435 name, used, quota. The default is to display all fields.
1425 1436
1426 1437 -p Use exact (parsable) numeric output.
1427 1438
1428 1439 -s field
1429 1440 Sort output by this field. The -s and -S flags may be specified
1430 1441 multiple times to sort first by one field, then by another. The
1431 1442 default is -s type -s name.
1432 1443
1433 1444 -t type[,type]...
1434 1445 Print only the specified types from the following set: all,
1435 1446 posixuser, smbuser, posixgroup, smbgroup. The default is -t
1436 1447 posixuser,smbuser. The default can be changed to include group
1437 1448 types.
1438 1449
1439 1450 zfs groupspace [-Hinp] [-o field[,field]...] [-s field]... [-S field]...
1440 1451 [-t type[,type]...] filesystem|snapshot
1441 1452 Displays space consumed by, and quotas on, each group in the specified
1442 1453 filesystem or snapshot. This subcommand is identical to zfs userspace,
1443 1454 except that the default types to display are -t posixgroup,smbgroup.
1444 1455
1445 1456 zfs mount
1446 1457 Displays all ZFS file systems currently mounted.
1447 1458
1448 1459 zfs mount [-Ov] [-o options] -a | filesystem
1449 1460 Mounts ZFS file systems.
1450 1461
1451 1462 -O Perform an overlay mount. See mount(1M) for more information.
1452 1463
1453 1464 -a Mount all available ZFS file systems. Invoked automatically as
1454 1465 part of the boot process.
1455 1466
1456 1467 filesystem
1457 1468 Mount the specified filesystem.
1458 1469
1459 1470 -o options
1460 1471 An optional, comma-separated list of mount options to use
1461 1472 temporarily for the duration of the mount. See the Temporary Mount
1462 1473 Point Properties section for details.
1463 1474
1464 1475 -v Report mount progress.
1465 1476
1466 1477 zfs unmount [-f] -a | filesystem|mountpoint
1467 1478 Unmounts currently mounted ZFS file systems.
1468 1479
1469 1480 -a Unmount all available ZFS file systems. Invoked automatically as
1470 1481 part of the shutdown process.
1471 1482
1472 1483 filesystem|mountpoint
1473 1484 Unmount the specified filesystem. The command can also be given a
1474 1485 path to a ZFS file system mount point on the system.
1475 1486
1476 1487 -f Forcefully unmount the file system, even if it is currently in use.
1477 1488
1478 1489 zfs share -a | filesystem
1479 1490 Shares available ZFS file systems.
1480 1491
1481 1492 -a Share all available ZFS file systems. Invoked automatically as
1482 1493 part of the boot process.
1483 1494
1484 1495 filesystem
1485 1496 Share the specified filesystem according to the sharenfs and
1486 1497 sharesmb properties. File systems are shared when the sharenfs or
1487 1498 sharesmb property is set.
1488 1499
1489 1500 zfs unshare -a | filesystem|mountpoint
1490 1501 Unshares currently shared ZFS file systems.
1491 1502
1492 1503 -a Unshare all available ZFS file systems. Invoked automatically as
1493 1504 part of the shutdown process.
1494 1505
1495 1506 filesystem|mountpoint
1496 1507 Unshare the specified filesystem. The command can also be given a
1497 1508 path to a ZFS file system shared on the system.
1498 1509
1499 1510 zfs bookmark snapshot bookmark
1500 1511 Creates a bookmark of the given snapshot. Bookmarks mark the point in
1501 1512 time when the snapshot was created, and can be used as the incremental
1502 1513 source for a zfs send command.
1503 1514
1504 1515 This feature must be enabled to be used. See zpool-features(5) for
1505 1516 details on ZFS feature flags and the bookmarks feature.
1506 1517
1507 1518 zfs send [-DLPRcenpv] [[-I|-i] snapshot] snapshot
1508 1519 Creates a stream representation of the second snapshot, which is
1509 1520 written to standard output. The output can be redirected to a file or
1510 1521 to a different system (for example, using ssh(1)). By default, a full
1511 1522 stream is generated.
1512 1523
1513 1524 -D, --dedup
1514 1525 Generate a deduplicated stream. Blocks which would have been sent
1515 1526 multiple times in the send stream will only be sent once. The
1516 1527 receiving system must also support this feature to receive a
1517 1528 deduplicated stream. This flag can be used regardless of the
1518 1529 dataset's dedup property, but performance will be much better if
1519 1530 the filesystem uses a dedup-capable checksum (for example, sha256).
1520 1531
1521 1532 -I snapshot
1522 1533 Generate a stream package that sends all intermediary snapshots
1523 1534 from the first snapshot to the second snapshot. For example, -I @a
1524 1535 fs@d is similar to -i @a fs@b; -i @b fs@c; -i @c fs@d. The
1525 1536 incremental source may be specified as with the -i option.
1526 1537
1527 1538 -L, --large-block
1528 1539 Generate a stream which may contain blocks larger than 128KB. This
1529 1540 flag has no effect if the large_blocks pool feature is disabled, or
1530 1541 if the recordsize property of this filesystem has never been set
1531 1542 above 128KB. The receiving system must have the large_blocks pool
1532 1543 feature enabled as well. See zpool-features(5) for details on ZFS
1533 1544 feature flags and the large_blocks feature.
1534 1545
1535 1546 -P, --parsable
1536 1547 Print machine-parsable verbose information about the stream package
1537 1548 generated.
1538 1549
1539 1550 -R, --replicate
1540 1551 Generate a replication stream package, which will replicate the
1541 1552 specified file system, and all descendent file systems, up to the
1542 1553 named snapshot. When received, all properties, snapshots,
1543 1554 descendent file systems, and clones are preserved.
1544 1555
1545 1556 If the -i or -I flags are used in conjunction with the -R flag, an
1546 1557 incremental replication stream is generated. The current values of
1547 1558 properties, and current snapshot and file system names are set when
1548 1559 the stream is received. If the -F flag is specified when this
1549 1560 stream is received, snapshots and file systems that do not exist on
1550 1561 the sending side are destroyed.
1551 1562
1552 1563 -e, --embed
1553 1564 Generate a more compact stream by using WRITE_EMBEDDED records for
1554 1565 blocks which are stored more compactly on disk by the embedded_data
1555 1566 pool feature. This flag has no effect if the embedded_data feature
1556 1567 is disabled. The receiving system must have the embedded_data
1557 1568 feature enabled. If the lz4_compress feature is active on the
1558 1569 sending system, then the receiving system must have that feature
1559 1570 enabled as well. See zpool-features(5) for details on ZFS feature
1560 1571 flags and the embedded_data feature.
1561 1572
1562 1573 -c, --compressed
1563 1574 Generate a more compact stream by using compressed WRITE records
1564 1575 for blocks which are compressed on disk and in memory (see the
1565 1576 compression property for details). If the lz4_compress feature is
1566 1577 active on the sending system, then the receiving system must have
1567 1578 that feature enabled as well. If the large_blocks feature is
1568 1579 enabled on the sending system but the -L option is not supplied in
1569 1580 conjunction with -c, then the data will be decompressed before
1570 1581 sending so it can be split into smaller block sizes.
1571 1582
1572 1583 -i snapshot
1573 1584 Generate an incremental stream from the first snapshot (the
1574 1585 incremental source) to the second snapshot (the incremental
1575 1586 target). The incremental source can be specified as the last
1576 1587 component of the snapshot name (the @ character and following) and
1577 1588 it is assumed to be from the same file system as the incremental
1578 1589 target.
1579 1590
1580 1591 If the destination is a clone, the source may be the origin
1581 1592 snapshot, which must be fully specified (for example,
1582 1593 pool/fs@origin, not just @origin).
1583 1594
1584 1595 -n, --dryrun
1585 1596 Do a dry-run ("No-op") send. Do not generate any actual send data.
1586 1597 This is useful in conjunction with the -v or -P flags to determine
1587 1598 what data will be sent. In this case, the verbose output will be
1588 1599 written to standard output (contrast with a non-dry-run, where the
1589 1600 stream is written to standard output and the verbose output goes to
1590 1601 standard error).
1591 1602
1592 1603 -p, --props
1593 1604 Include the dataset's properties in the stream. This flag is
1594 1605 implicit when -R is specified. The receiving system must also
1595 1606 support this feature.
1596 1607
1597 1608 -v, --verbose
1598 1609 Print verbose information about the stream package generated. This
1599 1610 information includes a per-second report of how much data has been
1600 1611 sent.
1601 1612
1602 1613 The format of the stream is committed. You will be able to receive
1603 1614 your streams on future versions of ZFS .
1604 1615
1605 1616 zfs send [-Lce] [-i snapshot|bookmark] filesystem|volume|snapshot
1606 1617 Generate a send stream, which may be of a filesystem, and may be
1607 1618 incremental from a bookmark. If the destination is a filesystem or
1608 1619 volume, the pool must be read-only, or the filesystem must not be
1609 1620 mounted. When the stream generated from a filesystem or volume is
1610 1621 received, the default snapshot name will be "--head--".
1611 1622
1612 1623 -L, --large-block
1613 1624 Generate a stream which may contain blocks larger than 128KB. This
1614 1625 flag has no effect if the large_blocks pool feature is disabled, or
1615 1626 if the recordsize property of this filesystem has never been set
1616 1627 above 128KB. The receiving system must have the large_blocks pool
1617 1628 feature enabled as well. See zpool-features(5) for details on ZFS
1618 1629 feature flags and the large_blocks feature.
1619 1630
1620 1631 -c, --compressed
1621 1632 Generate a more compact stream by using compressed WRITE records
1622 1633 for blocks which are compressed on disk and in memory (see the
1623 1634 compression property for details). If the lz4_compress feature is
1624 1635 active on the sending system, then the receiving system must have
1625 1636 that feature enabled as well. If the large_blocks feature is
1626 1637 enabled on the sending system but the -L option is not supplied in
1627 1638 conjunction with -c, then the data will be decompressed before
1628 1639 sending so it can be split into smaller block sizes.
1629 1640
1630 1641 -e, --embed
1631 1642 Generate a more compact stream by using WRITE_EMBEDDED records for
1632 1643 blocks which are stored more compactly on disk by the embedded_data
1633 1644 pool feature. This flag has no effect if the embedded_data feature
1634 1645 is disabled. The receiving system must have the embedded_data
1635 1646 feature enabled. If the lz4_compress feature is active on the
1636 1647 sending system, then the receiving system must have that feature
1637 1648 enabled as well. See zpool-features(5) for details on ZFS feature
1638 1649 flags and the embedded_data feature.
1639 1650
1640 1651 -i snapshot|bookmark
1641 1652 Generate an incremental send stream. The incremental source must
1642 1653 be an earlier snapshot in the destination's history. It will
1643 1654 commonly be an earlier snapshot in the destination's file system,
1644 1655 in which case it can be specified as the last component of the name
1645 1656 (the # or @ character and following).
1646 1657
1647 1658 If the incremental target is a clone, the incremental source can be
1648 1659 the origin snapshot, or an earlier snapshot in the origin's
1649 1660 filesystem, or the origin's origin, etc.
1650 1661
1651 1662 zfs send [-Penv] -t receive_resume_token
1652 1663 Creates a send stream which resumes an interrupted receive. The
1653 1664 receive_resume_token is the value of this property on the filesystem or
1654 1665 volume that was being received into. See the documentation for zfs
1655 1666 receive -s for more details.
1656 1667
1657 1668 zfs receive [-Fnsuv] [-o origin=snapshot] filesystem|volume|snapshot
1658 1669
1659 1670 zfs receive [-Fnsuv] [-d|-e] [-o origin=snapshot] filesystem
1660 1671 Creates a snapshot whose contents are as specified in the stream
1661 1672 provided on standard input. If a full stream is received, then a new
1662 1673 file system is created as well. Streams are created using the zfs send
1663 1674 subcommand, which by default creates a full stream. zfs recv can be
1664 1675 used as an alias for zfs receive.
1665 1676
1666 1677 If an incremental stream is received, then the destination file system
1667 1678 must already exist, and its most recent snapshot must match the
1668 1679 incremental stream's source. For zvols, the destination device link is
1669 1680 destroyed and recreated, which means the zvol cannot be accessed during
1670 1681 the receive operation.
1671 1682
1672 1683 When a snapshot replication package stream that is generated by using
1673 1684 the zfs send -R command is received, any snapshots that do not exist on
1674 1685 the sending location are destroyed by using the zfs destroy -d command.
1675 1686
1676 1687 The name of the snapshot (and file system, if a full stream is
1677 1688 received) that this subcommand creates depends on the argument type and
1678 1689 the use of the -d or -e options.
1679 1690
1680 1691 If the argument is a snapshot name, the specified snapshot is created.
1681 1692 If the argument is a file system or volume name, a snapshot with the
1682 1693 same name as the sent snapshot is created within the specified
1683 1694 filesystem or volume. If neither of the -d or -e options are
1684 1695 specified, the provided target snapshot name is used exactly as
1685 1696 provided.
1686 1697
1687 1698 The -d and -e options cause the file system name of the target snapshot
1688 1699 to be determined by appending a portion of the sent snapshot's name to
1689 1700 the specified target filesystem. If the -d option is specified, all
1690 1701 but the first element of the sent snapshot's file system path (usually
1691 1702 the pool name) is used and any required intermediate file systems
1692 1703 within the specified one are created. If the -e option is specified,
1693 1704 then only the last element of the sent snapshot's file system name
1694 1705 (i.e. the name of the source file system itself) is used as the target
1695 1706 file system name.
1696 1707
1697 1708 -F Force a rollback of the file system to the most recent snapshot
1698 1709 before performing the receive operation. If receiving an
1699 1710 incremental replication stream (for example, one generated by zfs
1700 1711 send -R [-i|-I]), destroy snapshots and file systems that do not
1701 1712 exist on the sending side.
1702 1713
1703 1714 -d Discard the first element of the sent snapshot's file system name,
1704 1715 using the remaining elements to determine the name of the target
1705 1716 file system for the new snapshot as described in the paragraph
1706 1717 above.
1707 1718
1708 1719 -e Discard all but the last element of the sent snapshot's file system
1709 1720 name, using that element to determine the name of the target file
1710 1721 system for the new snapshot as described in the paragraph above.
1711 1722
1712 1723 -n Do not actually receive the stream. This can be useful in
1713 1724 conjunction with the -v option to verify the name the receive
1714 1725 operation would use.
1715 1726
1716 1727 -o origin=snapshot
1717 1728 Forces the stream to be received as a clone of the given snapshot.
1718 1729 If the stream is a full send stream, this will create the
1719 1730 filesystem described by the stream as a clone of the specified
1720 1731 snapshot. Which snapshot was specified will not affect the success
1721 1732 or failure of the receive, as long as the snapshot does exist. If
1722 1733 the stream is an incremental send stream, all the normal
1723 1734 verification will be performed.
1724 1735
1725 1736 -u File system that is associated with the received stream is not
1726 1737 mounted.
1727 1738
1728 1739 -v Print verbose information about the stream and the time required to
1729 1740 perform the receive operation.
1730 1741
1731 1742 -s If the receive is interrupted, save the partially received state,
1732 1743 rather than deleting it. Interruption may be due to premature
1733 1744 termination of the stream (e.g. due to network failure or failure
1734 1745 of the remote system if the stream is being read over a network
1735 1746 connection), a checksum error in the stream, termination of the zfs
1736 1747 receive process, or unclean shutdown of the system.
1737 1748
1738 1749 The receive can be resumed with a stream generated by zfs send -t
1739 1750 token, where the token is the value of the receive_resume_token
1740 1751 property of the filesystem or volume which is received into.
1741 1752
1742 1753 To use this flag, the storage pool must have the extensible_dataset
1743 1754 feature enabled. See zpool-features(5) for details on ZFS feature
1744 1755 flags.
1745 1756
1746 1757 zfs receive -A filesystem|volume
1747 1758 Abort an interrupted zfs receive -s, deleting its saved partially
1748 1759 received state.
1749 1760
1750 1761 zfs allow filesystem|volume
1751 1762 Displays permissions that have been delegated on the specified
1752 1763 filesystem or volume. See the other forms of zfs allow for more
1753 1764 information.
1754 1765
1755 1766 zfs allow [-dglu] user|group[,user|group]...
1756 1767 perm|@setname[,perm|@setname]... filesystem|volume
1757 1768 zfs
1758 1769 allow
1759 1770 [-dl]
1760 1771 -e|everyone
1761 1772 perm|@setname[,perm|@setname]...
1762 1773 filesystem|volume
1763 1774 Delegates ZFS administration permission for the file systems to non-
1764 1775 privileged users.
1765 1776
1766 1777 -d Allow only for the descendent file systems.
1767 1778
1768 1779 -e|everyone
1769 1780 Specifies that the permissions be delegated to everyone.
1770 1781
1771 1782 -g group[,group]...
1772 1783 Explicitly specify that permissions are delegated to the group.
1773 1784
1774 1785 -l Allow "locally" only for the specified file system.
1775 1786
1776 1787 -u user[,user]...
1777 1788 Explicitly specify that permissions are delegated to the user.
1778 1789
1779 1790 user|group[,user|group]...
1780 1791 Specifies to whom the permissions are delegated. Multiple entities
1781 1792 can be specified as a comma-separated list. If neither of the -gu
1782 1793 options are specified, then the argument is interpreted
1783 1794 preferentially as the keyword everyone, then as a user name, and
1784 1795 lastly as a group name. To specify a user or group named
1785 1796 "everyone", use the -g or -u options. To specify a group with the
1786 1797 same name as a user, use the -g options.
1787 1798
1788 1799 perm|@setname[,perm|@setname]...
1789 1800 The permissions to delegate. Multiple permissions may be specified
1790 1801 as a comma-separated list. Permission names are the same as ZFS
1791 1802 subcommand and property names. See the property list below.
1792 1803 Property set names, which begin with @, may be specified. See the
1793 1804 -s form below for details.
1794 1805
1795 1806 If neither of the -dl options are specified, or both are, then the
1796 1807 permissions are allowed for the file system or volume, and all of its
1797 1808 descendents.
1798 1809
1799 1810 Permissions are generally the ability to use a ZFS subcommand or change
1800 1811 a ZFS property. The following permissions are available:
1801 1812
1802 1813 NAME TYPE NOTES
1803 1814 allow subcommand Must also have the permission that is
1804 1815 being allowed
1805 1816 clone subcommand Must also have the 'create' ability and
1806 1817 'mount' ability in the origin file system
1807 1818 create subcommand Must also have the 'mount' ability
1808 1819 destroy subcommand Must also have the 'mount' ability
1809 1820 diff subcommand Allows lookup of paths within a dataset
1810 1821 given an object number, and the ability
1811 1822 to create snapshots necessary to
1812 1823 'zfs diff'.
1813 1824 mount subcommand Allows mount/umount of ZFS datasets
1814 1825 promote subcommand Must also have the 'mount' and 'promote'
1815 1826 ability in the origin file system
1816 1827 receive subcommand Must also have the 'mount' and 'create'
1817 1828 ability
1818 1829 rename subcommand Must also have the 'mount' and 'create'
1819 1830 ability in the new parent
1820 1831 rollback subcommand Must also have the 'mount' ability
1821 1832 send subcommand
1822 1833 share subcommand Allows sharing file systems over NFS
1823 1834 or SMB protocols
1824 1835 snapshot subcommand Must also have the 'mount' ability
1825 1836
1826 1837 groupquota other Allows accessing any groupquota@...
1827 1838 property
1828 1839 groupused other Allows reading any groupused@... property
1829 1840 userprop other Allows changing any user property
1830 1841 userquota other Allows accessing any userquota@...
1831 1842 property
1832 1843 userused other Allows reading any userused@... property
1833 1844
1834 1845 aclinherit property
1835 1846 aclmode property
1836 1847 atime property
1837 1848 canmount property
1838 1849 casesensitivity property
1839 1850 checksum property
1840 1851 compression property
1841 1852 copies property
1842 1853 devices property
1843 1854 exec property
1844 1855 filesystem_limit property
1845 1856 mountpoint property
1846 1857 nbmand property
1847 1858 normalization property
1848 1859 primarycache property
1849 1860 quota property
1850 1861 readonly property
1851 1862 recordsize property
1852 1863 refquota property
1853 1864 refreservation property
1854 1865 reservation property
1855 1866 secondarycache property
1856 1867 setuid property
1857 1868 sharenfs property
1858 1869 sharesmb property
1859 1870 snapdir property
1860 1871 snapshot_limit property
1861 1872 utf8only property
1862 1873 version property
1863 1874 volblocksize property
1864 1875 volsize property
1865 1876 vscan property
1866 1877 xattr property
1867 1878 zoned property
1868 1879
1869 1880 zfs allow -c perm|@setname[,perm|@setname]... filesystem|volume
1870 1881 Sets "create time" permissions. These permissions are granted
1871 1882 (locally) to the creator of any newly-created descendent file system.
1872 1883
1873 1884 zfs allow -s @setname perm|@setname[,perm|@setname]... filesystem|volume
1874 1885 Defines or adds permissions to a permission set. The set can be used
1875 1886 by other zfs allow commands for the specified file system and its
1876 1887 descendents. Sets are evaluated dynamically, so changes to a set are
1877 1888 immediately reflected. Permission sets follow the same naming
1878 1889 restrictions as ZFS file systems, but the name must begin with @, and
1879 1890 can be no more than 64 characters long.
1880 1891
1881 1892 zfs unallow [-dglru] user|group[,user|group]...
1882 1893 [perm|@setname[,perm|@setname]...] filesystem|volume
1883 1894 zfs unallow [-dlr] -e|everyone [perm|@setname[,perm|@setname]...]
1884 1895 filesystem|volume
1885 1896 zfs
1886 1897 unallow
1887 1898 [-r]
1888 1899 -c
1889 1900 [perm|@setname[,perm|@setname]...]
1890 1901 filesystem|volume
1891 1902 Removes permissions that were granted with the zfs allow command. No
1892 1903 permissions are explicitly denied, so other permissions granted are
1893 1904 still in effect. For example, if the permission is granted by an
1894 1905 ancestor. If no permissions are specified, then all permissions for
1895 1906 the specified user, group, or everyone are removed. Specifying
1896 1907 everyone (or using the -e option) only removes the permissions that
1897 1908 were granted to everyone, not all permissions for every user and group.
1898 1909 See the zfs allow command for a description of the -ldugec options.
1899 1910
1900 1911 -r Recursively remove the permissions from this file system and all
1901 1912 descendents.
1902 1913
1903 1914 zfs unallow [-r] -s @setname [perm|@setname[,perm|@setname]...]
1904 1915 filesystem|volume
1905 1916 Removes permissions from a permission set. If no permissions are
1906 1917 specified, then all permissions are removed, thus removing the set
1907 1918 entirely.
1908 1919
1909 1920 zfs hold [-r] tag snapshot...
1910 1921 Adds a single reference, named with the tag argument, to the specified
1911 1922 snapshot or snapshots. Each snapshot has its own tag namespace, and
1912 1923 tags must be unique within that space.
1913 1924
1914 1925 If a hold exists on a snapshot, attempts to destroy that snapshot by
1915 1926 using the zfs destroy command return EBUSY.
1916 1927
1917 1928 -r Specifies that a hold with the given tag is applied recursively to
1918 1929 the snapshots of all descendent file systems.
1919 1930
1920 1931 zfs holds [-r] snapshot...
1921 1932 Lists all existing user references for the given snapshot or snapshots.
1922 1933
1923 1934 -r Lists the holds that are set on the named descendent snapshots, in
1924 1935 addition to listing the holds on the named snapshot.
1925 1936
1926 1937 zfs release [-r] tag snapshot...
1927 1938 Removes a single reference, named with the tag argument, from the
1928 1939 specified snapshot or snapshots. The tag must already exist for each
1929 1940 snapshot. If a hold exists on a snapshot, attempts to destroy that
1930 1941 snapshot by using the zfs destroy command return EBUSY.
1931 1942
1932 1943 -r Recursively releases a hold with the given tag on the snapshots of
1933 1944 all descendent file systems.
1934 1945
1935 1946 zfs diff [-FHt] snapshot snapshot|filesystem
1936 1947 Display the difference between a snapshot of a given filesystem and
1937 1948 another snapshot of that filesystem from a later time or the current
1938 1949 contents of the filesystem. The first column is a character indicating
1939 1950 the type of change, the other columns indicate pathname, new pathname
1940 1951 (in case of rename), change in link count, and optionally file type
1941 1952 and/or change time. The types of change are:
1942 1953
1943 1954 - The path has been removed
1944 1955 + The path has been created
1945 1956 M The path has been modified
1946 1957 R The path has been renamed
1947 1958
1948 1959 -F Display an indication of the type of file, in a manner similar to
1949 1960 the - option of ls(1).
1950 1961
1951 1962 B Block device
1952 1963 C Character device
1953 1964 / Directory
1954 1965 > Door
1955 1966 | Named pipe
1956 1967 @ Symbolic link
1957 1968 P Event port
1958 1969 = Socket
1959 1970 F Regular file
1960 1971
1961 1972 -H Give more parsable tab-separated output, without header lines and
1962 1973 without arrows.
1963 1974
1964 1975 -t Display the path's inode change time as the first column of output.
1965 1976
1966 1977 zfs program [-n] [-t timeout] [-m memory_limit] pool script [arg1 ...]
1967 1978 Executes script as a ZFS channel program on pool. The ZFS channel
1968 1979 program interface allows ZFS administrative operations to be run
1969 1980 programmatically via a Lua script. The entire script is executed
1970 1981 atomically, with no other administrative operations taking effect
1971 1982 concurrently. A library of ZFS calls is made available to channel
1972 1983 program scripts. Channel programs may only be run with root
1973 1984 privileges.
1974 1985
1975 1986 For full documentation of the ZFS channel program interface, see the
1976 1987 manual page for
1977 1988
1978 1989 -n
1979 1990 Executes a read-only channel program, which runs faster. The program
1980 1991 cannot change on-disk state by calling functions from the zfs.sync
1981 1992 submodule. The program can be used to gather information such as
1982 1993 properties and determining if changes would succeed (zfs.check.*).
1983 1994 Without this flag, all pending changes must be synced to disk before
1984 1995 a channel program can complete.
1985 1996
1986 1997 -t timeout
1987 1998 Execution time limit, in milliseconds. If a channel program executes
1988 1999 for longer than the provided timeout, it will be stopped and an error
1989 2000 will be returned. The default timeout is 1000 ms, and can be set to
1990 2001 a maximum of 10000 ms.
1991 2002
1992 2003 -m memory-limit
1993 2004 Memory limit, in bytes. If a channel program attempts to allocate
1994 2005 more memory than the given limit, it will be stopped and an error
1995 2006 returned. The default memory limit is 10 MB, and can be set to a
1996 2007 maximum of 100 MB.
1997 2008
1998 2009 All remaining argument strings are passed directly to the channel
1999 2010 program as arguments. See zfs-program(1M) for more information.
2000 2011
2001 2012 EXIT STATUS
2002 2013 The zfs utility exits 0 on success, 1 if an error occurs, and 2 if
2003 2014 invalid command line options were specified.
2004 2015
2005 2016 EXAMPLES
2006 2017 Example 1 Creating a ZFS File System Hierarchy
2007 2018 The following commands create a file system named pool/home and a file
2008 2019 system named pool/home/bob. The mount point /export/home is set for
2009 2020 the parent file system, and is automatically inherited by the child
2010 2021 file system.
2011 2022
2012 2023 # zfs create pool/home
2013 2024 # zfs set mountpoint=/export/home pool/home
2014 2025 # zfs create pool/home/bob
2015 2026
2016 2027 Example 2 Creating a ZFS Snapshot
2017 2028 The following command creates a snapshot named yesterday. This
2018 2029 snapshot is mounted on demand in the .zfs/snapshot directory at the
2019 2030 root of the pool/home/bob file system.
2020 2031
2021 2032 # zfs snapshot pool/home/bob@yesterday
2022 2033
2023 2034 Example 3 Creating and Destroying Multiple Snapshots
2024 2035 The following command creates snapshots named yesterday of pool/home
2025 2036 and all of its descendent file systems. Each snapshot is mounted on
2026 2037 demand in the .zfs/snapshot directory at the root of its file system.
2027 2038 The second command destroys the newly created snapshots.
2028 2039
2029 2040 # zfs snapshot -r pool/home@yesterday
2030 2041 # zfs destroy -r pool/home@yesterday
2031 2042
2032 2043 Example 4 Disabling and Enabling File System Compression
2033 2044 The following command disables the compression property for all file
2034 2045 systems under pool/home. The next command explicitly enables
2035 2046 compression for pool/home/anne.
2036 2047
2037 2048 # zfs set compression=off pool/home
2038 2049 # zfs set compression=on pool/home/anne
2039 2050
2040 2051 Example 5 Listing ZFS Datasets
2041 2052 The following command lists all active file systems and volumes in the
2042 2053 system. Snapshots are displayed if the listsnaps property is on. The
2043 2054 default is off. See zpool(1M) for more information on pool properties.
2044 2055
2045 2056 # zfs list
2046 2057 NAME USED AVAIL REFER MOUNTPOINT
2047 2058 pool 450K 457G 18K /pool
2048 2059 pool/home 315K 457G 21K /export/home
2049 2060 pool/home/anne 18K 457G 18K /export/home/anne
2050 2061 pool/home/bob 276K 457G 276K /export/home/bob
2051 2062
2052 2063 Example 6 Setting a Quota on a ZFS File System
2053 2064 The following command sets a quota of 50 Gbytes for pool/home/bob.
2054 2065
2055 2066 # zfs set quota=50G pool/home/bob
2056 2067
2057 2068 Example 7 Listing ZFS Properties
2058 2069 The following command lists all properties for pool/home/bob.
2059 2070
2060 2071 # zfs get all pool/home/bob
2061 2072 NAME PROPERTY VALUE SOURCE
2062 2073 pool/home/bob type filesystem -
2063 2074 pool/home/bob creation Tue Jul 21 15:53 2009 -
2064 2075 pool/home/bob used 21K -
2065 2076 pool/home/bob available 20.0G -
2066 2077 pool/home/bob referenced 21K -
2067 2078 pool/home/bob compressratio 1.00x -
2068 2079 pool/home/bob mounted yes -
2069 2080 pool/home/bob quota 20G local
2070 2081 pool/home/bob reservation none default
2071 2082 pool/home/bob recordsize 128K default
2072 2083 pool/home/bob mountpoint /pool/home/bob default
2073 2084 pool/home/bob sharenfs off default
2074 2085 pool/home/bob checksum on default
2075 2086 pool/home/bob compression on local
2076 2087 pool/home/bob atime on default
2077 2088 pool/home/bob devices on default
2078 2089 pool/home/bob exec on default
2079 2090 pool/home/bob setuid on default
2080 2091 pool/home/bob readonly off default
2081 2092 pool/home/bob zoned off default
2082 2093 pool/home/bob snapdir hidden default
2083 2094 pool/home/bob aclmode discard default
2084 2095 pool/home/bob aclinherit restricted default
2085 2096 pool/home/bob canmount on default
2086 2097 pool/home/bob xattr on default
2087 2098 pool/home/bob copies 1 default
2088 2099 pool/home/bob version 4 -
2089 2100 pool/home/bob utf8only off -
2090 2101 pool/home/bob normalization none -
2091 2102 pool/home/bob casesensitivity sensitive -
2092 2103 pool/home/bob vscan off default
2093 2104 pool/home/bob nbmand off default
2094 2105 pool/home/bob sharesmb off default
2095 2106 pool/home/bob refquota none default
2096 2107 pool/home/bob refreservation none default
2097 2108 pool/home/bob primarycache all default
2098 2109 pool/home/bob secondarycache all default
2099 2110 pool/home/bob usedbysnapshots 0 -
2100 2111 pool/home/bob usedbydataset 21K -
2101 2112 pool/home/bob usedbychildren 0 -
2102 2113 pool/home/bob usedbyrefreservation 0 -
2103 2114
2104 2115 The following command gets a single property value.
2105 2116
2106 2117 # zfs get -H -o value compression pool/home/bob
2107 2118 on
2108 2119 The following command lists all properties with local settings for
2109 2120 pool/home/bob.
2110 2121
2111 2122 # zfs get -r -s local -o name,property,value all pool/home/bob
2112 2123 NAME PROPERTY VALUE
2113 2124 pool/home/bob quota 20G
2114 2125 pool/home/bob compression on
2115 2126
2116 2127 Example 8 Rolling Back a ZFS File System
2117 2128 The following command reverts the contents of pool/home/anne to the
2118 2129 snapshot named yesterday, deleting all intermediate snapshots.
2119 2130
2120 2131 # zfs rollback -r pool/home/anne@yesterday
2121 2132
2122 2133 Example 9 Creating a ZFS Clone
2123 2134 The following command creates a writable file system whose initial
2124 2135 contents are the same as pool/home/bob@yesterday.
2125 2136
2126 2137 # zfs clone pool/home/bob@yesterday pool/clone
2127 2138
2128 2139 Example 10 Promoting a ZFS Clone
2129 2140 The following commands illustrate how to test out changes to a file
2130 2141 system, and then replace the original file system with the changed one,
2131 2142 using clones, clone promotion, and renaming:
2132 2143
2133 2144 # zfs create pool/project/production
2134 2145 populate /pool/project/production with data
2135 2146 # zfs snapshot pool/project/production@today
2136 2147 # zfs clone pool/project/production@today pool/project/beta
2137 2148 make changes to /pool/project/beta and test them
2138 2149 # zfs promote pool/project/beta
2139 2150 # zfs rename pool/project/production pool/project/legacy
2140 2151 # zfs rename pool/project/beta pool/project/production
2141 2152 once the legacy version is no longer needed, it can be destroyed
2142 2153 # zfs destroy pool/project/legacy
2143 2154
2144 2155 Example 11 Inheriting ZFS Properties
2145 2156 The following command causes pool/home/bob and pool/home/anne to
2146 2157 inherit the checksum property from their parent.
2147 2158
2148 2159 # zfs inherit checksum pool/home/bob pool/home/anne
2149 2160
2150 2161 Example 12 Remotely Replicating ZFS Data
2151 2162 The following commands send a full stream and then an incremental
2152 2163 stream to a remote machine, restoring them into poolB/received/fs@a and
2153 2164 poolB/received/fs@b, respectively. poolB must contain the file system
2154 2165 poolB/received, and must not initially contain poolB/received/fs.
2155 2166
2156 2167 # zfs send pool/fs@a | \
2157 2168 ssh host zfs receive poolB/received/fs@a
2158 2169 # zfs send -i a pool/fs@b | \
2159 2170 ssh host zfs receive poolB/received/fs
2160 2171
2161 2172 Example 13 Using the zfs receive -d Option
2162 2173 The following command sends a full stream of poolA/fsA/fsB@snap to a
2163 2174 remote machine, receiving it into poolB/received/fsA/fsB@snap. The
2164 2175 fsA/fsB@snap portion of the received snapshot's name is determined from
2165 2176 the name of the sent snapshot. poolB must contain the file system
2166 2177 poolB/received. If poolB/received/fsA does not exist, it is created as
2167 2178 an empty file system.
2168 2179
2169 2180 # zfs send poolA/fsA/fsB@snap | \
2170 2181 ssh host zfs receive -d poolB/received
2171 2182
2172 2183 Example 14 Setting User Properties
2173 2184 The following example sets the user-defined com.example:department
2174 2185 property for a dataset.
2175 2186
2176 2187 # zfs set com.example:department=12345 tank/accounting
2177 2188
2178 2189 Example 15 Performing a Rolling Snapshot
2179 2190 The following example shows how to maintain a history of snapshots with
2180 2191 a consistent naming scheme. To keep a week's worth of snapshots, the
2181 2192 user destroys the oldest snapshot, renames the remaining snapshots, and
2182 2193 then creates a new snapshot, as follows:
2183 2194
2184 2195 # zfs destroy -r pool/users@7daysago
2185 2196 # zfs rename -r pool/users@6daysago @7daysago
2186 2197 # zfs rename -r pool/users@5daysago @6daysago
2187 2198 # zfs rename -r pool/users@yesterday @5daysago
2188 2199 # zfs rename -r pool/users@yesterday @4daysago
2189 2200 # zfs rename -r pool/users@yesterday @3daysago
2190 2201 # zfs rename -r pool/users@yesterday @2daysago
2191 2202 # zfs rename -r pool/users@today @yesterday
2192 2203 # zfs snapshot -r pool/users@today
2193 2204
2194 2205 Example 16 Setting sharenfs Property Options on a ZFS File System
2195 2206 The following commands show how to set sharenfs property options to
2196 2207 enable rw access for a set of IP addresses and to enable root access
2197 2208 for system neo on the tank/home file system.
2198 2209
2199 2210 # zfs set sharenfs='rw=@123.123.0.0/16,root=neo' tank/home
2200 2211
2201 2212 If you are using DNS for host name resolution, specify the fully
2202 2213 qualified hostname.
2203 2214
2204 2215 Example 17 Delegating ZFS Administration Permissions on a ZFS Dataset
2205 2216 The following example shows how to set permissions so that user cindys
2206 2217 can create, destroy, mount, and take snapshots on tank/cindys. The
2207 2218 permissions on tank/cindys are also displayed.
2208 2219
2209 2220 # zfs allow cindys create,destroy,mount,snapshot tank/cindys
2210 2221 # zfs allow tank/cindys
2211 2222 ---- Permissions on tank/cindys --------------------------------------
2212 2223 Local+Descendent permissions:
2213 2224 user cindys create,destroy,mount,snapshot
2214 2225
2215 2226 Because the tank/cindys mount point permission is set to 755 by
2216 2227 default, user cindys will be unable to mount file systems under
2217 2228 tank/cindys. Add an ACE similar to the following syntax to provide
2218 2229 mount point access:
2219 2230
2220 2231 # chmod A+user:cindys:add_subdirectory:allow /tank/cindys
2221 2232
2222 2233 Example 18 Delegating Create Time Permissions on a ZFS Dataset
2223 2234 The following example shows how to grant anyone in the group staff to
2224 2235 create file systems in tank/users. This syntax also allows staff
2225 2236 members to destroy their own file systems, but not destroy anyone
2226 2237 else's file system. The permissions on tank/users are also displayed.
2227 2238
2228 2239 # zfs allow staff create,mount tank/users
2229 2240 # zfs allow -c destroy tank/users
2230 2241 # zfs allow tank/users
2231 2242 ---- Permissions on tank/users ---------------------------------------
2232 2243 Permission sets:
2233 2244 destroy
2234 2245 Local+Descendent permissions:
2235 2246 group staff create,mount
2236 2247
2237 2248 Example 19 Defining and Granting a Permission Set on a ZFS Dataset
2238 2249 The following example shows how to define and grant a permission set on
2239 2250 the tank/users file system. The permissions on tank/users are also
2240 2251 displayed.
2241 2252
2242 2253 # zfs allow -s @pset create,destroy,snapshot,mount tank/users
2243 2254 # zfs allow staff @pset tank/users
2244 2255 # zfs allow tank/users
2245 2256 ---- Permissions on tank/users ---------------------------------------
2246 2257 Permission sets:
2247 2258 @pset create,destroy,mount,snapshot
2248 2259 Local+Descendent permissions:
2249 2260 group staff @pset
2250 2261
2251 2262 Example 20 Delegating Property Permissions on a ZFS Dataset
2252 2263 The following example shows to grant the ability to set quotas and
2253 2264 reservations on the users/home file system. The permissions on
2254 2265 users/home are also displayed.
2255 2266
2256 2267 # zfs allow cindys quota,reservation users/home
2257 2268 # zfs allow users/home
2258 2269 ---- Permissions on users/home ---------------------------------------
2259 2270 Local+Descendent permissions:
2260 2271 user cindys quota,reservation
2261 2272 cindys% zfs set quota=10G users/home/marks
2262 2273 cindys% zfs get quota users/home/marks
2263 2274 NAME PROPERTY VALUE SOURCE
2264 2275 users/home/marks quota 10G local
2265 2276
2266 2277 Example 21 Removing ZFS Delegated Permissions on a ZFS Dataset
2267 2278 The following example shows how to remove the snapshot permission from
2268 2279 the staff group on the tank/users file system. The permissions on
2269 2280 tank/users are also displayed.
2270 2281
2271 2282 # zfs unallow staff snapshot tank/users
2272 2283 # zfs allow tank/users
2273 2284 ---- Permissions on tank/users ---------------------------------------
2274 2285 Permission sets:
2275 2286 @pset create,destroy,mount,snapshot
2276 2287 Local+Descendent permissions:
2277 2288 group staff @pset
2278 2289
2279 2290 Example 22 Showing the differences between a snapshot and a ZFS Dataset
2280 2291 The following example shows how to see what has changed between a prior
2281 2292 snapshot of a ZFS dataset and its current state. The -F option is used
2282 2293 to indicate type information for the files affected.
2283 2294
2284 2295 # zfs diff -F tank/test@before tank/test
2285 2296 M / /tank/test/
2286 2297 M F /tank/test/linked (+1)
2287 2298 R F /tank/test/oldname -> /tank/test/newname
2288 2299 - F /tank/test/deleted
2289 2300 + F /tank/test/created
2290 2301 M F /tank/test/modified
2291 2302
2292 2303 INTERFACE STABILITY
2293 2304 Committed.
2294 2305
2295 2306 SEE ALSO
2296 2307 gzip(1), ssh(1), mount(1M), share(1M), sharemgr(1M), unshare(1M),
2297 2308 zonecfg(1M), zpool(1M), chmod(2), stat(2), write(2), fsync(3C),
2298 2309 dfstab(4), acl(5), attributes(5)
2299 2310
2300 2311 illumos December 6, 2017 illumos
↓ open down ↓ |
1405 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX