xref: /freebsd/sys/contrib/openzfs/man/man8/zstream.8 (revision a0b956f5ac5e0941f9e74e24c1c53e05ad061a38)
1eda14cbcSMatt Macy.\"
2eda14cbcSMatt Macy.\" CDDL HEADER START
3eda14cbcSMatt Macy.\"
4eda14cbcSMatt Macy.\" The contents of this file are subject to the terms of the
5eda14cbcSMatt Macy.\" Common Development and Distribution License (the "License").
6eda14cbcSMatt Macy.\" You may not use this file except in compliance with the License.
7eda14cbcSMatt Macy.\"
8eda14cbcSMatt Macy.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9eda14cbcSMatt Macy.\" or http://www.opensolaris.org/os/licensing.
10eda14cbcSMatt Macy.\" See the License for the specific language governing permissions
11eda14cbcSMatt Macy.\" and limitations under the License.
12eda14cbcSMatt Macy.\"
13eda14cbcSMatt Macy.\" When distributing Covered Code, include this CDDL HEADER in each
14eda14cbcSMatt Macy.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15eda14cbcSMatt Macy.\" If applicable, add the following below this CDDL HEADER, with the
16eda14cbcSMatt Macy.\" fields enclosed by brackets "[]" replaced with your own identifying
17eda14cbcSMatt Macy.\" information: Portions Copyright [yyyy] [name of copyright owner]
18eda14cbcSMatt Macy.\"
19eda14cbcSMatt Macy.\" CDDL HEADER END
20eda14cbcSMatt Macy.\"
21eda14cbcSMatt Macy.\" Copyright (c) 2020 by Delphix. All rights reserved.
2216038816SMartin Matuska.\"
23*a0b956f5SMartin Matuska.Dd March 25, 2022
24eda14cbcSMatt Macy.Dt ZSTREAM 8
25eda14cbcSMatt Macy.Os
2616038816SMartin Matuska.
27eda14cbcSMatt Macy.Sh NAME
28eda14cbcSMatt Macy.Nm zstream
2916038816SMartin Matuska.Nd manipulate ZFS send streams
30eda14cbcSMatt Macy.Sh SYNOPSIS
31eda14cbcSMatt Macy.Nm
32eda14cbcSMatt Macy.Cm dump
33eda14cbcSMatt Macy.Op Fl Cvd
34eda14cbcSMatt Macy.Op Ar file
35eda14cbcSMatt Macy.Nm
36*a0b956f5SMartin Matuska.Cm decompress
37*a0b956f5SMartin Matuska.Op Fl v
38*a0b956f5SMartin Matuska.Op Ar object Ns Sy \&, Ns Ar offset Ns Op Sy \&, Ns Ar type Ns ...
39*a0b956f5SMartin Matuska.Nm
40eda14cbcSMatt Macy.Cm redup
41eda14cbcSMatt Macy.Op Fl v
42eda14cbcSMatt Macy.Ar file
43eda14cbcSMatt Macy.Nm
44eda14cbcSMatt Macy.Cm token
45eda14cbcSMatt Macy.Ar resume_token
4616038816SMartin Matuska.
47eda14cbcSMatt Macy.Sh DESCRIPTION
48eda14cbcSMatt MacyThe
49eda14cbcSMatt Macy.Sy zstream
5016038816SMartin Matuskautility manipulates ZFS send streams output by the
51eda14cbcSMatt Macy.Sy zfs send
52eda14cbcSMatt Macycommand.
53eda14cbcSMatt Macy.Bl -tag -width ""
54eda14cbcSMatt Macy.It Xo
55eda14cbcSMatt Macy.Nm
56eda14cbcSMatt Macy.Cm dump
57eda14cbcSMatt Macy.Op Fl Cvd
58eda14cbcSMatt Macy.Op Ar file
59eda14cbcSMatt Macy.Xc
60eda14cbcSMatt MacyPrint information about the specified send stream, including headers and
61eda14cbcSMatt Macyrecord counts.
62eda14cbcSMatt MacyThe send stream may either be in the specified
63eda14cbcSMatt Macy.Ar file ,
64eda14cbcSMatt Macyor provided on standard input.
65eda14cbcSMatt Macy.Bl -tag -width "-D"
66eda14cbcSMatt Macy.It Fl C
67eda14cbcSMatt MacySuppress the validation of checksums.
68eda14cbcSMatt Macy.It Fl v
69eda14cbcSMatt MacyVerbose.
70eda14cbcSMatt MacyPrint metadata for each record.
71eda14cbcSMatt Macy.It Fl d
72eda14cbcSMatt MacyDump data contained in each record.
73eda14cbcSMatt MacyImplies verbose.
74eda14cbcSMatt Macy.El
7516038816SMartin Matuska.Pp
7616038816SMartin MatuskaThe
7716038816SMartin Matuska.Nm zstreamdump
7816038816SMartin Matuskaalias is provided for compatibility and is equivalent to running
7916038816SMartin Matuska.Nm
8016038816SMartin Matuska.Cm dump .
81eda14cbcSMatt Macy.It Xo
82eda14cbcSMatt Macy.Nm
83eda14cbcSMatt Macy.Cm token
84eda14cbcSMatt Macy.Ar resume_token
85eda14cbcSMatt Macy.Xc
86eda14cbcSMatt MacyDumps zfs resume token information
87eda14cbcSMatt Macy.It Xo
88eda14cbcSMatt Macy.Nm
89*a0b956f5SMartin Matuska.Cm decompress
90*a0b956f5SMartin Matuska.Op Fl v
91*a0b956f5SMartin Matuska.Op Ar object Ns Sy \&, Ns Ar offset Ns Op Sy \&, Ns Ar type Ns ...
92*a0b956f5SMartin Matuska.Xc
93*a0b956f5SMartin MatuskaDecompress selected records in a ZFS send stream provided on standard input,
94*a0b956f5SMartin Matuskawhen the compression type recorded in ZFS metadata may be incorrect.
95*a0b956f5SMartin MatuskaSpecify the object number and byte offset of each record that you wish to
96*a0b956f5SMartin Matuskadecompress.
97*a0b956f5SMartin MatuskaOptionally specify the compression type.
98*a0b956f5SMartin MatuskaValid compression types include
99*a0b956f5SMartin Matuska.Sy gzip ,
100*a0b956f5SMartin Matuska.Sy lz4 ,
101*a0b956f5SMartin Matuska.Sy lzjb ,
102*a0b956f5SMartin Matuska.Sy zstd ,
103*a0b956f5SMartin Matuskaand
104*a0b956f5SMartin Matuska.Sy zle .
105*a0b956f5SMartin MatuskaThe default is
106*a0b956f5SMartin Matuska.Sy lz4 .
107*a0b956f5SMartin MatuskaEvery record for that object beginning at that offset will be decompressed, if
108*a0b956f5SMartin Matuskapossible.
109*a0b956f5SMartin MatuskaIt may not be possible, because the record may be corrupted in some but not
110*a0b956f5SMartin Matuskaall of the stream's snapshots.
111*a0b956f5SMartin MatuskaThe repaired stream will be written to standard output.
112*a0b956f5SMartin Matuska.Bl -tag -width "-v"
113*a0b956f5SMartin Matuska.It Fl v
114*a0b956f5SMartin MatuskaVerbose.
115*a0b956f5SMartin MatuskaPrint summary of decompressed records.
116*a0b956f5SMartin Matuska.El
117*a0b956f5SMartin Matuska.It Xo
118*a0b956f5SMartin Matuska.Nm
119eda14cbcSMatt Macy.Cm redup
120eda14cbcSMatt Macy.Op Fl v
121eda14cbcSMatt Macy.Ar file
122eda14cbcSMatt Macy.Xc
123eda14cbcSMatt MacyDeduplicated send streams can be generated by using the
124eda14cbcSMatt Macy.Nm zfs Cm send Fl D
125eda14cbcSMatt Macycommand.
126eda14cbcSMatt MacyThe ability to send deduplicated send streams is deprecated.
127eda14cbcSMatt MacyIn the future, the ability to receive a deduplicated send stream with
128eda14cbcSMatt Macy.Nm zfs Cm receive
129eda14cbcSMatt Macywill be removed.
130eda14cbcSMatt MacyHowever, deduplicated send streams can still be received by utilizing
131eda14cbcSMatt Macy.Nm zstream Cm redup .
132eda14cbcSMatt Macy.Pp
133eda14cbcSMatt MacyThe
134eda14cbcSMatt Macy.Nm zstream Cm redup
135eda14cbcSMatt Macycommand is provided a
136eda14cbcSMatt Macy.Ar file
137eda14cbcSMatt Macycontaining a deduplicated send stream, and outputs an equivalent
138eda14cbcSMatt Macynon-deduplicated send stream on standard output.
139eda14cbcSMatt MacyTherefore, a deduplicated send stream can be received by running:
14016038816SMartin Matuska.Dl # Nm zstream Cm redup Pa DEDUP_STREAM_FILE | Nm zfs Cm receive No …
141eda14cbcSMatt Macy.Bl -tag -width "-D"
142eda14cbcSMatt Macy.It Fl v
143eda14cbcSMatt MacyVerbose.
144eda14cbcSMatt MacyPrint summary of converted records.
14516038816SMartin Matuska.El
14616038816SMartin Matuska.El
14716038816SMartin Matuska.
148*a0b956f5SMartin Matuska.Sh EXAMPLES
149*a0b956f5SMartin MatuskaHeal a dataset that was corrupted due to OpenZFS bug #12762.
150*a0b956f5SMartin MatuskaFirst, determine which records are corrupt.
151*a0b956f5SMartin MatuskaThat cannot be done automatically; it requires information beyond ZFS's
152*a0b956f5SMartin Matuskametadata.
153*a0b956f5SMartin MatuskaIf object
154*a0b956f5SMartin Matuska.Sy 128
155*a0b956f5SMartin Matuskais corrupted at offset
156*a0b956f5SMartin Matuska.Sy 0
157*a0b956f5SMartin Matuskaand is compressed using
158*a0b956f5SMartin Matuska.Sy lz4 ,
159*a0b956f5SMartin Matuskathen run this command:
160*a0b956f5SMartin Matuska.Bd -literal
161*a0b956f5SMartin Matuska.No # Nm zfs Ar send Fl c Ar … | Nm zstream decompress Ar 128,0,lz4 | \
162*a0b956f5SMartin MatuskaNm zfs recv Ar …
163*a0b956f5SMartin Matuska.Ed
164eda14cbcSMatt Macy.Sh SEE ALSO
165eda14cbcSMatt Macy.Xr zfs 8 ,
16616038816SMartin Matuska.Xr zfs-receive 8 ,
167*a0b956f5SMartin Matuska.Xr zfs-send 8 ,
168*a0b956f5SMartin Matuska.Lk https://github.com/openzfs/zfs/issues/12762
169