summaryrefslogtreecommitdiffstats
path: root/cddl/contrib/opensolaris/cmd/zfs/zfs.8
blob: d49cb874486dfa491945217db7a0c3456fa8baa5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
'\" te
.\" CDDL HEADER START
.\"
.\" The contents of this file are subject to the terms of the
.\" Common Development and Distribution License (the "License").  
.\" You may not use this file except in compliance with the License.
.\"
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
.\" or http://www.opensolaris.org/os/licensing.
.\" See the License for the specific language governing permissions
.\" and limitations under the License.
.\"
.\" When distributing Covered Code, include this CDDL HEADER in each
.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
.\" If applicable, add the following below this CDDL HEADER, with the
.\" fields enclosed by brackets "[]" replaced with your own identifying
.\" information: Portions Copyright [yyyy] [name of copyright owner]
.\"
.\" CDDL HEADER END
.\" Copyright (c) 2007 Sun Microsystems, Inc. All Rights Reserved.
.TH zfs 1M "16 Mar 2007" "SunOS 5.11" "System Administration Commands"
.SH NAME
zfs \- configures ZFS file systems
.SH SYNOPSIS
.LP
.nf
\fBzfs\fR [\fB-?\fR]
.fi

.LP
.nf
\fBzfs\fR \fBcreate\fR [[\fB-o\fR property=\fIvalue\fR]]... \fIfilesystem\fR
.fi

.LP
.nf
\fBzfs\fR \fBcreate\fR [\fB-s\fR] [\fB-b\fR \fIblocksize\fR] [[\fB-o\fR property=\fIvalue\fR]]... \fB-V\fR \fIsize\fR \fIvolume\fR
.fi

