xref: /freebsd/sys/contrib/openzfs/man/man8/zfs-send.8 (revision 9db44a8e5da9bf1ce6dd1c0f1468ddafed6d6c91)
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.\"
22eda14cbcSMatt Macy.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
23eda14cbcSMatt Macy.\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
24eda14cbcSMatt Macy.\" Copyright (c) 2011, 2019 by Delphix. All rights reserved.
25eda14cbcSMatt Macy.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
26eda14cbcSMatt Macy.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
27eda14cbcSMatt Macy.\" Copyright (c) 2014 by Adam Stevko. All rights reserved.
28eda14cbcSMatt Macy.\" Copyright (c) 2014 Integros [integros.com]
29eda14cbcSMatt Macy.\" Copyright 2019 Richard Laager. All rights reserved.
30eda14cbcSMatt Macy.\" Copyright 2018 Nexenta Systems, Inc.
31eda14cbcSMatt Macy.\" Copyright 2019 Joyent, Inc.
32eda14cbcSMatt Macy.\"
33eda14cbcSMatt Macy.Dd June 30, 2019
34eda14cbcSMatt Macy.Dt ZFS-SEND 8
35eda14cbcSMatt Macy.Os
36eda14cbcSMatt Macy.Sh NAME
377877fdebSMatt Macy.Nm zfs-send
38eda14cbcSMatt Macy.Nd Generate a send stream, which may be of a filesystem, and may be incremental from a bookmark.
39eda14cbcSMatt Macy.Sh SYNOPSIS
407877fdebSMatt Macy.Nm zfs
41eda14cbcSMatt Macy.Cm send
42eda14cbcSMatt Macy.Op Fl DLPRbcehnpvw
43eda14cbcSMatt Macy.Op Oo Fl I Ns | Ns Fl i Oc Ar snapshot
44eda14cbcSMatt Macy.Ar snapshot
457877fdebSMatt Macy.Nm zfs
46eda14cbcSMatt Macy.Cm send
47eda14cbcSMatt Macy.Op Fl DLPRcenpvw
48eda14cbcSMatt Macy.Op Fl i Ar snapshot Ns | Ns Ar bookmark
49eda14cbcSMatt Macy.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
507877fdebSMatt Macy.Nm zfs
51eda14cbcSMatt Macy.Cm send
52eda14cbcSMatt Macy.Fl -redact Ar redaction_bookmark
53eda14cbcSMatt Macy.Op Fl DLPcenpv
54eda14cbcSMatt Macy.br
55eda14cbcSMatt Macy.Op Fl i Ar snapshot Ns | Ns Ar bookmark
56eda14cbcSMatt Macy.Ar snapshot
577877fdebSMatt Macy.Nm zfs
58eda14cbcSMatt Macy.Cm send
59eda14cbcSMatt Macy.Op Fl Penv
60eda14cbcSMatt Macy.Fl t
61eda14cbcSMatt Macy.Ar receive_resume_token
627877fdebSMatt Macy.Nm zfs
63eda14cbcSMatt Macy.Cm send
64eda14cbcSMatt Macy.Op Fl Pnv
65eda14cbcSMatt Macy.Fl S Ar filesystem
667877fdebSMatt Macy.Nm zfs
67eda14cbcSMatt Macy.Cm redact
68eda14cbcSMatt Macy.Ar snapshot redaction_bookmark
69eda14cbcSMatt Macy.Ar redaction_snapshot Ns ...
70eda14cbcSMatt Macy.Sh DESCRIPTION
71eda14cbcSMatt Macy.Bl -tag -width ""
72eda14cbcSMatt Macy.It Xo
737877fdebSMatt Macy.Nm zfs
74eda14cbcSMatt Macy.Cm send
75eda14cbcSMatt Macy.Op Fl DLPRbcehnpvw
76eda14cbcSMatt Macy.Op Oo Fl I Ns | Ns Fl i Oc Ar snapshot
77eda14cbcSMatt Macy.Ar snapshot
78eda14cbcSMatt Macy.Xc
79eda14cbcSMatt MacyCreates a stream representation of the second
80eda14cbcSMatt Macy.Ar snapshot ,
81eda14cbcSMatt Macywhich is written to standard output.
82eda14cbcSMatt MacyThe output can be redirected to a file or to a different system
83eda14cbcSMatt Macy.Po for example, using
84eda14cbcSMatt Macy.Xr ssh 1
85eda14cbcSMatt Macy.Pc .
86eda14cbcSMatt MacyBy default, a full stream is generated.
87eda14cbcSMatt Macy.Bl -tag -width "-D"
88eda14cbcSMatt Macy.It Fl D, -dedup
89eda14cbcSMatt MacyDeduplicated send is no longer supported.
90eda14cbcSMatt MacyThis flag is accepted for backwards compatibility, but a regular,
91eda14cbcSMatt Macynon-deduplicated stream will be generated.
92eda14cbcSMatt Macy.It Fl I Ar snapshot
93eda14cbcSMatt MacyGenerate a stream package that sends all intermediary snapshots from the first
94eda14cbcSMatt Macysnapshot to the second snapshot.
95eda14cbcSMatt MacyFor example,
96eda14cbcSMatt Macy.Fl I Em @a Em fs@d
97eda14cbcSMatt Macyis similar to
98eda14cbcSMatt Macy.Fl i Em @a Em fs@b Ns \&; Fl i Em @b Em fs@c Ns \&; Fl i Em @c Em fs@d .
99eda14cbcSMatt MacyThe incremental source may be specified as with the
100eda14cbcSMatt Macy.Fl i
101eda14cbcSMatt Macyoption.
102eda14cbcSMatt Macy.It Fl L, -large-block
103eda14cbcSMatt MacyGenerate a stream which may contain blocks larger than 128KB.
104eda14cbcSMatt MacyThis flag has no effect if the
105eda14cbcSMatt Macy.Sy large_blocks
106eda14cbcSMatt Macypool feature is disabled, or if the
107eda14cbcSMatt Macy.Sy recordsize
108eda14cbcSMatt Macyproperty of this filesystem has never been set above 128KB.
109eda14cbcSMatt MacyThe receiving system must have the
110eda14cbcSMatt Macy.Sy large_blocks
111eda14cbcSMatt Macypool feature enabled as well.
112eda14cbcSMatt MacySee
113eda14cbcSMatt Macy.Xr zpool-features 5
114eda14cbcSMatt Macyfor details on ZFS feature flags and the
115eda14cbcSMatt Macy.Sy large_blocks
116eda14cbcSMatt Macyfeature.
117eda14cbcSMatt Macy.It Fl P, -parsable
118eda14cbcSMatt MacyPrint machine-parsable verbose information about the stream package generated.
119eda14cbcSMatt Macy.It Fl R, -replicate
120eda14cbcSMatt MacyGenerate a replication stream package, which will replicate the specified
121eda14cbcSMatt Macyfile system, and all descendent file systems, up to the named snapshot.
122eda14cbcSMatt MacyWhen received, all properties, snapshots, descendent file systems, and clones
123eda14cbcSMatt Macyare preserved.
124eda14cbcSMatt Macy.Pp
125eda14cbcSMatt MacyIf the
126eda14cbcSMatt Macy.Fl i
127eda14cbcSMatt Macyor
128eda14cbcSMatt Macy.Fl I
129eda14cbcSMatt Macyflags are used in conjunction with the
130eda14cbcSMatt Macy.Fl R
131eda14cbcSMatt Macyflag, an incremental replication stream is generated.
132eda14cbcSMatt MacyThe current values of properties, and current snapshot and file system names are
133eda14cbcSMatt Macyset when the stream is received.
134eda14cbcSMatt MacyIf the
135eda14cbcSMatt Macy.Fl F
136eda14cbcSMatt Macyflag is specified when this stream is received, snapshots and file systems that
137eda14cbcSMatt Macydo not exist on the sending side are destroyed. If the
138eda14cbcSMatt Macy.Fl R
139eda14cbcSMatt Macyflag is used to send encrypted datasets, then
140eda14cbcSMatt Macy.Fl w
141eda14cbcSMatt Macymust also be specified.
142eda14cbcSMatt Macy.It Fl e, -embed
143eda14cbcSMatt MacyGenerate a more compact stream by using
144eda14cbcSMatt Macy.Sy WRITE_EMBEDDED
145eda14cbcSMatt Macyrecords for blocks which are stored more compactly on disk by the
146eda14cbcSMatt Macy.Sy embedded_data
147eda14cbcSMatt Macypool feature.
148eda14cbcSMatt MacyThis flag has no effect if the
149eda14cbcSMatt Macy.Sy embedded_data
150eda14cbcSMatt Macyfeature is disabled.
151eda14cbcSMatt MacyThe receiving system must have the
152eda14cbcSMatt Macy.Sy embedded_data
153eda14cbcSMatt Macyfeature enabled.
154eda14cbcSMatt MacyIf the
155eda14cbcSMatt Macy.Sy lz4_compress
156eda14cbcSMatt Macyfeature is active on the sending system, then the receiving system must have
157eda14cbcSMatt Macythat feature enabled as well. Datasets that are sent with this flag may not be
158eda14cbcSMatt Macyreceived as an encrypted dataset, since encrypted datasets cannot use the
159eda14cbcSMatt Macy.Sy embedded_data
160eda14cbcSMatt Macyfeature.
161eda14cbcSMatt MacySee
162eda14cbcSMatt Macy.Xr zpool-features 5
163eda14cbcSMatt Macyfor details on ZFS feature flags and the
164eda14cbcSMatt Macy.Sy embedded_data
165eda14cbcSMatt Macyfeature.
166eda14cbcSMatt Macy.It Fl b, -backup
167eda14cbcSMatt MacySends only received property values whether or not they are overridden by local
168eda14cbcSMatt Macysettings, but only if the dataset has ever been received. Use this option when
169eda14cbcSMatt Macyyou want
170eda14cbcSMatt Macy.Nm zfs Cm receive
171eda14cbcSMatt Macyto restore received properties backed up on the sent dataset and to avoid
172eda14cbcSMatt Macysending local settings that may have nothing to do with the source dataset,
173eda14cbcSMatt Macybut only with how the data is backed up.
174eda14cbcSMatt Macy.It Fl c, -compressed
175eda14cbcSMatt MacyGenerate a more compact stream by using compressed WRITE records for blocks
176eda14cbcSMatt Macywhich are compressed on disk and in memory
177eda14cbcSMatt Macy.Po see the
178eda14cbcSMatt Macy.Sy compression
179eda14cbcSMatt Macyproperty for details
180eda14cbcSMatt Macy.Pc .
181eda14cbcSMatt MacyIf the
182eda14cbcSMatt Macy.Sy lz4_compress
183eda14cbcSMatt Macyfeature is active on the sending system, then the receiving system must have
184eda14cbcSMatt Macythat feature enabled as well.
185eda14cbcSMatt MacyIf the
186eda14cbcSMatt Macy.Sy large_blocks
187eda14cbcSMatt Macyfeature is enabled on the sending system but the
188eda14cbcSMatt Macy.Fl L
189eda14cbcSMatt Macyoption is not supplied in conjunction with
190eda14cbcSMatt Macy.Fl c ,
191eda14cbcSMatt Macythen the data will be decompressed before sending so it can be split into
192*9db44a8eSMartin Matuskasmaller block sizes. Streams sent with
193*9db44a8eSMartin Matuska.Fl c
194*9db44a8eSMartin Matuskawill not have their data recompressed on the receiver side using
195*9db44a8eSMartin Matuska.Fl o compress=value.
196*9db44a8eSMartin MatuskaThe data will stay compressed as it was from the sender. The new compression
197*9db44a8eSMartin Matuskaproperty will be set for future data.
198eda14cbcSMatt Macy.It Fl w, -raw
199eda14cbcSMatt MacyFor encrypted datasets, send data exactly as it exists on disk. This allows
200eda14cbcSMatt Macybackups to be taken even if encryption keys are not currently loaded. The
201eda14cbcSMatt Macybackup may then be received on an untrusted machine since that machine will
202eda14cbcSMatt Macynot have the encryption keys to read the protected data or alter it without
203eda14cbcSMatt Macybeing detected. Upon being received, the dataset will have the same encryption
204eda14cbcSMatt Macykeys as it did on the send side, although the
205eda14cbcSMatt Macy.Sy keylocation
206eda14cbcSMatt Macyproperty will be defaulted to
207eda14cbcSMatt Macy.Sy prompt
208eda14cbcSMatt Macyif not otherwise provided. For unencrypted datasets, this flag will be
209eda14cbcSMatt Macyequivalent to
210eda14cbcSMatt Macy.Fl Lec .
211eda14cbcSMatt MacyNote that if you do not use this flag for sending encrypted datasets, data will
212eda14cbcSMatt Macybe sent unencrypted and may be re-encrypted with a different encryption key on
213eda14cbcSMatt Macythe receiving system, which will disable the ability to do a raw send to that
214eda14cbcSMatt Macysystem for incrementals.
215eda14cbcSMatt Macy.It Fl h, -holds
216eda14cbcSMatt MacyGenerate a stream package that includes any snapshot holds (created with the
217eda14cbcSMatt Macy.Sy zfs hold
218eda14cbcSMatt Macycommand), and indicating to
219eda14cbcSMatt Macy.Sy zfs receive
220eda14cbcSMatt Macythat the holds be applied to the dataset on the receiving system.
221eda14cbcSMatt Macy.It Fl i Ar snapshot
222eda14cbcSMatt MacyGenerate an incremental stream from the first
223eda14cbcSMatt Macy.Ar snapshot
224eda14cbcSMatt Macy.Pq the incremental source
225eda14cbcSMatt Macyto the second
226eda14cbcSMatt Macy.Ar snapshot
227eda14cbcSMatt Macy.Pq the incremental target .
228eda14cbcSMatt MacyThe incremental source can be specified as the last component of the snapshot
229eda14cbcSMatt Macyname
230eda14cbcSMatt Macy.Po the
231eda14cbcSMatt Macy.Sy @
232eda14cbcSMatt Macycharacter and following
233eda14cbcSMatt Macy.Pc
234eda14cbcSMatt Macyand it is assumed to be from the same file system as the incremental target.
235eda14cbcSMatt Macy.Pp
236eda14cbcSMatt MacyIf the destination is a clone, the source may be the origin snapshot, which must
237eda14cbcSMatt Macybe fully specified
238eda14cbcSMatt Macy.Po for example,
239eda14cbcSMatt Macy.Em pool/fs@origin ,
240eda14cbcSMatt Macynot just
241eda14cbcSMatt Macy.Em @origin
242eda14cbcSMatt Macy.Pc .
243eda14cbcSMatt Macy.It Fl n, -dryrun
244eda14cbcSMatt MacyDo a dry-run
245eda14cbcSMatt Macy.Pq Qq No-op
246eda14cbcSMatt Macysend.
247eda14cbcSMatt MacyDo not generate any actual send data.
248eda14cbcSMatt MacyThis is useful in conjunction with the
249eda14cbcSMatt Macy.Fl v
250eda14cbcSMatt Macyor
251eda14cbcSMatt Macy.Fl P
252eda14cbcSMatt Macyflags to determine what data will be sent.
253eda14cbcSMatt MacyIn this case, the verbose output will be written to standard output
254eda14cbcSMatt Macy.Po contrast with a non-dry-run, where the stream is written to standard output
255eda14cbcSMatt Macyand the verbose output goes to standard error
256eda14cbcSMatt Macy.Pc .
257eda14cbcSMatt Macy.It Fl p, -props
258eda14cbcSMatt MacyInclude the dataset's properties in the stream.
259eda14cbcSMatt MacyThis flag is implicit when
260eda14cbcSMatt Macy.Fl R
261eda14cbcSMatt Macyis specified.
262eda14cbcSMatt MacyThe receiving system must also support this feature. Sends of encrypted datasets
263eda14cbcSMatt Macymust use
264eda14cbcSMatt Macy.Fl w
265eda14cbcSMatt Macywhen using this flag.
266eda14cbcSMatt Macy.It Fl v, -verbose
267eda14cbcSMatt MacyPrint verbose information about the stream package generated.
268eda14cbcSMatt MacyThis information includes a per-second report of how much data has been sent.
269eda14cbcSMatt Macy.Pp
270eda14cbcSMatt MacyThe format of the stream is committed.
271eda14cbcSMatt MacyYou will be able to receive your streams on future versions of ZFS.
272eda14cbcSMatt Macy.El
273eda14cbcSMatt Macy.It Xo
2747877fdebSMatt Macy.Nm zfs
275eda14cbcSMatt Macy.Cm send
276eda14cbcSMatt Macy.Op Fl DLPRcenpvw
277eda14cbcSMatt Macy.Op Fl i Ar snapshot Ns | Ns Ar bookmark
278eda14cbcSMatt Macy.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
279eda14cbcSMatt Macy.Xc
280eda14cbcSMatt MacyGenerate a send stream, which may be of a filesystem, and may be incremental
281eda14cbcSMatt Macyfrom a bookmark.
282eda14cbcSMatt MacyIf the destination is a filesystem or volume, the pool must be read-only, or the
283eda14cbcSMatt Macyfilesystem must not be mounted.
284eda14cbcSMatt MacyWhen the stream generated from a filesystem or volume is received, the default
285eda14cbcSMatt Macysnapshot name will be
286eda14cbcSMatt Macy.Qq --head-- .
287eda14cbcSMatt Macy.Bl -tag -width "-L"
288eda14cbcSMatt Macy.It Fl L, -large-block
289eda14cbcSMatt MacyGenerate a stream which may contain blocks larger than 128KB.
290eda14cbcSMatt MacyThis flag has no effect if the
291eda14cbcSMatt Macy.Sy large_blocks
292eda14cbcSMatt Macypool feature is disabled, or if the
293eda14cbcSMatt Macy.Sy recordsize
294eda14cbcSMatt Macyproperty of this filesystem has never been set above 128KB.
295eda14cbcSMatt MacyThe receiving system must have the
296eda14cbcSMatt Macy.Sy large_blocks
297eda14cbcSMatt Macypool feature enabled as well.
298eda14cbcSMatt MacySee
299eda14cbcSMatt Macy.Xr zpool-features 5
300eda14cbcSMatt Macyfor details on ZFS feature flags and the
301eda14cbcSMatt Macy.Sy large_blocks
302eda14cbcSMatt Macyfeature.
303eda14cbcSMatt Macy.It Fl P, -parsable
304eda14cbcSMatt MacyPrint machine-parsable verbose information about the stream package generated.
305eda14cbcSMatt Macy.It Fl c, -compressed
306eda14cbcSMatt MacyGenerate a more compact stream by using compressed WRITE records for blocks
307eda14cbcSMatt Macywhich are compressed on disk and in memory
308eda14cbcSMatt Macy.Po see the
309eda14cbcSMatt Macy.Sy compression
310eda14cbcSMatt Macyproperty for details
311eda14cbcSMatt Macy.Pc .
312eda14cbcSMatt MacyIf the
313eda14cbcSMatt Macy.Sy lz4_compress
314eda14cbcSMatt Macyfeature is active on the sending system, then the receiving system must have
315eda14cbcSMatt Macythat feature enabled as well.
316eda14cbcSMatt MacyIf the
317eda14cbcSMatt Macy.Sy large_blocks
318eda14cbcSMatt Macyfeature is enabled on the sending system but the
319eda14cbcSMatt Macy.Fl L
320eda14cbcSMatt Macyoption is not supplied in conjunction with
321eda14cbcSMatt Macy.Fl c ,
322eda14cbcSMatt Macythen the data will be decompressed before sending so it can be split into
323eda14cbcSMatt Macysmaller block sizes.
324eda14cbcSMatt Macy.It Fl w, -raw
325eda14cbcSMatt MacyFor encrypted datasets, send data exactly as it exists on disk. This allows
326eda14cbcSMatt Macybackups to be taken even if encryption keys are not currently loaded. The
327eda14cbcSMatt Macybackup may then be received on an untrusted machine since that machine will
328eda14cbcSMatt Macynot have the encryption keys to read the protected data or alter it without
329eda14cbcSMatt Macybeing detected. Upon being received, the dataset will have the same encryption
330eda14cbcSMatt Macykeys as it did on the send side, although the
331eda14cbcSMatt Macy.Sy keylocation
332eda14cbcSMatt Macyproperty will be defaulted to
333eda14cbcSMatt Macy.Sy prompt
334eda14cbcSMatt Macyif not otherwise provided. For unencrypted datasets, this flag will be
335eda14cbcSMatt Macyequivalent to
336eda14cbcSMatt Macy.Fl Lec .
337eda14cbcSMatt MacyNote that if you do not use this flag for sending encrypted datasets, data will
338eda14cbcSMatt Macybe sent unencrypted and may be re-encrypted with a different encryption key on
339eda14cbcSMatt Macythe receiving system, which will disable the ability to do a raw send to that
340eda14cbcSMatt Macysystem for incrementals.
341eda14cbcSMatt Macy.It Fl e, -embed
342eda14cbcSMatt MacyGenerate a more compact stream by using
343eda14cbcSMatt Macy.Sy WRITE_EMBEDDED
344eda14cbcSMatt Macyrecords for blocks which are stored more compactly on disk by the
345eda14cbcSMatt Macy.Sy embedded_data
346eda14cbcSMatt Macypool feature.
347eda14cbcSMatt MacyThis flag has no effect if the
348eda14cbcSMatt Macy.Sy embedded_data
349eda14cbcSMatt Macyfeature is disabled.
350eda14cbcSMatt MacyThe receiving system must have the
351eda14cbcSMatt Macy.Sy embedded_data
352eda14cbcSMatt Macyfeature enabled.
353eda14cbcSMatt MacyIf the
354eda14cbcSMatt Macy.Sy lz4_compress
355eda14cbcSMatt Macyfeature is active on the sending system, then the receiving system must have
356eda14cbcSMatt Macythat feature enabled as well. Datasets that are sent with this flag may not be
357eda14cbcSMatt Macyreceived as an encrypted dataset, since encrypted datasets cannot use the
358eda14cbcSMatt Macy.Sy embedded_data
359eda14cbcSMatt Macyfeature.
360eda14cbcSMatt MacySee
361eda14cbcSMatt Macy.Xr zpool-features 5
362eda14cbcSMatt Macyfor details on ZFS feature flags and the
363eda14cbcSMatt Macy.Sy embedded_data
364eda14cbcSMatt Macyfeature.
365eda14cbcSMatt Macy.It Fl i Ar snapshot Ns | Ns Ar bookmark
366eda14cbcSMatt MacyGenerate an incremental send stream.
367eda14cbcSMatt MacyThe incremental source must be an earlier snapshot in the destination's history.
368eda14cbcSMatt MacyIt will commonly be an earlier snapshot in the destination's file system, in
369eda14cbcSMatt Macywhich case it can be specified as the last component of the name
370eda14cbcSMatt Macy.Po the
371eda14cbcSMatt Macy.Sy #
372eda14cbcSMatt Macyor
373eda14cbcSMatt Macy.Sy @
374eda14cbcSMatt Macycharacter and following
375eda14cbcSMatt Macy.Pc .
376eda14cbcSMatt Macy.Pp
377eda14cbcSMatt MacyIf the incremental target is a clone, the incremental source can be the origin
378eda14cbcSMatt Macysnapshot, or an earlier snapshot in the origin's filesystem, or the origin's
379eda14cbcSMatt Macyorigin, etc.
380eda14cbcSMatt Macy.It Fl n, -dryrun
381eda14cbcSMatt MacyDo a dry-run
382eda14cbcSMatt Macy.Pq Qq No-op
383eda14cbcSMatt Macysend.
384eda14cbcSMatt MacyDo not generate any actual send data.
385eda14cbcSMatt MacyThis is useful in conjunction with the
386eda14cbcSMatt Macy.Fl v
387eda14cbcSMatt Macyor
388eda14cbcSMatt Macy.Fl P
389eda14cbcSMatt Macyflags to determine what data will be sent.
390eda14cbcSMatt MacyIn this case, the verbose output will be written to standard output
391eda14cbcSMatt Macy.Po contrast with a non-dry-run, where the stream is written to standard output
392eda14cbcSMatt Macyand the verbose output goes to standard error
393eda14cbcSMatt Macy.Pc .
394eda14cbcSMatt Macy.It Fl v, -verbose
395eda14cbcSMatt MacyPrint verbose information about the stream package generated.
396eda14cbcSMatt MacyThis information includes a per-second report of how much data has been sent.
397eda14cbcSMatt Macy.El
398eda14cbcSMatt Macy.It Xo
3997877fdebSMatt Macy.Nm zfs
400eda14cbcSMatt Macy.Cm send
401eda14cbcSMatt Macy.Fl -redact Ar redaction_bookmark
402eda14cbcSMatt Macy.Op Fl DLPcenpv
403eda14cbcSMatt Macy.br
404eda14cbcSMatt Macy.Op Fl i Ar snapshot Ns | Ns Ar bookmark
405eda14cbcSMatt Macy.Ar snapshot
406eda14cbcSMatt Macy.Xc
407eda14cbcSMatt MacyGenerate a redacted send stream.
408eda14cbcSMatt MacyThis send stream contains all blocks from the snapshot being sent that aren't
409eda14cbcSMatt Macyincluded in the redaction list contained in the bookmark specified by the
410eda14cbcSMatt Macy.Fl -redact
411eda14cbcSMatt Macy(or
412eda14cbcSMatt Macy.Fl -d
413eda14cbcSMatt Macy) flag.
414eda14cbcSMatt MacyThe resulting send stream is said to be redacted with respect to the snapshots
415eda14cbcSMatt Macythe bookmark specified by the
416eda14cbcSMatt Macy.Fl -redact No flag was created with.
417eda14cbcSMatt MacyThe bookmark must have been created by running
418eda14cbcSMatt Macy.Sy zfs redact
419eda14cbcSMatt Macyon the snapshot being sent.
420eda14cbcSMatt Macy.sp
421eda14cbcSMatt MacyThis feature can be used to allow clones of a filesystem to be made available on
422eda14cbcSMatt Macya remote system, in the case where their parent need not (or needs to not) be
423eda14cbcSMatt Macyusable.
424eda14cbcSMatt MacyFor example, if a filesystem contains sensitive data, and it has clones where
425eda14cbcSMatt Macythat sensitive data has been secured or replaced with dummy data, redacted sends
426eda14cbcSMatt Macycan be used to replicate the secured data without replicating the original
427eda14cbcSMatt Macysensitive data, while still sharing all possible blocks.
428eda14cbcSMatt MacyA snapshot that has been redacted with respect to a set of snapshots will
429eda14cbcSMatt Macycontain all blocks referenced by at least one snapshot in the set, but will
430eda14cbcSMatt Macycontain none of the blocks referenced by none of the snapshots in the set.
431eda14cbcSMatt MacyIn other words, if all snapshots in the set have modified a given block in the
432eda14cbcSMatt Macyparent, that block will not be sent; but if one or more snapshots have not
433eda14cbcSMatt Macymodified a block in the parent, they will still reference the parent's block, so
434eda14cbcSMatt Macythat block will be sent.
435eda14cbcSMatt MacyNote that only user data will be redacted.
436eda14cbcSMatt Macy.sp
437eda14cbcSMatt MacyWhen the redacted send stream is received, we will generate a redacted
438eda14cbcSMatt Macysnapshot.
439eda14cbcSMatt MacyDue to the nature of redaction, a redacted dataset can only be used in the
440eda14cbcSMatt Macyfollowing ways:
441eda14cbcSMatt Macy.sp
442eda14cbcSMatt Macy1. To receive, as a clone, an incremental send from the original snapshot to one
443eda14cbcSMatt Macyof the snapshots it was redacted with respect to.
444eda14cbcSMatt MacyIn this case, the stream will produce a valid dataset when received because all
445eda14cbcSMatt Macyblocks that were redacted in the parent are guaranteed to be present in the
446eda14cbcSMatt Macychild's send stream.
447eda14cbcSMatt MacyThis use case will produce a normal snapshot, which can be used just like other
448eda14cbcSMatt Macysnapshots.
449eda14cbcSMatt Macy.sp
450eda14cbcSMatt Macy2. To receive an incremental send from the original snapshot to something
451eda14cbcSMatt Macyredacted with respect to a subset of the set of snapshots the initial snapshot
452eda14cbcSMatt Macywas redacted with respect to.
453eda14cbcSMatt MacyIn this case, each block that was redacted in the original is still redacted
454eda14cbcSMatt Macy(redacting with respect to additional snapshots causes less data to be redacted
455eda14cbcSMatt Macy(because the snapshots define what is permitted, and everything else is
456eda14cbcSMatt Macyredacted)).
457eda14cbcSMatt MacyThis use case will produce a new redacted snapshot.
458eda14cbcSMatt Macy.sp
459eda14cbcSMatt Macy3. To receive an incremental send from a redaction bookmark of the original
460eda14cbcSMatt Macysnapshot that was created when redacting with respect to a subset of the set of
461eda14cbcSMatt Macysnapshots the initial snapshot was created with respect to
462eda14cbcSMatt Macyanything else.
463eda14cbcSMatt MacyA send stream from such a redaction bookmark will contain all of the blocks
464eda14cbcSMatt Macynecessary to fill in any redacted data, should it be needed, because the sending
465eda14cbcSMatt Macysystem is aware of what blocks were originally redacted.
466eda14cbcSMatt MacyThis will either produce a normal snapshot or a redacted one, depending on
467eda14cbcSMatt Macywhether the new send stream is redacted.
468eda14cbcSMatt Macy.sp
469eda14cbcSMatt Macy4. To receive an incremental send from a redacted version of the initial
470eda14cbcSMatt Macysnapshot that is redacted with respect to a subject of the set of snapshots the
471eda14cbcSMatt Macyinitial snapshot was created with respect to.
472eda14cbcSMatt MacyA send stream from a compatible redacted dataset will contain all of the blocks
473eda14cbcSMatt Macynecessary to fill in any redacted data.
474eda14cbcSMatt MacyThis will either produce a normal snapshot or a redacted one, depending on
475eda14cbcSMatt Macywhether the new send stream is redacted.
476eda14cbcSMatt Macy.sp
477eda14cbcSMatt Macy5. To receive a full send as a clone of the redacted snapshot.
478eda14cbcSMatt MacySince the stream is a full send, it definitionally contains all the data needed
479eda14cbcSMatt Macyto create a new dataset.
480eda14cbcSMatt MacyThis use case will either produce a normal snapshot or a redacted one, depending
481eda14cbcSMatt Macyon whether the full send stream was redacted.
482eda14cbcSMatt Macy.sp
483eda14cbcSMatt MacyThese restrictions are detected and enforced by \fBzfs receive\fR; a
484eda14cbcSMatt Macyredacted send stream will contain the list of snapshots that the stream is
485eda14cbcSMatt Macyredacted with respect to.
486eda14cbcSMatt MacyThese are stored with the redacted snapshot, and are used to detect and
487eda14cbcSMatt Macycorrectly handle the cases above.  Note that for technical reasons, raw sends
488eda14cbcSMatt Macyand redacted sends cannot be combined at this time.
489eda14cbcSMatt Macy.It Xo
4907877fdebSMatt Macy.Nm zfs
491eda14cbcSMatt Macy.Cm send
492eda14cbcSMatt Macy.Op Fl Penv
493eda14cbcSMatt Macy.Fl t
494eda14cbcSMatt Macy.Ar receive_resume_token
495eda14cbcSMatt Macy.Xc
496eda14cbcSMatt MacyCreates a send stream which resumes an interrupted receive.
497eda14cbcSMatt MacyThe
498eda14cbcSMatt Macy.Ar receive_resume_token
499eda14cbcSMatt Macyis the value of this property on the filesystem or volume that was being
500eda14cbcSMatt Macyreceived into.
501eda14cbcSMatt MacySee the documentation for
502eda14cbcSMatt Macy.Sy zfs receive -s
503eda14cbcSMatt Macyfor more details.
504eda14cbcSMatt Macy.It Xo
5057877fdebSMatt Macy.Nm zfs
506eda14cbcSMatt Macy.Cm send
507eda14cbcSMatt Macy.Op Fl Pnv
508eda14cbcSMatt Macy.Op Fl i Ar snapshot Ns | Ns Ar bookmark
509eda14cbcSMatt Macy.Fl S
510eda14cbcSMatt Macy.Ar filesystem
511eda14cbcSMatt Macy.Xc
512eda14cbcSMatt MacyGenerate a send stream from a dataset that has been partially received.
513eda14cbcSMatt Macy.Bl -tag -width "-L"
514eda14cbcSMatt Macy.It Fl S, -saved
515eda14cbcSMatt MacyThis flag requires that the specified filesystem previously received a resumable
516eda14cbcSMatt Macysend that did not finish and was interrupted. In such scenarios this flag
517eda14cbcSMatt Macyenables the user to send this partially received state. Using this flag will
518eda14cbcSMatt Macyalways use the last fully received snapshot as the incremental source if it
519eda14cbcSMatt Macyexists.
520eda14cbcSMatt Macy.El
521eda14cbcSMatt Macy.It Xo
5227877fdebSMatt Macy.Nm zfs
523eda14cbcSMatt Macy.Cm redact
524eda14cbcSMatt Macy.Ar snapshot redaction_bookmark
525eda14cbcSMatt Macy.Ar redaction_snapshot Ns ...
526eda14cbcSMatt Macy.Xc
527eda14cbcSMatt MacyGenerate a new redaction bookmark.
528eda14cbcSMatt MacyIn addition to the typical bookmark information, a redaction bookmark contains
529eda14cbcSMatt Macythe list of redacted blocks and the list of redaction snapshots specified.
530eda14cbcSMatt MacyThe redacted blocks are blocks in the snapshot which are not referenced by any
531eda14cbcSMatt Macyof the redaction snapshots.
532eda14cbcSMatt MacyThese blocks are found by iterating over the metadata in each redaction snapshot
533eda14cbcSMatt Macyto determine what has been changed since the target snapshot.
534eda14cbcSMatt MacyRedaction is designed to support redacted zfs sends; see the entry for
535eda14cbcSMatt Macy.Sy zfs send
536eda14cbcSMatt Macyfor more information on the purpose of this operation.
537eda14cbcSMatt MacyIf a redact operation fails partway through (due to an error or a system
538eda14cbcSMatt Macyfailure), the redaction can be resumed by rerunning the same command.
539eda14cbcSMatt Macy.El
540eda14cbcSMatt Macy.Ss Redaction
541eda14cbcSMatt MacyZFS has support for a limited version of data subsetting, in the form of
542eda14cbcSMatt Macyredaction. Using the
543eda14cbcSMatt Macy.Sy zfs redact
544eda14cbcSMatt Macycommand, a
545eda14cbcSMatt Macy.Sy redaction bookmark
546eda14cbcSMatt Macycan be created that stores a list of blocks containing sensitive information. When
547eda14cbcSMatt Macyprovided to
548eda14cbcSMatt Macy.Sy zfs
549eda14cbcSMatt Macy.Sy send ,
550eda14cbcSMatt Macythis causes a
551eda14cbcSMatt Macy.Sy redacted send
552eda14cbcSMatt Macyto occur. Redacted sends omit the blocks containing sensitive information,
553eda14cbcSMatt Macyreplacing them with REDACT records. When these send streams are received, a
554eda14cbcSMatt Macy.Sy redacted dataset
555eda14cbcSMatt Macyis created. A redacted dataset cannot be mounted by default, since it is
556eda14cbcSMatt Macyincomplete. It can be used to receive other send streams. In this way datasets
557eda14cbcSMatt Macycan be used for data backup and replication, with all the benefits that zfs send
558eda14cbcSMatt Macyand receive have to offer, while protecting sensitive information from being
559eda14cbcSMatt Macystored on less-trusted machines or services.
560eda14cbcSMatt Macy.Pp
561eda14cbcSMatt MacyFor the purposes of redaction, there are two steps to the process. A redact
562eda14cbcSMatt Macystep, and a send/receive step. First, a redaction bookmark is created. This is
563eda14cbcSMatt Macydone by providing the
564eda14cbcSMatt Macy.Sy zfs redact
565eda14cbcSMatt Macycommand with a parent snapshot, a bookmark to be created, and a number of
566eda14cbcSMatt Macyredaction snapshots. These redaction snapshots must be descendants of the
567eda14cbcSMatt Macyparent snapshot, and they should modify data that is considered sensitive in
568eda14cbcSMatt Macysome way. Any blocks of data modified by all of the redaction snapshots will
569eda14cbcSMatt Macybe listed in the redaction bookmark, because it represents the truly sensitive
570eda14cbcSMatt Macyinformation. When it comes to the send step, the send process will not send
571eda14cbcSMatt Macythe blocks listed in the redaction bookmark, instead replacing them with
572eda14cbcSMatt MacyREDACT records. When received on the target system, this will create a
573eda14cbcSMatt Macyredacted dataset, missing the data that corresponds to the blocks in the
574eda14cbcSMatt Macyredaction bookmark on the sending system. The incremental send streams from
575eda14cbcSMatt Macythe original parent to the redaction snapshots can then also be received on
576eda14cbcSMatt Macythe target system, and this will produce a complete snapshot that can be used
577eda14cbcSMatt Macynormally. Incrementals from one snapshot on the parent filesystem and another
578eda14cbcSMatt Macycan also be done by sending from the redaction bookmark, rather than the
579eda14cbcSMatt Macysnapshots themselves.
580eda14cbcSMatt Macy.Pp
581eda14cbcSMatt MacyIn order to make the purpose of the feature more clear, an example is
582eda14cbcSMatt Macyprovided. Consider a zfs filesystem containing four files. These files
583eda14cbcSMatt Macyrepresent information for an online shopping service. One file contains a list
584eda14cbcSMatt Macyof usernames and passwords, another contains purchase histories, a third
585eda14cbcSMatt Macycontains click tracking data, and a fourth contains user preferences.  The
586eda14cbcSMatt Macyowner of this data wants to make it available for their development teams to
587eda14cbcSMatt Macytest against, and their market research teams to do analysis on.  The
588eda14cbcSMatt Macydevelopment teams need information about user preferences and the click
589eda14cbcSMatt Macytracking data, while the market research teams need information about purchase
590eda14cbcSMatt Macyhistories and user preferences. Neither needs access to the usernames and
591eda14cbcSMatt Macypasswords. However, because all of this data is stored in one ZFS filesystem,
592eda14cbcSMatt Macyit must all be sent and received together. In addition, the owner of the data
593eda14cbcSMatt Macywants to take advantage of features like compression, checksumming, and
594eda14cbcSMatt Macysnapshots, so they do want to continue to use ZFS to store and transmit their
595eda14cbcSMatt Macydata.  Redaction can help them do so. First, they would make two clones of a
596eda14cbcSMatt Macysnapshot of the data on the source. In one clone, they create the setup they
597eda14cbcSMatt Macywant their market research team to see; they delete the usernames and
598eda14cbcSMatt Macypasswords file, and overwrite the click tracking data with dummy
599eda14cbcSMatt Macyinformation. In another, they create the setup they want the development teams
600eda14cbcSMatt Macyto see, by replacing the passwords with fake information and replacing the
601eda14cbcSMatt Macypurchase histories with randomly generated ones.  They would then create a
602eda14cbcSMatt Macyredaction bookmark on the parent snapshot, using snapshots on the two clones
603eda14cbcSMatt Macyas redaction snapshots. The parent can then be sent, redacted, to the target
604eda14cbcSMatt Macyserver where the research and development teams have access. Finally,
605eda14cbcSMatt Macyincremental sends from the parent snapshot to each of the clones can be send
606eda14cbcSMatt Macyto and received on the target server; these snapshots are identical to the
607eda14cbcSMatt Macyones on the source, and are ready to be used, while the parent snapshot on the
608eda14cbcSMatt Macytarget contains none of the username and password data present on the source,
609eda14cbcSMatt Macybecause it was removed by the redacted send operation.
610eda14cbcSMatt Macy.Sh SEE ALSO
611eda14cbcSMatt Macy.Xr zfs-bookmark 8 ,
612eda14cbcSMatt Macy.Xr zfs-receive 8 ,
613eda14cbcSMatt Macy.Xr zfs-redact 8 ,
614eda14cbcSMatt Macy.Xr zfs-snapshot 8
615