.LP
.nf
\fBzfs\fR \fBdestroy\fR [\fB-rRf\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
.fi

.LP
.nf
\fBzfs\fR \fBclone\fR \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR
.fi

.LP
.nf
\fBzfs\fR \fBpromote\fR \fIfilesystem\fR
.fi

.LP
.nf
\fBzfs\fR \fBrename\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR 
    [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR]
.fi

.LP
.nf
\fBzfs\fR \fBsnapshot\fR [\fB-r\fR] \fIfilesystem@name\fR|\fIvolume@name\fR
.fi

.LP
.nf
\fBzfs\fR \fBrollback\fR [\fB-rRf\fR] \fIsnapshot\fR
.fi

.LP
.nf
\fBzfs\fR \fBlist\fR [\fB-rH\fR] [\fB-o\fR \fIprop\fR[,\fIprop\fR] ]... [ \fB-t\fR \fItype\fR[,\fItype\fR]...]
    [ \fB-s\fR \fIprop\fR [\fB-s\fR \fIprop\fR]... [ \fB-S\fR \fIprop\fR [\fB-S\fR \fIprop\fR]... 
    [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR|\fI/pathname\fR|.\fI/pathname\fR ...
.fi

.LP
.nf
\fBzfs\fR \fBset\fR \fIproperty\fR=\fIvalue\fR \fIfilesystem\fR|\fIvolume\fR ...
.fi

.LP
.nf
\fBzfs\fR \fBget\fR [\fB-rHp\fR] [\fB-o\fR \fIfield\fR[,\fIfield\fR]...] 
    [\fB-s\fR \fIsource\fR[,\fIsource\fR]...] \fIall\fR | \fIproperty\fR[,\fIproperty\fR]...
     \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...
.fi

.LP
.nf
\fBzfs\fR \fBinherit\fR [\fB-r\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume\fR... ...
.fi

.LP
.nf
\fBzfs\fR \fBmount\fR 
.fi

.LP
.nf
\fBzfs\fR \fBmount\fR [\fB-o \fIoptions\fR\fR] [\fB-O\fR] \fB-a\fR
.fi

.LP
.nf
\fBzfs\fR \fBmount\fR [\fB-o \fIoptions\fR\fR] [\fB-O\fR] \fIfilesystem\fR
.fi

.LP
.nf
\fBzfs\fR \fBunmount\fR [\fB-f\fR] \fB-a\fR
.fi

.LP
.nf
\fBzfs\fR \fBunmount\fR [\fB-f\fR] \fB\fIfilesystem\fR|\fImountpoint\fR\fR
.fi

.LP
.nf
\fBzfs\fR \fBshare\fR \fB-a\fR
.fi

.LP
.nf
\fBzfs\fR \fBshare\fR \fIfilesystem\fR
.fi

.LP
.nf
\fBzfs\fR \fBunshare\fR [\fB-f\fR] \fB-a\fR
.fi

.LP
.nf
\fBzfs\fR \fBunshare\fR [\fB-f\fR] \fB\fIfilesystem\fR|\fImountpoint\fR\fR
.fi

.LP
.nf
\fBzfs\fR \fBsend\fR [\fB-i\fR \fIsnapshot1\fR] \fB\fIsnapshot2\fR\fR
.fi

.LP
.nf
\fBzfs\fR \fBreceive\fR [\fB-vnF\fR ] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
.fi

.LP
.nf
\fBzfs\fR \fBreceive\fR [\fB-vnF\fR ] \fB-d\fR \fB\fIfilesystem\fR\fR
.fi
.LP
.nf
\fBzfs\fR \fBjail\fR \fBjailid\fR \fB\fIfilesystem\fR\fR
.fi
.LP
.nf
\fBzfs\fR \fBunjail\fR \fBjailid\fR \fB\fIfilesystem\fR\fR
.fi

.SH DESCRIPTION
.LP
The \fBzfs\fR command configures \fBZFS\fR datasets within a \fBZFS\fR storage pool, as described in \fBzpool\fR(1M). A
dataset is identified by a unique path within the \fBZFS\fR namespace. For example:
.sp
.in +2
.nf
pool/{filesystem,volume,snapshot}
.fi
.in -2
.sp

.LP
where the maximum length of a dataset name is \fBMAXNAMELEN\fR (256 bytes).
.LP
A dataset can be one of the following:
.sp
.ne 2
.mk
.na
\fB\fIfile system\fR\fR
.ad
.RS 15n
.rt  
A standard \fBPOSIX\fR file system. \fBZFS\fR file systems can be mounted within the standard file system namespace and behave like any other file system.
.RE

.sp
.ne 2
.mk
.na
\fB\fIvolume\fR\fR
.ad
.RS 15n
.rt  
A logical volume exported as a raw or block device. This type of dataset should only be used under special circumstances. File systems are typically used in most environments. Volumes cannot be used in a non-global zone.
.RE

.sp
.ne 2
.mk
.na
\fB\fIsnapshot\fR\fR
.ad
.RS 15n
.rt  
A read-only version of a file system or volume at a given point in time. It is specified as \fIfilesystem@name\fR or \fIvolume@name\fR.
.RE

.SS "ZFS File System Hierarchy"
.LP
A \fBZFS\fR storage pool is a logical collection of devices that provide space for datasets. A storage pool is also the root of the \fBZFS\fR file system hierarchy.
.LP
The root of the pool can be accessed as a file system, such as mounting and unmounting, taking snapshots, and setting properties. The physical storage characteristics, however, are managed by the \fBzpool\fR(1M) command.
.LP
See \fBzpool\fR(1M) for more information on creating and administering pools.
.SS "Snapshots"
.LP
A snapshot is a read-only copy of a file system or volume. Snapshots can be created extremely quickly, and initially consume no additional space within the pool. As data within the active dataset changes, the snapshot consumes more data than would otherwise be shared with the active dataset.
.LP
Snapshots can have arbitrary names. Snapshots of volumes can be cloned or rolled back, but cannot be accessed independently.
.LP
File system snapshots can be accessed under the ".zfs/snapshot" directory in the root of the file system. Snapshots are automatically mounted on demand and may be unmounted at regular intervals. The visibility of the ".zfs" directory can be controlled by the "snapdir"
property.
.SS "Clones"
.LP
A clone is a writable volume or file system whose initial contents are the same as another dataset. As with snapshots, creating a clone is nearly instantaneous, and initially consumes no additional space.
.LP
Clones can only be created from a snapshot. When a snapshot is cloned, it creates an implicit dependency between the parent and child. Even though the clone is created somewhere else in the dataset hierarchy, the original snapshot cannot be destroyed as long as a clone exists. The "origin"
property exposes this dependency, and the \fBdestroy\fR command lists any such dependencies, if they exist.
.LP
The clone parent-child dependency relationship can be reversed by using the "\fBpromote\fR" subcommand. This causes the "origin" file system to become a clone of the specified file system, which makes it possible to destroy the file system that the clone
was created from.
.SS "Mount Points"
.LP
Creating a \fBZFS\fR file system is a simple operation, so the number of file systems per system will likely be numerous. To cope with this, \fBZFS\fR automatically manages mounting and unmounting file systems without the need to edit the \fB/etc/vfstab\fR file.
All automatically managed file systems are mounted by \fBZFS\fR at boot time.
.LP
By default, file systems are mounted under \fB/\fIpath\fR\fR, where \fIpath\fR is the name of the file system in the \fBZFS\fR namespace. Directories are created and destroyed as needed.
.LP
A file system can also have a mount point set in the "mountpoint" property. This directory is created as needed, and \fBZFS\fR automatically mounts the file system when the "\fBzfs mount -a\fR" command is invoked (without editing \fB/etc/vfstab\fR). The mountpoint property can be inherited, so if \fBpool/home\fR has a mount point of \fB/export/stuff\fR, then \fBpool/home/user\fR automatically inherits a mount point of \fB/export/stuff/user\fR.
.LP
A file system mountpoint property of "none" prevents the file system from being mounted.
.LP
If needed, \fBZFS\fR file systems can also be managed with traditional tools (\fBmount\fR, \fBumount\fR, \fB/etc/vfstab\fR). If a file system's mount point is set to "legacy", \fBZFS\fR makes no attempt to manage
the file system, and the administrator is responsible for mounting and unmounting the file system.
.SS "Zones"
.LP
A \fBZFS\fR file system can be added to a non-global zone by using zonecfg's "\fBadd fs\fR" subcommand. A \fBZFS\fR file system that is added to a non-global zone must have its mountpoint property set to legacy.
.LP
The physical properties of an added file system are controlled by the global administrator. However, the zone administrator can create, modify, or destroy files within the added file system, depending on how the file system is mounted.
.LP
A dataset can also be delegated to a non-global zone by using zonecfg's "\fBadd dataset\fR" subcommand. You cannot delegate a dataset to one zone and the children of the same dataset to another zone. The zone administrator can change properties of the dataset or
any of its children. However, the "quota" property is controlled by the global administrator.
.LP
A \fBZFS\fR volume can be added as a device to a non-global zone by using zonecfg's "\fBadd device\fR" subcommand. However, its physical properties can only be modified by the global administrator.
.LP
For more information about \fBzonecfg\fR syntax, see \fBzonecfg\fR(1M).
.LP
After a dataset is delegated to a non-global zone, the "zoned" property is automatically set. A zoned file system cannot be mounted in the global zone, since the zone administrator might have to set the mount point to an unacceptable value.
.LP
The global administrator can forcibly clear the "zoned" property, though this should be done with extreme care. The global administrator should verify that all the mount points are acceptable before clearing the property.
.SS "Native Properties"
.LP
Properties are divided into two types, native properties and user defined properties. Native properties either export internal statistics or control \fBZFS\fR behavior. In addition, native properties are either editable or read-only. User properties have no effect on \fBZFS\fR behavior,
but you can use them to annotate datasets in a way that is meaningful in your environment. For more information about user properties, see the "User Properties" section.
.LP
Every dataset has a set of properties that export statistics about the dataset as well as control various behavior. Properties are inherited from the parent unless overridden by the child. Snapshot properties can not be edited; they always inherit their inheritable properties. Properties
that are not applicable to snapshots are not displayed.
.LP
The values of numeric properties can be specified using the following human-readable suffixes (for example, "k", "KB", "M", "Gb", etc, up to Z for zettabyte). The following are all valid (and equal) specifications: 
.sp
.in +2
.nf
"1536M", "1.5g", "1.50GB".
.fi
.in -2
.sp

.LP
The values of non-numeric properties are case sensitive and must be lowercase, except for "mountpoint" and "sharenfs".
.LP
The first set of properties consist of read-only statistics about the dataset. These properties cannot be set, nor are they inherited. Native properties apply to all dataset types unless otherwise noted.
.sp
.ne 2
.mk
.na
\fBtype\fR
.ad
.RS 17n
.rt  
The type of dataset: "filesystem", "volume", "snapshot", or "clone".
.RE

.sp
.ne 2
.mk
.na
\fBcreation\fR
.ad
.RS 17n
.rt  
The time this dataset was created.
.RE

.sp
.ne 2
.mk
.na
\fBused\fR
.ad
.RS 17n
.rt  
The amount of space consumed by this dataset and all its descendants. This is the value that is checked against this dataset's quota and reservation. The space used does not include this dataset's reservation, but does take into account the reservations of any descendant datasets.
The amount of space that a dataset consumes from its parent, as well as the amount of space that will be freed if this dataset is recursively destroyed, is the greater of its space used and its reservation.
.sp
When snapshots (see the "Snapshots" section) are created, their space is initially shared between the snapshot and the file system, and possibly with previous snapshots. As the file system changes, space that was previously shared becomes unique to the snapshot, and counted in
the snapshot's space used. Additionally, deleting snapshots can increase the amount of space unique to (and used by) other snapshots.
.sp
The amount of space used, available, or referenced does not take into account pending changes. Pending changes are generally accounted for within a few seconds. Committing a change to a disk using \fBfsync\fR(3c) or \fBO_SYNC\fR does not necessarily guarantee that the space usage information is updated immediately.
.RE

.sp
.ne 2
.mk
.na
\fBavailable\fR
.ad
.RS 17n
.rt  
The amount of space available to the dataset and all its children, assuming that there is no other activity in the pool. Because space is shared within a pool, availability can be limited by any number of factors, including physical pool size, quotas, reservations, or other datasets
within the pool.
.sp
This property can also be referred to by its shortened column name, "avail".
.RE

.sp
.ne 2
.mk
.na
\fBreferenced\fR
.ad
.RS 17n
.rt  
The amount of data that is accessible by this dataset, which may or may not be shared with other datasets in the pool. When a snapshot or clone is created, it initially references the same amount of space as the file system or snapshot it was created from, since its contents are
identical.
.sp
This property can also be referred to by its shortened column name, "refer".
.RE

.sp
.ne 2
.mk
.na
\fBcompressratio\fR
.ad
.RS 17n
.rt  
The compression ratio achieved for this dataset, expressed as a multiplier. Compression can be turned on by running "zfs set compression=on \fIdataset\fR". The default value is "off".
.RE

.sp
.ne 2
.mk
.na
\fBmounted\fR
.ad
.RS 17n
.rt  
For file systems, indicates whether the file system is currently mounted. This property can be either "yes" or "no".
.RE

.sp
.ne 2
.mk
.na
\fBorigin\fR
.ad
.RS 17n
.rt  
For cloned file systems or volumes, the snapshot from which the clone was created. The origin cannot be destroyed (even with the \fB-r\fR or \fB-f\fR options) so long as a clone exists.
.RE

.LP
The following two properties can be set to control the way space is allocated between datasets. These properties are not inherited, but do affect their descendants.
.sp
.ne 2
.mk
.na
\fBquota=\fIsize\fR | \fInone\fR\fR
.ad
.sp .6
.RS 4n
Limits the amount of space a dataset and its descendants can consume. This property enforces a hard limit on the amount of space used. This includes all space consumed by descendants, including file systems and snapshots. Setting a quota on a descendant of a dataset that already
has a quota does not override the ancestor's quota, but rather imposes an additional limit.
.sp
Quotas cannot be set on volumes, as the "volsize" property acts as an implicit quota.
.RE

.sp
.ne 2
.mk
.na
\fBreservation=\fIsize\fR | \fInone\fR\fR
.ad
.sp .6
.RS 4n
The minimum amount of space guaranteed to a dataset and its descendants. When the amount of space used is below this value, the dataset is treated as if it were taking up the amount of space specified by its reservation. Reservations are accounted for in the parent datasets' space
used, and count against the parent datasets' quotas and reservations.
.sp
This property can also be referred to by its shortened column name, "reserv".
.RE

.sp
.ne 2
.mk
.na
\fBvolsize=\fIsize\fR\fR
.ad
.sp .6
.RS 4n
For volumes, specifies the logical size of the volume. By default, creating a volume establishes a reservation of equal size. Any changes to \fBvolsize\fR are reflected in an equivalent change to the reservation. The \fBvolsize\fR can only be set to a
multiple of \fBvolblocksize\fR, and cannot be zero.
.sp
The reservation is kept equal to the volume's logical size to prevent unexpected behavior for consumers. Without the reservation, the volume could run out of space, resulting in undefined behavior or data corruption, depending on how the volume is used. These effects can also occur when
the volume size is changed while it is in use (particularly when shrinking the size). Extreme care should be used when adjusting the volume size.
.sp
Though not recommended, a "sparse volume" (also known as "thin provisioning") can be created by specifying the \fB-s\fR option to the "\fBzfs create -V\fR" command, or by changing the reservation after the volume has been created.
A "sparse volume" is a volume where the reservation is less then the volume size. Consequently, writes to a sparse volume can fail with \fBENOSPC\fR when the pool is low on space. For a sparse volume, changes to \fBvolsize\fR are not reflected in the reservation.
.RE

.sp
.ne 2
.mk
.na
\fBvolblocksize=\fIblocksize\fR\fR
.ad
.sp .6
.RS 4n
For volumes, specifies the block size of the volume. The \fBblocksize\fR cannot be changed once the volume has been written, so it should be set at volume creation time. The default \fBblocksize\fR for volumes is 8 Kbytes. Any power of 2 from 512 bytes
to 128 Kbytes is valid.
.sp
This property can also be referred to by its shortened column name, "volblock".
.RE

.sp
.ne 2
.mk
.na
\fBrecordsize=\fIsize\fR\fR
.ad
.sp .6
.RS 4n
Specifies a suggested block size for files in the file system. This property is designed solely for use with database workloads that access files in fixed-size records. \fBZFS\fR automatically tunes block sizes according to internal algorithms optimized for typical
access patterns. 
.sp
For databases that create very large files but access them in small random chunks, these algorithms may be suboptimal. Specifying a "recordsize" greater than or equal to the record size of the database can result in significant performance gains. Use of this property for general
purpose file systems is strongly discouraged, and may adversely affect performance.
.sp
The size specified must be a power of two greater than or equal to 512 and less than or equal to 128 Kbytes.
.sp
Changing the file system's \fBrecordsize\fR only affects files created afterward; existing files are unaffected.
.sp
This property can also be referred to by its shortened column name, "recsize".
.RE

.sp
.ne 2
.mk
.na
\fBmountpoint=\fIpath\fR | \fInone\fR | \fIlegacy\fR\fR
.ad
.sp .6
.RS 4n
Controls the mount point used for this file system. See the "Mount Points" section for more information on how this property is used. 
.sp
When the mountpoint property is changed for a file system, the file system and any children that inherit the mount point are unmounted. If the new value is "legacy", then they remain unmounted. Otherwise, they are automatically remounted in the new location if the property was
previously "legacy" or "none", or if they were mounted before the property was changed. In addition, any shared file systems are unshared and shared in the new location.
.RE

.sp
.ne 2
.mk
.na
\fBsharenfs=\fIon\fR | \fIoff\fR | \fIopts\fR\fR
.ad
.sp .6
.RS 4n
Controls whether the file system is shared via \fBNFS\fR, and what options are used. A file system with a sharenfs property of "off" is managed through traditional tools such as \fBshare\fR(1M), \fBunshare\fR(1M), and \fBdfstab\fR(4). Otherwise, the file system is automatically shared and unshared with the "\fBzfs share\fR" and "\fBzfs unshare\fR" commands. If the property is set to "on", the \fBshare\fR(1M) command is invoked with no options. Otherwise, the \fBshare\fR(1M) command is invoked with options equivalent to the contents of this property.
.sp
When the "sharenfs" property is changed for a dataset, the dataset and any children inheriting the property are re-shared with the new options, only if the property was previously "off", or if they were shared before the property was changed. If the new property is "off",
the file systems are unshared.
.RE

.sp
.ne 2
.mk
.na
\fBshareiscsi=\fIon\fR | \fIoff\fR\fR
.ad
.sp .6
.RS 4n
Like the "sharenfs" property, "shareiscsi" indicates whether a \fBZFS\fR volume is exported as an \fBiSCSI\fR target. The acceptable values for this property are "on", "off", and "type=disk".
The default value is "off". In the future, other target types might be supported. For example, "tape".
.sp
You might want to set "shareiscsi=on" for a file system so that all \fBZFS\fR volumes within the file system are shared by default. Setting this property on a file system has no direct effect, however.
.RE

.sp
.ne 2
.mk
.na
\fBchecksum=\fIon\fR | \fIoff\fR | \fIfletcher2\fR, | \fIfletcher4\fR | \fIsha256\fR\fR
.ad
.sp .6
.RS 4n
Controls the checksum used to verify data integrity. The default value is "on", which automatically selects an appropriate algorithm (currently, \fIfletcher2\fR, but this may change in future releases). The value "off" disables integrity
checking on user data. Disabling checksums is NOT a recommended practice.
.RE

.sp
.ne 2
.mk
.na
\fBcompression=\fIon\fR | \fIoff\fR | \fIlzjb\fR | \fIgzip\fR | \fIgzip-N\fR\fR
.ad
.sp .6
.RS 4n
Controls the compression algorithm used for this dataset. The "lzjb" compression algorithm is optimized for performance while providing decent data compression. Setting compression to "on" uses the "lzjb" compression algorithm. The "gzip"
compression algorithm uses the same compression as the \fBgzip\fR(1) command.  You can specify the "gzip" level by using the value "gzip-\fIN\fR",
where \fIN\fR is an integer from 1 (fastest) to 9 (best compression ratio). Currently, "gzip" is equivalent to "gzip-6" (which is also the default for \fBgzip\fR(1)).
.sp
This property can also be referred to by its shortened column name "compress".
.RE

.sp
.ne 2
.mk
.na
\fBatime=\fIon\fR | \fIoff\fR\fR
.ad
.sp .6
.RS 4n
Controls whether the access time for files is updated when they are read. Turning this property off avoids producing write traffic when reading files and can result in significant performance gains, though it might confuse mailers and other similar utilities. The default value
is "on".
.RE

.sp
.ne 2
.mk
.na
\fBdevices=\fIon\fR | \fIoff\fR\fR
.ad
.sp .6
.RS 4n
Controls whether device nodes can be opened on this file system. The default value is "on".
.RE

.sp
.ne 2
.mk
.na
\fBexec=\fIon\fR | \fIoff\fR\fR
.ad
.sp .6
.RS 4n
Controls whether processes can be executed from within this file system. The default value is "on".
.RE

.sp
.ne 2
.mk
.na
\fBsetuid=\fIon\fR | \fIoff\fR\fR
.ad
.sp .6
.RS 4n
Controls whether the set-\fBUID\fR bit is respected for the file system. The default value is "on".
.RE

.sp
.ne 2
.mk
.na
\fBreadonly=\fIon\fR | \fIoff\fR\fR
.ad
.sp .6
.RS 4n
Controls whether this dataset can be modified. The default value is "off".
.sp
This property can also be referred to by its shortened column name, "rdonly".
.RE

.sp
.ne 2
.mk
.na
\fBzoned=\fIon\fR | \fIoff\fR\fR
.ad
.sp .6
.RS 4n
Controls whether the dataset is managed from a non-global zone. See the "Zones" section for more information. The default value is "off".
.RE

.sp
.ne 2
.mk
.na
\fBsnapdir=\fIhidden\fR | \fIvisible\fR\fR
.ad
.sp .6
.RS 4n
Controls whether the ".zfs" directory is hidden or visible in the root of the file system as discussed in the "Snapshots" section. The default value is "hidden".
.RE

.sp
.ne 2
.mk
.na
\fBaclmode=\fBdiscard\fR | \fBgroupmask\fR | \fBpassthrough\fR\fR
.ad
.sp .6
.RS 4n
Controls how an \fBACL\fR is modified during \fBchmod\fR(2). A file system with an "aclmode" property of "\fBdiscard\fR"
deletes all \fBACL\fR entries that do not represent the mode of the file. An "aclmode" property of "\fBgroupmask\fR" (the default) reduces user or group permissions. The permissions are reduced, such that they are no greater than the group permission
bits, unless it is a user entry that has the same \fBUID\fR as the owner of the file or directory. In this case, the \fBACL\fR permissions are reduced so that they are no greater than owner permission bits. A file system with an "aclmode" property of "\fBpassthrough\fR" indicates that no changes will be made to the \fBACL\fR other than generating the necessary \fBACL\fR entries to represent the new mode of the file or directory.
.RE

.sp
.ne 2
.mk
.na
\fBaclinherit=\fBdiscard\fR | \fBnoallow\fR | \fBsecure\fR | \fBpassthrough\fR\fR
.ad
.sp .6
.RS 4n
Controls how \fBACL\fR entries are inherited when files and directories are created. A file system with an "aclinherit" property of "\fBdiscard\fR" does not inherit any \fBACL\fR entries. A file system with an "aclinherit"
property value of "\fBnoallow\fR" only inherits inheritable \fBACL\fR entries that specify "deny" permissions. The property value "\fBsecure\fR" (the default) removes the "\fBwrite_acl\fR" and "\fBwrite_owner\fR" permissions when the \fBACL\fR entry is inherited. A file system with an "aclinherit" property value of "\fBpassthrough\fR" inherits all inheritable \fBACL\fR entries without any modifications made to the \fBACL\fR entries when they are inherited.
.RE

.sp
.ne 2
.mk
.na
\fBcanmount=\fBon\fR | \fBoff\fR\fR
.ad
.sp .6
.RS 4n
If this property is set to "\fBoff\fR", the file system cannot be mounted, and is ignored by "\fBzfs mount -a\fR". This is similar to setting the "mountpoint" property to "\fBnone\fR", except
that the dataset still has a normal "mountpoint" property which can be inherited. This allows datasets to be used solely as a mechanism to inherit properties. One use case is to have two logically separate datasets have the same mountpoint, so that the children of both datasets appear
in the same directory, but may have different inherited characteristics. The default value is "\fBon\fR". 
.sp
This property is not inherited.
.RE

.sp
.ne 2
.mk
.na
\fBxattr=\fBon\fR | \fBoff\fR\fR
.ad
.sp .6
.RS 4n
Controls whether extended attributes are enabled for this file system. The default value is "\fBon\fR".
.RE

.sp
.ne 2
.mk
.na
\fBcopies=\fB1\fR | \fB2\fR | \fB3\fR\fR
.ad
.sp .6
.RS 4n
Controls the number of copies of data stored for this dataset. These copies are in addition to any redundancy provided by the pool, for example, mirroring or raid-z. The copies are stored on different disks, if possible. The space used by multiple copies is charged to the associated
file and dataset, changing the "used" property and counting against quotas and reservations.
.sp
Changing this property only affects newly-written data. Therefore, set this property at file system creation time by using the "\fB-o\fR copies=" option.
.RE

.sp
.ne 2
.mk
.na
\fBjailed=\fIon\fR | \fIoff\fR\fR
.ad
.sp .6
.RS 4n
Controls whether the dataset is managed from within a jail. The default value is "off".
.RE

.SS "iscsioptions"
.LP
This read-only property, which is hidden, is used by the \fBiSCSI\fR target daemon to store persistent information, such as the \fBIQN\fR. It cannot be viewed or modified using the \fBzfs\fR command. The contents are not intended for external consumers.
.SS "Temporary Mount Point Properties"
.LP
When a file system is mounted, either through \fBmount\fR(1M) for legacy mounts or the "\fBzfs mount\fR" command for normal file systems,
its mount options are set according to its properties. The correlation between properties and mount options is as follows:
.sp
.in +2
.nf
    PROPERTY                MOUNT OPTION
    devices                 devices/nodevices
    exec                    exec/noexec
    readonly                ro/rw
    setuid                  setuid/nosetuid
    xattr                   xattr/noxattr
.fi
.in -2
.sp

.LP
In addition, these options can be set on a per-mount basis using the \fB-o\fR option, without affecting the property that is stored on disk. The values specified on the command line override the values stored in the dataset. The \fB-nosuid\fR option is an alias for "nodevices,nosetuid".
These properties are reported as "temporary" by the "\fBzfs get\fR" command. If the properties are changed while the dataset is mounted, the new setting overrides any temporary settings.
.SS "User Properties"
.LP
In addition to the standard native properties, \fBZFS\fR supports arbitrary user properties. User properties have no effect on \fBZFS\fR behavior, but applications or administrators can use them to annotate datasets.
.LP
User property names must contain a colon (":") character, to distinguish them from native properties. They might contain lowercase letters, numbers, and the following punctuation characters: colon (":"), dash ("-"), period ("."), and underscore
("_"). The expected convention is that the property name is divided into two portions such as "\fImodule\fR:\fIproperty\fR", but this namespace is not enforced by \fBZFS\fR. User property names can be at most 256 characters,
and cannot begin with a dash ("-").
.LP
When making programmatic use of user properties, it is strongly suggested to use a reversed \fBDNS\fR domain name for the \fImodule\fR component of property names to reduce the chance that two independently-developed packages use the same property name for
different purposes. Property names beginning with "com.sun." are reserved for use by Sun Microsystems.
.LP
The values of user properties are arbitrary strings, are always inherited, and are never validated. All of the commands that operate on properties ("zfs list", "zfs get", "zfs set", etc.) can be used to manipulate both native properties and user properties.
Use the "\fBzfs inherit\fR" command to clear a user property . If the property is not defined in any parent dataset, it is removed entirely. Property values are limited to 1024 characters.
.SS "Volumes as Swap or Dump Devices"
.LP
To set up a swap area, create a \fBZFS\fR volume of a specific size and then enable swap on that device. For more information, see the EXAMPLES section.
.LP
Do not swap to a file on a \fBZFS\fR file system. A \fBZFS\fR swap file configuration is not supported.
.LP
Using a \fBZFS\fR volume as a dump device is not supported.
.SH SUBCOMMANDS
.LP
All subcommands that modify state are logged persistently to the pool in their original form.
.sp
.ne 2
.mk
.na
\fB\fBzfs ?\fR\fR
.ad
.sp .6
.RS 4n
Displays a help message.
.RE

.sp
.ne 2
.mk
.na
\fB\fBzfs create\fR [[\fB-o\fR property=value]...] \fIfilesystem\fR\fR
.ad
.sp .6
.RS 4n
Creates a new \fBZFS\fR file system. The file system is automatically mounted according to the "mountpoint" property inherited from the parent.
.sp
.ne 2
.mk
.na
\fB\fB-o\fR property=value\fR
.ad
.RS 21n
.rt  
Sets the specified property as if "\fBzfs set property=value\fR" was invoked at the same time the dataset was created. Any editable \fBZFS\fR property can also be set at creation time. Multiple \fB-o\fR options can be specified. An
error results if the same property is specified in multiple \fB-o\fR options.
.RE

.RE

.sp
.ne 2
.mk
.na
\fB\fBzfs create\fR [\fB-s\fR] [\fB-b\fR \fIblocksize\fR] [[\fB-o\fR property=value]...] \fB-V\fR \fIsize\fR \fIvolume\fR\fR
.ad
.sp .6
.RS 4n
Creates a volume of the given size. The volume is exported as a block device in \fB/dev/zvol/{dsk,rdsk}/\fIpath\fR\fR, where \fIpath\fR is the name of the volume in the \fBZFS\fR namespace. The size represents
the logical size as exported by the device. By default, a reservation of equal size is created.
.sp
\fIsize\fR is automatically rounded up to the nearest 128 Kbytes to ensure that the volume has an integral number of blocks regardless of \fIblocksize\fR.
.sp
.ne 2
.mk
.na
\fB\fB-s\fR\fR
.ad
.RS 21n
.rt  
Creates a sparse volume with no reservation. See "volsize" in the Native Properties section for more information about sparse volumes.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-o\fR property=value\fR
.ad
.RS 21n
.rt  
Sets the specified property as if "\fBzfs set property=value\fR" was invoked at the same time the dataset was created. Any editable \fBZFS\fR property can also be set at creation time. Multiple \fB-o\fR options can be specified. An
error results if the same property is specified in multiple \fB-o\fR options.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-b\fR \fIblocksize\fR\fR
.ad
.RS 21n
.rt  
Equivalent to "\fB\fR\fB-o\fR \fBvolblocksize=\fIblocksize\fR\fR". If this option is specified in conjunction with "\fB\fR\fB-o\fR \fBvolblocksize\fR", the resulting
behavior is undefined.
.RE

.RE

.sp
.ne 2
.mk
.na
\fB\fBzfs destroy\fR [\fB-rRf\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
.ad
.sp .6
.RS 4n
Destroys the given dataset. By default, the command unshares any file systems that are currently shared, unmounts any file systems that are currently mounted, and refuses to destroy a dataset that has active dependents (children, snapshots, clones).
.sp
.ne 2
.mk
.na
\fB\fB-r\fR\fR
.ad
.RS 6n
.rt  
Recursively destroy all children. If a snapshot is specified, destroy all snapshots with this name in descendant file systems.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-R\fR\fR
.ad
.RS 6n
.rt  
Recursively destroy all dependents, including cloned file systems outside the target hierarchy. If a snapshot is specified, destroy all snapshots with this name in descendant file systems.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-f\fR\fR
.ad
.RS 6n
.rt  
Force an unmount of any file systems using the "\fBunmount -f\fR" command. This option has no effect on non-file systems or unmounted file systems.
.RE

Extreme care should be taken when applying either the \fB-r\fR or the \fB-f\fR options, as they can destroy large portions of a pool and cause unexpected behavior for mounted file systems in use. 
.RE

.sp
.ne 2
.mk
.na
\fB\fBzfs clone\fR \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR\fR
.ad
.sp .6
.RS 4n
Creates a clone of the given snapshot. See the "Clones" section for details. The target dataset can be located anywhere in the \fBZFS\fR hierarchy, and is created as the same type as the original.
.RE

.sp
.ne 2
.mk
.na
\fB\fBzfs promote\fR \fIfilesystem\fR\fR
.ad
.sp .6
.RS 4n
Promotes a clone file system to no longer be dependent on its "origin" snapshot. This makes it possible to destroy the file system that the clone was created from. The clone parent-child dependency relationship is reversed, so that the "origin" file system
becomes a clone of the specified file system. 
.sp
The snaphot that was cloned, and any snapshots previous to this snapshot, are now owned by the promoted clone. The space they use moves from the "origin" file system to the promoted clone, so enough space must be available to accommodate these snapshots. No new space is consumed
by this operation, but the space accounting is adjusted. The promoted clone must not have any conflicting snapshot names of its own. The "\fBrename\fR" subcommand can be used to rename any conflicting snapshots.
.RE

.sp
.ne 2
.mk
.na
\fB\fBzfs rename\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
.ad
.sp .6
.RS 4n
Renames the given dataset. The new target can be located anywhere in the \fBZFS\fR hierarchy, with the exception of snapshots. Snapshots can only be renamed within the parent file system or volume. When renaming a snapshot, the parent file system of the snapshot does
not need to be specified as part of the second argument. Renamed file systems can inherit new mount points, in which case they are unmounted and remounted at the new mount point.
.RE

.sp
.ne 2
.mk
.na
\fB\fBzfs snapshot\fR [\fB-r\fR] \fIfilesystem@name\fR|\fIvolume@name\fR\fR
.ad
.sp .6
.RS 4n
Creates a snapshot with the given name. See the "Snapshots" section for details.
.sp
.ne 2
.mk
.na
\fB\fB-r\fR\fR
.ad
.RS 6n
.rt  
Recursively create snapshots of all descendant datasets. Snapshots are taken atomically, so that all recursive snapshots correspond to the same moment in time.
.RE

.RE

.sp
.ne 2
.mk
.na
\fB\fBzfs rollback\fR [\fB-rRf\fR] \fIsnapshot\fR\fR
.ad
.sp .6
.RS 4n
Roll back the given dataset to a previous snapshot. When a dataset is rolled back, all data that has changed since the snapshot is discarded, and the dataset reverts to the state at the time of the snapshot. By default, the command refuses to roll back to a snapshot other than
the most recent one. In order to do so, all intermediate snapshots must be destroyed by specifying the \fB-r\fR option. The file system is unmounted and remounted, if necessary.
.sp
.ne 2
.mk
.na
\fB\fB-r\fR\fR
.ad
.RS 6n
.rt  
Recursively destroy any snapshots more recent than the one specified.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-R\fR\fR
.ad
.RS 6n
.rt  
Recursively destroy any more recent snapshots, as well as any clones of those snapshots.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-f\fR\fR
.ad
.RS 6n
.rt  
Force an unmount of any file systems using the "\fBunmount -f\fR" command. 
.RE

.RE

.sp
.ne 2
.mk
.na
\fB\fBzfs\fR \fBlist\fR [\fB-rH\fR] [\fB-o\fR \fIprop\fR[,\fIprop\fR] ]... [ \fB-t\fR \fItype\fR[,\fItype\fR]...] [ \fB-s\fR \fIprop\fR [\fB-s\fR \fIprop\fR]... [ \fB-S\fR \fIprop\fR [\fB-S\fR \fIprop\fR]... [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR|\fI/pathname\fR|.\fI/pathname\fR ...\fR
.ad
.sp .6
.RS 4n
Lists the property information for the given datasets in tabular form. If specified, you can list property information by the absolute pathname or the relative pathname. By default, all datasets are displayed and contain the following fields:
.sp
.in +2
.nf
name,used,available,referenced,mountpoint
.fi
.in -2
.sp

.sp
.ne 2
.mk
.na
\fB\fB-H\fR\fR
.ad
.RS 11n
.rt  
Used for scripting mode. Do not print headers and separate fields by a single tab instead of arbitrary whitespace.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-r\fR\fR
.ad
.RS 11n
.rt  
Recursively display any children of the dataset on the command line. 
.RE

.sp
.ne 2
.mk
.na
\fB\fB-o\fR \fIprop\fR\fR
.ad
.RS 11n
.rt  
A comma-separated list of properties to display. The property must be one of the properties described in the "Native Properties" section, or the special value "name" to display the dataset name.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-s\fR \fIprop\fR\fR
.ad
.RS 11n
.rt  
A property to use for sorting the output by column in ascending order based on the value of the property. The property must be one of the properties described in the "Properties" section, or the special value "name" to sort by the dataset name. Multiple
properties can be specified at one time using multiple \fB-s\fR property options. Multiple \fB-s\fR options are evaluated from left to right in decreasing order of importance. 
.sp
The following is a list of sorting criteria:
.RS +4
.TP
.ie t \(bu
.el o
Numeric types sort in numeric order.
.RE
.RS +4
.TP
.ie t \(bu
.el o
String types sort in alphabetical order.
.RE
.RS +4
.TP
.ie t \(bu
.el o
Types inappropriate for a row sort that row to the literal bottom, regardless of the specified ordering.
.RE
.RS +4
.TP
.ie t \(bu
.el o
If no sorting options are specified the existing behavior of "\fBzfs list\fR" is preserved.
.RE
.RE

.sp
.ne 2
.mk
.na
\fB\fB-S\fR \fIprop\fR\fR
.ad
.RS 11n
.rt  
Same as the \fB-s\fR option, but sorts by property in descending order. 
.RE

.sp
.ne 2
.mk
.na
\fB\fB-t\fR \fItype\fR\fR
.ad
.RS 11n
.rt  
A comma-separated list of types to display, where "type" is one of "filesystem", "snapshot" or "volume". For example, specifying "\fB-t snapshot\fR" displays only snapshots.
.RE

.RE

.sp
.ne 2
.mk
.na
\fB\fBzfs set\fR \fIproperty\fR=\fIvalue\fR \fIfilesystem\fR|\fIvolume\fR ...\fR
.ad
.sp .6
.RS 4n
Sets the property to the given value for each dataset. Only some properties can be edited. See the "Properties" section for more information on what properties can be set and acceptable values. Numeric values can be specified as exact values, or in a human-readable
form with a suffix of "B", "K", "M", "G", "T", "P", "E", "Z" (for bytes, Kbytes, Mbytes, gigabytes, terabytes, petabytes, exabytes, or zettabytes, respectively). Properties cannot be set on snapshots.
.RE

.sp
.ne 2
.mk
.na
\fB\fBzfs get\fR [\fB-rHp\fR] [\fB-o\fR \fIfield\fR[,\fIfield\fR]...] [\fB-s\fR \fIsource\fR[,\fIsource\fR]...] \fIall\fR | \fIproperty\fR[,\fIproperty\fR]... \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...\fR
.ad
.sp .6
.RS 4n
Displays properties for the given datasets. If no datasets are specified, then the command displays properties for all datasets on the system. For each property, the following columns are displayed:
.sp
.in +2
.nf
    name      Dataset name
    property  Property name
    value     Property value
    source    Property source. Can either be local, default,
              temporary, inherited, or none (-).
.fi
.in -2
.sp

All columns are displayed by default, though this can be controlled by using the \fB-o\fR option. This command takes a comma-separated list of properties as described in the "Native Properties" and "User Properties" sections.
.sp
The special value "all" can be used to display all properties for the given dataset.
.sp
.ne 2
.mk
.na
\fB\fB-r\fR\fR
.ad
.RS 13n
.rt  
Recursively display properties for any children.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-H\fR\fR
.ad
.RS 13n
.rt  
Display output in a form more easily parsed by scripts. Any headers are omitted, and fields are explicitly separated by a single tab instead of an arbitrary amount of space.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-o\fR \fIfield\fR\fR
.ad
.RS 13n
.rt  
A comma-separated list of columns to display. "name,property,value,source" is the default value. 
.RE

.sp
.ne 2
.mk
.na
\fB\fB-s\fR \fIsource\fR\fR
.ad
.RS 13n
.rt  
A comma-separated list of sources to display. Those properties coming from a source other than those in this list are ignored. Each source must be one of the following: "local,default,inherited,temporary,none". The default value is all sources.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-p\fR\fR
.ad
.RS 13n
.rt  
Display numbers in parsable (exact) values.
.RE

.RE

.sp
.ne 2
.mk
.na
\fB\fBzfs inherit\fR [\fB-r\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume\fR ...\fR
.ad
.sp .6
.RS 4n
Clears the specified property, causing it to be inherited from an ancestor. If no ancestor has the property set, then the default value is used. See the "Properties" section for a listing of default values, and details on which properties can be inherited.
.sp
.ne 2
.mk
.na
\fB\fB-r\fR\fR
.ad
.RS 6n
.rt  
Recursively inherit the given property for all children.
.RE

.RE

.sp
.ne 2
.mk
.na
\fB\fBzfs mount\fR\fR
.ad
.sp .6
.RS 4n
Displays all \fBZFS\fR file systems currently mounted.
.RE

.sp
.ne 2
.mk
.na
\fB\fBzfs mount\fR[\fB-o\fR \fIopts\fR] [\fB-O\fR] \fB-a\fR\fR
.ad
.sp .6
.RS 4n
Mounts all available \fBZFS\fR file systems. Invoked automatically as part of the boot process.
.sp
.ne 2
.mk
.na
\fB\fB-o\fR \fIopts\fR\fR
.ad
.RS 11n
.rt  
An optional comma-separated list of mount options to use temporarily for the duration of the mount. See the "Temporary Mount Point Properties" section for details.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-O\fR\fR
.ad
.RS 11n
.rt  
Perform an overlay mount. See \fBmount\fR(1M) for more information.
.RE

.RE

.sp
.ne 2
.mk
.na
\fB\fBzfs mount\fR [\fB-o\fR \fIopts\fR] [\fB-O\fR] \fIfilesystem\fR\fR
.ad
.sp .6
.RS 4n
Mounts a specific \fBZFS\fR file system. This is typically not necessary, as file systems are automatically mounted when they are created or the mountpoint property has changed. See the "Mount Points" section for details.
.sp
.ne 2
.mk
.na
\fB\fB-o\fR \fIopts\fR\fR
.ad
.RS 11n
.rt  
An optional comma-separated list of mount options to use temporarily for the duration of the mount. See the "Temporary Mount Point Properties" section for details.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-O\fR\fR
.ad
.RS 11n
.rt  
Perform an overlay mount. See \fBmount\fR(1M) for more information.
.RE

.RE

.sp
.ne 2
.mk
.na
\fB\fBzfs unmount\fR \fB-a\fR\fR
.ad
.sp .6
.RS 4n
Unmounts all currently mounted \fBZFS\fR file systems. Invoked automatically as part of the shutdown process.
.RE

.sp
.ne 2
.mk
.na
\fB\fBzfs unmount\fR [\fB-f\fR] \fIfilesystem\fR|\fImountpoint\fR\fR
.ad
.sp .6
.RS 4n
Unmounts the given file system. The command can also be given a path to a \fBZFS\fR file system mount point on the system.
.sp
.ne 2
.mk
.na
\fB\fB-f\fR\fR
.ad
.RS 6n
.rt  
Forcefully unmount the file system, even if it is currently in use.
.RE

.RE

.sp
.ne 2
.mk
.na
\fB\fBzfs share\fR \fB-a\fR\fR
.ad
.sp .6
.RS 4n
Shares all available \fBZFS\fR file systems. This is invoked automatically as part of the boot process.
.RE

.sp
.ne 2
.mk
.na
\fB\fBzfs share\fR \fIfilesystem\fR\fR
.ad
.sp .6
.RS 4n
Shares a specific \fBZFS\fR file system according to the "sharenfs" property. File systems are shared when the "sharenfs" property is set.
.RE

.sp
.ne 2
.mk
.na
\fB\fBzfs unshare\fR \fB-a\fR\fR
.ad
.sp .6
.RS 4n
Unshares all currently shared \fBZFS\fR file systems. This is invoked automatically as part of the shutdown process.
.RE

.sp
.ne 2
.mk
.na
\fB\fBzfs unshare\fR [\fB-F\fR] \fIfilesystem\fR|\fImountpoint\fR\fR
.ad
.sp .6
.RS 4n
Unshares the given file system. The command can also be given a path to a \fBZFS\fR file system shared on the system.
.sp
.ne 2
.mk
.na
\fB\fB-F\fR\fR
.ad
.RS 6n
.rt  
Forcefully unshare the file system, even if it is currently in use.
.RE

.RE

.sp
.ne 2
.mk
.na
\fB\fBzfs send\fR [\fB-i\fR \fIsnapshot1\fR] \fIsnapshot2\fR\fR
.ad
.sp .6
.RS 4n
Creates a stream representation of snapshot2, which is written to standard output. The output can be redirected to a file or to a different system (for example, using \fBssh\fR(1). By default, a full stream is generated.
.sp
.ne 2
.mk
.na
\fB\fB-i\fR \fIsnapshot1\fR\fR
.ad
.RS 16n
.rt  
Generate an incremental stream from \fIsnapshot1\fR to \fIsnapshot2\fR. The incremental source \fIsnapshot1\fR can be specified as the last component of the snapshot name (for example, the part after the "@"),
and it is assumed to be from the same file system as \fIsnapshot2\fR.
.RE

.RE

.LP
The format of the stream is evolving. No backwards compatibility is guaranteed. You may not be able to receive your streams on future versions of \fBZFS\fR.
.sp
.ne 2
.mk
.na
\fB\fBzfs receive\fR [\fB-vnF\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
.ad
.br
.na
\fB\fBzfs receive\fR [\fB-vnF\fR] \fB-d\fR \fIfilesystem\fR\fR
.ad
.sp .6
.RS 4n
Creates a snapshot whose contents are as specified in the stream provided on standard input. If a full stream is received, then a new file system is created as well. Streams are created using the "\fBzfs send\fR" subcommand, which by default creates a full
stream. "\fBzfs recv\fR" can be used as an alias for "\fBzfs receive\fR".
.sp
If an incremental stream is received, then the destination file system must already exist, and its most recent snapshot must match the incremental stream's source. The destination file system and all of its child file systems are unmounted and cannot be accessed during the receive operation.
.sp
The name of the snapshot (and file system, if a full stream is received) that this subcommand creates depends on the argument type and the \fB-d\fR option.
.sp
If the argument is a snapshot name, the specified \fIsnapshot\fR is created. If the argument is a file system or volume name, a snapshot with the same name as the sent snapshot is created within the specified \fIfilesystem\fR or \fIvolume\fR.
If the \fB-d\fR option is specified, the snapshot name is determined by appending the sent snapshot's name to the specified \fIfilesystem\fR. If the \fB-d\fR option is specified, any required file systems within the specified one are created.
.sp
.ne 2
.mk
.na
\fB\fB-d\fR\fR
.ad
.RS 6n
.rt  
Use the name of the sent snapshot to determine the name of the new snapshot as described in the paragraph above.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-v\fR\fR
.ad
.RS 6n
.rt  
Print verbose information about the stream and the time required to perform the receive operation.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-n\fR\fR
.ad
.RS 6n
.rt  
Do not actually receive the stream. This can be useful in conjunction with the \fB-v\fR option to determine what name the receive operation would use.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-F\fR\fR
.ad
.RS 6n
.rt  
Force a rollback of the \fIfilesystem\fR to the most recent snapshot before performing the receive operation.
.RE

.RE

.sp
.ne 2
.mk
.na
\fB\fBzfs jail\fR \fIjailid\fR \fIfilesystem\fR\fR
.ad
.sp .6
.RS 4n
Attaches the given file system to the given jail. From now on this file system tree can be managed from within a jail if the "\fBjailed\fR" property has been set.
To use this functionality, sysctl \fBsecurity.jail.enforce_statfs\fR should be set to 0 and sysctl \fBsecurity.jail.mount_allowed\fR should be set to 1.
.RE

.sp
.ne 2
.mk
.na
\fB\fBzfs unjail\fR \fIjailid\fR \fIfilesystem\fR\fR
.ad
.sp .6
.RS 4n
Detaches the given file system from the given jail.
.RE

.SH EXAMPLES
.LP
\fBExample 1 \fRCreating a ZFS File System Hierarchy
.LP
The following commands create a file system named "\fBpool/home\fR" and a file system named "\fBpool/home/bob\fR". The mount point "\fB/export/home\fR" is set for the parent file system, and automatically inherited
by the child file system.

.sp
.in +2
.nf
# zfs create pool/home
# zfs set mountpoint=/export/home pool/home
# zfs create pool/home/bob
.fi
.in -2
.sp

.LP
\fBExample 2 \fRCreating a ZFS Snapshot
.LP
The following command creates a snapshot named "yesterday". This snapshot is mounted on demand in the ".zfs/snapshot" directory at the root of the "\fBpool/home/bob\fR" file system.

.sp
.in +2
.nf
# zfs snapshot pool/home/bob@yesterday
.fi
.in -2
.sp

.LP
\fBExample 3 \fRTaking and destroying multiple snapshots
.LP
The following command creates snapshots named "\fByesterday\fR" of "\fBpool/home\fR" and all of its descendant file systems. Each snapshot is mounted on demand in the ".zfs/snapshot" directory at the root of its file system. The
second command destroys the newly created snapshots.

.sp
.in +2
.nf
# \fBzfs snapshot -r pool/home@yesterday\fR
\fB# zfs destroy -r pool/home@yesterday\fR
.fi
.in -2
.sp

.LP
\fBExample 4 \fRTurning Off Compression
.LP
The following commands turn compression off for all file systems under "\fBpool/home\fR", but explicitly turns it on for "\fBpool/home/anne\fR".

.sp
.in +2
.nf
\fB# zfs set compression=off pool/home
# zfs set compression=on pool/home/anne\fR
.fi
.in -2
.sp

.LP
\fBExample 5 \fRListing ZFS Datasets
.LP
The following command lists all active file systems and volumes in the system.

.sp
.in +2
.nf
\fB# zfs list\fR


  NAME                      USED  AVAIL  REFER  MOUNTPOINT
  pool                      100G   60G       -  /pool
  pool/home                 100G   60G       -  /export/home
  pool/home/bob              40G   60G     40G  /export/home/bob
  pool/home/bob@yesterday     3M     -     40G  -
  pool/home/anne             60G   60G     40G  /export/home/anne
.fi
.in -2
.sp

.LP
\fBExample 6 \fRSetting a Quota on a ZFS File System
.LP
The following command sets a quota of 50 gbytes for "\fBpool/home/bob\fR".

.sp
.in +2
.nf
\fB# zfs set quota=50G pool/home/bob\fR
.fi
.in -2
.sp

.LP
\fBExample 7 \fRListing ZFS Properties
.LP
The following command lists all properties for "\fBpool/home/bob\fR".

.sp
.in +2
.nf
\fB# zfs get all pool/home/bob\fR


  NAME           PROPERTY       VALUE                  SOURCE
  pool/home/bob  type           filesystem             -
  pool/home/bob  creation       Fri Feb 23 14:20 2007  -
  pool/home/bob  used           24.5K                  -
  pool/home/bob  available      50.0G                  -
  pool/home/bob  referenced     24.5K                  -
  pool/home/bob  compressratio  1.00x                  -
  pool/home/bob  mounted        yes                    -
  pool/home/bob  quota          50G                    local
  pool/home/bob  reservation    none                   default
  pool/home/bob  recordsize     128K                   default
  pool/home/bob  mountpoint     /pool/home/bob         default
  pool/home/bob  sharenfs       off                    default
  pool/home/bob  shareiscsi     off                    default
  pool/home/bob  checksum       on                     default
  pool/home/bob  compression    off                    default
  pool/home/bob  atime          on                     default
  pool/home/bob  devices        on                     default
  pool/home/bob  exec           on                     default
  pool/home/bob  setuid         on                     default
  pool/home/bob  readonly       off                    default
  pool/home/bob  zoned          off                    default
  pool/home/bob  snapdir        hidden                 default
  pool/home/bob  aclmode        groupmask              default
  pool/home/bob  aclinherit     secure                 default
  pool/home/bob  canmount       on                     default
  pool/home/bob  xattr          on                     default

   
.fi
.in -2
.sp

.LP
The following command gets a single property value.

.sp
.in +2
.nf
\fB# zfs get -H -o value compression pool/home/bob\fR
on
.fi
.in -2
.sp

.LP
The following command lists all properties with local settings for "\fBpool/home/bob\fR".

.sp
.in +2
.nf
\fB# zfs get -r -s local -o name,property,value all pool/home/bob\fR

  NAME             PROPERTY      VALUE
  pool             compression   on
  pool/home        checksum      off
.fi
.in -2
.sp

.LP
\fBExample 8 \fRRolling Back a ZFS File System
.LP
The following command reverts the contents of "\fBpool/home/anne\fR" to the snapshot named "\fByesterday\fR", deleting all intermediate snapshots.

.sp
.in +2
.nf
\fB# zfs rollback -r pool/home/anne@yesterday\fR
.fi
.in -2
.sp

.LP
\fBExample 9 \fRCreating a ZFS Clone
.LP
The following command creates a writable file system whose initial contents are the same as "\fBpool/home/bob@yesterday\fR".

.sp
.in +2
.nf
\fB# zfs clone pool/home/bob@yesterday pool/clone\fR
.fi
.in -2
.sp

.LP
\fBExample 10 \fRPromoting a ZFS Clone
.LP
The following commands illustrate how to test out changes to a file system, and then replace the original file system with the changed one, using clones, clone promotion, and renaming:

.sp
.in +2
.nf
\fB# zfs create pool/project/production\fR
 populate /pool/project/production with data
\fB# zfs snapshot pool/project/production@today
# zfs clone pool/project/production@today pool/project/beta\fR
 make changes to /pool/project/beta and test them
\fB# zfs promote pool/project/beta
# zfs rename pool/project/production pool/project/legacy
# zfs rename pool/project/beta pool/project/production\fR
 once the legacy version is no longer needed, it can be
 destroyed
\fB# zfs destroy pool/project/legacy\fR
.fi
.in -2
.sp

.LP
\fBExample 11 \fRInheriting ZFS Properties
.LP
The following command causes "\fBpool/home/bob\fR" and "\fBpool/home/anne\fR" to inherit the "checksum" property from their parent.

.sp
.in +2
.nf
\fB# zfs inherit checksum pool/home/bob pool/home/anne\fR
.fi
.in -2
.sp

.LP
\fBExample 12 \fRRemotely Replicating ZFS Data
.LP
The following commands send a full stream and then an incremental stream to a remote machine, restoring them into "\fBpoolB/received/fs\fR@a" and "\fBpoolB/received/fs@b\fR", respectively. "\fBpoolB\fR" must contain
the file system "\fBpoolB/received\fR", and must not initially contain "\fBpoolB/received/fs\fR".

.sp
.in +2
.nf
# zfs send pool/fs@a | \e
  ssh host zfs receive poolB/received/fs@a
# zfs send -i a pool/fs@b | ssh host \e
  zfs receive poolB/received/fs
.fi
.in -2
.sp

.LP
\fBExample 13 \fRUsing the  zfs receive -d Option
.LP
The following command sends a full stream of "\fBpoolA/fsA/fsB@snap\fR" to a remote machine, receiving it into "\fBpoolB/received/fsA/fsB@snap\fR". The "\fBfsA/fsB@snap\fR" portion of the received snapshot's name
is determined from the name of the sent snapshot. "\fBpoolB\fR" must contain the file system "\fBpoolB/received\fR".  If  "\fBpoolB/received/fsA\fR" does not exist, it will be created as an empty file system.

.sp
.in +2
.nf
\fB# zfs send poolA/fsA/fsB@snap | \e
  ssh host zfs receive -d poolB/received
   \fR
.fi
.in -2
.sp

.LP
\fBExample 14 \fRCreating a ZFS volume as a Swap Device
.LP
The following example shows how to create a 5-Gbyte ZFS volume and then add the volume as a swap device.

.sp
.in +2
.nf
\fB# zfs create  -V 5gb tank/vol
# swap -a /dev/zvol/dsk/tank/vol\fR
.fi
.in -2
.sp

.LP
\fBExample 15 \fRSetting User Properties
.LP
The following example sets the user defined "com.example:department" property for a dataset.

.sp
.in +2
.nf
\fB# zfs set com.example:department=12345 tank/accounting\fR
.fi
.in -2
.sp

.LP
\fBExample 16 \fRCreating a ZFS Volume as a iSCSI Target Device
.LP
The following example shows how to create a \fBZFS\fR volume as an \fBiSCSI\fR target. 

.sp
.in +2
.nf
\fB# zfs create -V 2g pool/volumes/vol1
# zfs set shareiscsi=on pool/volumes/vol1
# iscsitadm list target\fR
Target: pool/volumes/vol1
iSCSI Name: 
iqn.1986-03.com.sun:02:7b4b02a6-3277-eb1b-e686-a24762c52a8c
Connections: 0
.fi
.in -2
.sp

.LP
After the \fBiSCSI\fR target is created, set up the \fBiSCSI\fR initiator. For more information about the Solaris \fBiSCSI\fR initiator, see the Solaris Administration Guide: Devices and File Systems.
.SH EXIT STATUS
.LP
The following exit values are returned:
.sp
.ne 2
.mk
.na
\fB\fB0\fR\fR
.ad
.RS 5n
.rt  
Successful completion. 
.RE

.sp
.ne 2
.mk
.na
\fB\fB1\fR\fR
.ad
.RS 5n
.rt  
An error occurred.
.RE

.sp
.ne 2
.mk
.na
\fB\fB2\fR\fR
.ad
.RS 5n
.rt  
Invalid command line options were specified.
.RE

.SH ATTRIBUTES
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
tab() box;
cw(2.75i) |cw(2.75i) 
lw(2.75i) |lw(2.75i) 
.
ATTRIBUTE TYPEATTRIBUTE VALUE
_
AvailabilitySUNWzfsu
_
Interface StabilityEvolving
.TE

.SH SEE ALSO
.LP
\fBgzip\fR(1), \fBssh\fR(1), \fBmount\fR(1M), \fBshare\fR(1M), \fBunshare\fR(1M), \fBzonecfg\fR(1M), \fBzpool\fR(1M), \fBchmod\fR(2), \fBstat\fR(2), \fBfsync\fR(3c), \fBdfstab\fR(4), \fBattributes\fR(5)
OpenPOWER on IntegriCloud