xref: /freebsd/sys/contrib/openzfs/man/man8/zfs-send.8 (revision 15f0b8c309dea1dcb14d3e374686576ff68ac43f)
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
9271171e0SMartin Matuska.\" or https://opensource.org/licenses/CDDL-1.0.
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) 2009 Sun Microsystems, Inc. All Rights Reserved.
22eda14cbcSMatt Macy.\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
23eda14cbcSMatt Macy.\" Copyright (c) 2011, 2019 by Delphix. All rights reserved.
24eda14cbcSMatt Macy.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
25eda14cbcSMatt Macy.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
26eda14cbcSMatt Macy.\" Copyright (c) 2014 by Adam Stevko. All rights reserved.
27eda14cbcSMatt Macy.\" Copyright (c) 2014 Integros [integros.com]
28eda14cbcSMatt Macy.\" Copyright 2019 Richard Laager. All rights reserved.
29eda14cbcSMatt Macy.\" Copyright 2018 Nexenta Systems, Inc.
30eda14cbcSMatt Macy.\" Copyright 2019 Joyent, Inc.
31eda14cbcSMatt Macy.\"
32*15f0b8c3SMartin Matuska.Dd January 12, 2023
33eda14cbcSMatt Macy.Dt ZFS-SEND 8
34eda14cbcSMatt Macy.Os
3516038816SMartin Matuska.
36eda14cbcSMatt Macy.Sh NAME
377877fdebSMatt Macy.Nm zfs-send
3816038816SMartin Matuska.Nd generate backup stream of ZFS dataset
39eda14cbcSMatt Macy.Sh SYNOPSIS
407877fdebSMatt Macy.Nm zfs
41eda14cbcSMatt Macy.Cm send
42*15f0b8c3SMartin Matuska.Op Fl DLPVbcehnpsvw
43716fd348SMartin Matuska.Op Fl R Op Fl X Ar dataset Ns Oo , Ns Ar dataset Oc Ns …
44eda14cbcSMatt Macy.Op Oo Fl I Ns | Ns Fl i Oc Ar snapshot
45eda14cbcSMatt Macy.Ar snapshot
467877fdebSMatt Macy.Nm zfs
47eda14cbcSMatt Macy.Cm send
48*15f0b8c3SMartin Matuska.Op Fl DLPVcensvw
49eda14cbcSMatt Macy.Op Fl i Ar snapshot Ns | Ns Ar bookmark
50eda14cbcSMatt Macy.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
517877fdebSMatt Macy.Nm zfs
52eda14cbcSMatt Macy.Cm send
53eda14cbcSMatt Macy.Fl -redact Ar redaction_bookmark
54*15f0b8c3SMartin Matuska.Op Fl DLPVcenpv
55eda14cbcSMatt Macy.Op Fl i Ar snapshot Ns | Ns Ar bookmark
56eda14cbcSMatt Macy.Ar snapshot
577877fdebSMatt Macy.Nm zfs
58eda14cbcSMatt Macy.Cm send
59*15f0b8c3SMartin Matuska.Op Fl PVenv
60eda14cbcSMatt Macy.Fl t
61eda14cbcSMatt Macy.Ar receive_resume_token
627877fdebSMatt Macy.Nm zfs
63eda14cbcSMatt Macy.Cm send
64*15f0b8c3SMartin Matuska.Op Fl PVnv
65eda14cbcSMatt Macy.Fl S Ar filesystem
667877fdebSMatt Macy.Nm zfs
67eda14cbcSMatt Macy.Cm redact
68eda14cbcSMatt Macy.Ar snapshot redaction_bookmark
6916038816SMartin Matuska.Ar redaction_snapshot Ns …
7016038816SMartin Matuska.
71eda14cbcSMatt Macy.Sh DESCRIPTION
72eda14cbcSMatt Macy.Bl -tag -width ""
73eda14cbcSMatt Macy.It Xo
747877fdebSMatt Macy.Nm zfs
75eda14cbcSMatt Macy.Cm send
76*15f0b8c3SMartin Matuska.Op Fl DLPVbcehnpsvw
77716fd348SMartin Matuska.Op Fl R Op Fl X Ar dataset Ns Oo , Ns Ar dataset Oc Ns …
78eda14cbcSMatt Macy.Op Oo Fl I Ns | Ns Fl i Oc Ar snapshot
79eda14cbcSMatt Macy.Ar snapshot
80eda14cbcSMatt Macy.Xc
81eda14cbcSMatt MacyCreates a stream representation of the second
82eda14cbcSMatt Macy.Ar snapshot ,
83eda14cbcSMatt Macywhich is written to standard output.
84eda14cbcSMatt MacyThe output can be redirected to a file or to a different system
85eda14cbcSMatt Macy.Po for example, using
86eda14cbcSMatt Macy.Xr ssh 1
87eda14cbcSMatt Macy.Pc .
88eda14cbcSMatt MacyBy default, a full stream is generated.
89eda14cbcSMatt Macy.Bl -tag -width "-D"
90eda14cbcSMatt Macy.It Fl D , -dedup
91eda14cbcSMatt MacyDeduplicated send is no longer supported.
92eda14cbcSMatt MacyThis flag is accepted for backwards compatibility, but a regular,
93eda14cbcSMatt Macynon-deduplicated stream will be generated.
94eda14cbcSMatt Macy.It Fl I Ar snapshot
95eda14cbcSMatt MacyGenerate a stream package that sends all intermediary snapshots from the first
96eda14cbcSMatt Macysnapshot to the second snapshot.
97eda14cbcSMatt MacyFor example,
98eda14cbcSMatt Macy.Fl I Em @a Em fs@d
99eda14cbcSMatt Macyis similar to
100eda14cbcSMatt Macy.Fl i Em @a Em fs@b Ns \&; Fl i Em @b Em fs@c Ns \&; Fl i Em @c Em fs@d .
101eda14cbcSMatt MacyThe incremental source may be specified as with the
102eda14cbcSMatt Macy.Fl i
103eda14cbcSMatt Macyoption.
104eda14cbcSMatt Macy.It Fl L , -large-block
105716fd348SMartin MatuskaGenerate a stream which may contain blocks larger than 128 KiB.
106eda14cbcSMatt MacyThis flag has no effect if the
107eda14cbcSMatt Macy.Sy large_blocks
108eda14cbcSMatt Macypool feature is disabled, or if the
109eda14cbcSMatt Macy.Sy recordsize
110716fd348SMartin Matuskaproperty of this filesystem has never been set above 128 KiB.
111eda14cbcSMatt MacyThe receiving system must have the
112eda14cbcSMatt Macy.Sy large_blocks
113eda14cbcSMatt Macypool feature enabled as well.
114eda14cbcSMatt MacySee
1153ff01b23SMartin Matuska.Xr zpool-features 7
116eda14cbcSMatt Macyfor details on ZFS feature flags and the
117eda14cbcSMatt Macy.Sy large_blocks
118eda14cbcSMatt Macyfeature.
119eda14cbcSMatt Macy.It Fl P , -parsable
120eda14cbcSMatt MacyPrint machine-parsable verbose information about the stream package generated.
121eda14cbcSMatt Macy.It Fl R , -replicate
122eda14cbcSMatt MacyGenerate a replication stream package, which will replicate the specified
123eda14cbcSMatt Macyfile system, and all descendent file systems, up to the named snapshot.
124eda14cbcSMatt MacyWhen received, all properties, snapshots, descendent file systems, and clones
125eda14cbcSMatt Macyare preserved.
126eda14cbcSMatt Macy.Pp
127eda14cbcSMatt MacyIf the
128eda14cbcSMatt Macy.Fl i
129eda14cbcSMatt Macyor
130eda14cbcSMatt Macy.Fl I
131eda14cbcSMatt Macyflags are used in conjunction with the
132eda14cbcSMatt Macy.Fl R
133eda14cbcSMatt Macyflag, an incremental replication stream is generated.
134eda14cbcSMatt MacyThe current values of properties, and current snapshot and file system names are
135eda14cbcSMatt Macyset when the stream is received.
136eda14cbcSMatt MacyIf the
137eda14cbcSMatt Macy.Fl F
138eda14cbcSMatt Macyflag is specified when this stream is received, snapshots and file systems that
13916038816SMartin Matuskado not exist on the sending side are destroyed.
14016038816SMartin MatuskaIf the
141eda14cbcSMatt Macy.Fl R
142eda14cbcSMatt Macyflag is used to send encrypted datasets, then
143eda14cbcSMatt Macy.Fl w
144eda14cbcSMatt Macymust also be specified.
145*15f0b8c3SMartin Matuska.It Fl V , -proctitle
146*15f0b8c3SMartin MatuskaSet the process title to a per-second report of how much data has been sent.
147716fd348SMartin Matuska.It Fl X , -exclude Ar dataset Ns Oo , Ns Ar dataset Oc Ns …
148716fd348SMartin MatuskaWith
149716fd348SMartin Matuska.Fl R ,
150da5137abSMartin Matuska.Fl X
151716fd348SMartin Matuskaspecifies a set of datasets (and, hence, their descendants),
152716fd348SMartin Matuskato be excluded from the send stream.
153716fd348SMartin MatuskaThe root dataset may not be excluded.
154716fd348SMartin Matuska.Fl X Ar a Fl X Ar b
155716fd348SMartin Matuskais equivalent to
156716fd348SMartin Matuska.Fl X Ar a , Ns Ar b .
157eda14cbcSMatt Macy.It Fl e , -embed
158eda14cbcSMatt MacyGenerate a more compact stream by using
159eda14cbcSMatt Macy.Sy WRITE_EMBEDDED
160eda14cbcSMatt Macyrecords for blocks which are stored more compactly on disk by the
161eda14cbcSMatt Macy.Sy embedded_data
162eda14cbcSMatt Macypool feature.
163eda14cbcSMatt MacyThis flag has no effect if the
164eda14cbcSMatt Macy.Sy embedded_data
165eda14cbcSMatt Macyfeature is disabled.
166eda14cbcSMatt MacyThe receiving system must have the
167eda14cbcSMatt Macy.Sy embedded_data
168eda14cbcSMatt Macyfeature enabled.
169eda14cbcSMatt MacyIf the
170eda14cbcSMatt Macy.Sy lz4_compress
171eda14cbcSMatt Macyfeature is active on the sending system, then the receiving system must have
17216038816SMartin Matuskathat feature enabled as well.
17316038816SMartin MatuskaDatasets that are sent with this flag may not be
174eda14cbcSMatt Macyreceived as an encrypted dataset, since encrypted datasets cannot use the
175eda14cbcSMatt Macy.Sy embedded_data
176eda14cbcSMatt Macyfeature.
177eda14cbcSMatt MacySee
1783ff01b23SMartin Matuska.Xr zpool-features 7
179eda14cbcSMatt Macyfor details on ZFS feature flags and the
180eda14cbcSMatt Macy.Sy embedded_data
181eda14cbcSMatt Macyfeature.
182eda14cbcSMatt Macy.It Fl b , -backup
183eda14cbcSMatt MacySends only received property values whether or not they are overridden by local
18416038816SMartin Matuskasettings, but only if the dataset has ever been received.
18516038816SMartin MatuskaUse this option when you want
186eda14cbcSMatt Macy.Nm zfs Cm receive
187eda14cbcSMatt Macyto restore received properties backed up on the sent dataset and to avoid
188eda14cbcSMatt Macysending local settings that may have nothing to do with the source dataset,
189eda14cbcSMatt Macybut only with how the data is backed up.
190eda14cbcSMatt Macy.It Fl c , -compressed
191eda14cbcSMatt MacyGenerate a more compact stream by using compressed WRITE records for blocks
192eda14cbcSMatt Macywhich are compressed on disk and in memory
193eda14cbcSMatt Macy.Po see the
194eda14cbcSMatt Macy.Sy compression
195eda14cbcSMatt Macyproperty for details
196eda14cbcSMatt Macy.Pc .
197eda14cbcSMatt MacyIf the
198eda14cbcSMatt Macy.Sy lz4_compress
199eda14cbcSMatt Macyfeature is active on the sending system, then the receiving system must have
200eda14cbcSMatt Macythat feature enabled as well.
201eda14cbcSMatt MacyIf the
202eda14cbcSMatt Macy.Sy large_blocks
203eda14cbcSMatt Macyfeature is enabled on the sending system but the
204eda14cbcSMatt Macy.Fl L
205eda14cbcSMatt Macyoption is not supplied in conjunction with
206eda14cbcSMatt Macy.Fl c ,
207eda14cbcSMatt Macythen the data will be decompressed before sending so it can be split into
20816038816SMartin Matuskasmaller block sizes.
20916038816SMartin MatuskaStreams sent with
2109db44a8eSMartin Matuska.Fl c
2119db44a8eSMartin Matuskawill not have their data recompressed on the receiver side using
21216038816SMartin Matuska.Fl o Sy compress Ns = Ar value .
21316038816SMartin MatuskaThe data will stay compressed as it was from the sender.
21416038816SMartin MatuskaThe new compression property will be set for future data.
2156ba2210eSMartin MatuskaNote that uncompressed data from the sender will still attempt to
2166ba2210eSMartin Matuskacompress on the receiver, unless you specify
2176ba2210eSMartin Matuska.Fl o Sy compress Ns = Em off .
218eda14cbcSMatt Macy.It Fl w , -raw
21916038816SMartin MatuskaFor encrypted datasets, send data exactly as it exists on disk.
220bb2d13b6SMartin MatuskaThis allows backups to be taken even if encryption keys are not currently
221bb2d13b6SMartin Matuskaloaded.
22216038816SMartin MatuskaThe backup may then be received on an untrusted machine since that machine will
223eda14cbcSMatt Macynot have the encryption keys to read the protected data or alter it without
22416038816SMartin Matuskabeing detected.
22516038816SMartin MatuskaUpon being received, the dataset will have the same encryption
226eda14cbcSMatt Macykeys as it did on the send side, although the
227eda14cbcSMatt Macy.Sy keylocation
228eda14cbcSMatt Macyproperty will be defaulted to
229eda14cbcSMatt Macy.Sy prompt
23016038816SMartin Matuskaif not otherwise provided.
23116038816SMartin MatuskaFor unencrypted datasets, this flag will be equivalent to
232eda14cbcSMatt Macy.Fl Lec .
233eda14cbcSMatt MacyNote that if you do not use this flag for sending encrypted datasets, data will
234eda14cbcSMatt Macybe sent unencrypted and may be re-encrypted with a different encryption key on
235eda14cbcSMatt Macythe receiving system, which will disable the ability to do a raw send to that
236eda14cbcSMatt Macysystem for incrementals.
237eda14cbcSMatt Macy.It Fl h , -holds
238eda14cbcSMatt MacyGenerate a stream package that includes any snapshot holds (created with the
23916038816SMartin Matuska.Nm zfs Cm hold
240eda14cbcSMatt Macycommand), and indicating to
24116038816SMartin Matuska.Nm zfs Cm receive
242eda14cbcSMatt Macythat the holds be applied to the dataset on the receiving system.
243eda14cbcSMatt Macy.It Fl i Ar snapshot
244eda14cbcSMatt MacyGenerate an incremental stream from the first
245eda14cbcSMatt Macy.Ar snapshot
246eda14cbcSMatt Macy.Pq the incremental source
247eda14cbcSMatt Macyto the second
248eda14cbcSMatt Macy.Ar snapshot
249eda14cbcSMatt Macy.Pq the incremental target .
250eda14cbcSMatt MacyThe incremental source can be specified as the last component of the snapshot
251eda14cbcSMatt Macyname
252eda14cbcSMatt Macy.Po the
253eda14cbcSMatt Macy.Sy @
254eda14cbcSMatt Macycharacter and following
255eda14cbcSMatt Macy.Pc
256eda14cbcSMatt Macyand it is assumed to be from the same file system as the incremental target.
257eda14cbcSMatt Macy.Pp
258eda14cbcSMatt MacyIf the destination is a clone, the source may be the origin snapshot, which must
259eda14cbcSMatt Macybe fully specified
260eda14cbcSMatt Macy.Po for example,
261eda14cbcSMatt Macy.Em pool/fs@origin ,
262eda14cbcSMatt Macynot just
263eda14cbcSMatt Macy.Em @origin
264eda14cbcSMatt Macy.Pc .
265eda14cbcSMatt Macy.It Fl n , -dryrun
266eda14cbcSMatt MacyDo a dry-run
267eda14cbcSMatt Macy.Pq Qq No-op
268eda14cbcSMatt Macysend.
269eda14cbcSMatt MacyDo not generate any actual send data.
270eda14cbcSMatt MacyThis is useful in conjunction with the
271eda14cbcSMatt Macy.Fl v
272eda14cbcSMatt Macyor
273eda14cbcSMatt Macy.Fl P
274eda14cbcSMatt Macyflags to determine what data will be sent.
275eda14cbcSMatt MacyIn this case, the verbose output will be written to standard output
276eda14cbcSMatt Macy.Po contrast with a non-dry-run, where the stream is written to standard output
277eda14cbcSMatt Macyand the verbose output goes to standard error
278eda14cbcSMatt Macy.Pc .
279eda14cbcSMatt Macy.It Fl p , -props
280eda14cbcSMatt MacyInclude the dataset's properties in the stream.
281eda14cbcSMatt MacyThis flag is implicit when
282eda14cbcSMatt Macy.Fl R
283eda14cbcSMatt Macyis specified.
28416038816SMartin MatuskaThe receiving system must also support this feature.
28516038816SMartin MatuskaSends of encrypted datasets must use
286eda14cbcSMatt Macy.Fl w
287eda14cbcSMatt Macywhen using this flag.
28816038816SMartin Matuska.It Fl s , -skip-missing
28916038816SMartin MatuskaAllows sending a replication stream even when there are snapshots missing in the
29016038816SMartin Matuskahierarchy.
29116038816SMartin MatuskaWhen a snapshot is missing, instead of throwing an error and aborting the send,
292bb2d13b6SMartin Matuskaa warning is printed to the standard error stream and the dataset to which it
293bb2d13b6SMartin Matuskabelongs
29416038816SMartin Matuskaand its descendents are skipped.
29516038816SMartin MatuskaThis flag can only be used in conjunction with
29616038816SMartin Matuska.Fl R .
297eda14cbcSMatt Macy.It Fl v , -verbose
298eda14cbcSMatt MacyPrint verbose information about the stream package generated.
299eda14cbcSMatt MacyThis information includes a per-second report of how much data has been sent.
300eda14cbcSMatt Macy.Pp
301eda14cbcSMatt MacyThe format of the stream is committed.
302eda14cbcSMatt MacyYou will be able to receive your streams on future versions of ZFS.
303eda14cbcSMatt Macy.El
304eda14cbcSMatt Macy.It Xo
3057877fdebSMatt Macy.Nm zfs
306eda14cbcSMatt Macy.Cm send
307*15f0b8c3SMartin Matuska.Op Fl DLPVcenvw
308eda14cbcSMatt Macy.Op Fl i Ar snapshot Ns | Ns Ar bookmark
309eda14cbcSMatt Macy.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
310eda14cbcSMatt Macy.Xc
311eda14cbcSMatt MacyGenerate a send stream, which may be of a filesystem, and may be incremental
312eda14cbcSMatt Macyfrom a bookmark.
313eda14cbcSMatt MacyIf the destination is a filesystem or volume, the pool must be read-only, or the
314eda14cbcSMatt Macyfilesystem must not be mounted.
315eda14cbcSMatt MacyWhen the stream generated from a filesystem or volume is received, the default
316eda14cbcSMatt Macysnapshot name will be
317eda14cbcSMatt Macy.Qq --head-- .
3183f9d360cSMartin Matuska.Bl -tag -width "-D"
3193f9d360cSMartin Matuska.It Fl D , -dedup
3203f9d360cSMartin MatuskaDeduplicated send is no longer supported.
3213f9d360cSMartin MatuskaThis flag is accepted for backwards compatibility, but a regular,
3223f9d360cSMartin Matuskanon-deduplicated stream will be generated.
323eda14cbcSMatt Macy.It Fl L , -large-block
324716fd348SMartin MatuskaGenerate a stream which may contain blocks larger than 128 KiB.
325eda14cbcSMatt MacyThis flag has no effect if the
326eda14cbcSMatt Macy.Sy large_blocks
327eda14cbcSMatt Macypool feature is disabled, or if the
328eda14cbcSMatt Macy.Sy recordsize
329716fd348SMartin Matuskaproperty of this filesystem has never been set above 128 KiB.
330eda14cbcSMatt MacyThe receiving system must have the
331eda14cbcSMatt Macy.Sy large_blocks
332eda14cbcSMatt Macypool feature enabled as well.
333eda14cbcSMatt MacySee
3343ff01b23SMartin Matuska.Xr zpool-features 7
335eda14cbcSMatt Macyfor details on ZFS feature flags and the
336eda14cbcSMatt Macy.Sy large_blocks
337eda14cbcSMatt Macyfeature.
338eda14cbcSMatt Macy.It Fl P , -parsable
339eda14cbcSMatt MacyPrint machine-parsable verbose information about the stream package generated.
340eda14cbcSMatt Macy.It Fl c , -compressed
341eda14cbcSMatt MacyGenerate a more compact stream by using compressed WRITE records for blocks
342eda14cbcSMatt Macywhich are compressed on disk and in memory
343eda14cbcSMatt Macy.Po see the
344eda14cbcSMatt Macy.Sy compression
345eda14cbcSMatt Macyproperty for details
346eda14cbcSMatt Macy.Pc .
347eda14cbcSMatt MacyIf the
348eda14cbcSMatt Macy.Sy lz4_compress
349eda14cbcSMatt Macyfeature is active on the sending system, then the receiving system must have
350eda14cbcSMatt Macythat feature enabled as well.
351eda14cbcSMatt MacyIf the
352eda14cbcSMatt Macy.Sy large_blocks
353eda14cbcSMatt Macyfeature is enabled on the sending system but the
354eda14cbcSMatt Macy.Fl L
355eda14cbcSMatt Macyoption is not supplied in conjunction with
356eda14cbcSMatt Macy.Fl c ,
357eda14cbcSMatt Macythen the data will be decompressed before sending so it can be split into
358eda14cbcSMatt Macysmaller block sizes.
359eda14cbcSMatt Macy.It Fl w , -raw
36016038816SMartin MatuskaFor encrypted datasets, send data exactly as it exists on disk.
361bb2d13b6SMartin MatuskaThis allows backups to be taken even if encryption keys are not currently
362bb2d13b6SMartin Matuskaloaded.
36316038816SMartin MatuskaThe backup may then be received on an untrusted machine since that machine will
364eda14cbcSMatt Macynot have the encryption keys to read the protected data or alter it without
36516038816SMartin Matuskabeing detected.
36616038816SMartin MatuskaUpon being received, the dataset will have the same encryption
367eda14cbcSMatt Macykeys as it did on the send side, although the
368eda14cbcSMatt Macy.Sy keylocation
369eda14cbcSMatt Macyproperty will be defaulted to
370eda14cbcSMatt Macy.Sy prompt
37116038816SMartin Matuskaif not otherwise provided.
37216038816SMartin MatuskaFor unencrypted datasets, this flag will be equivalent to
373eda14cbcSMatt Macy.Fl Lec .
374eda14cbcSMatt MacyNote that if you do not use this flag for sending encrypted datasets, data will
375eda14cbcSMatt Macybe sent unencrypted and may be re-encrypted with a different encryption key on
376eda14cbcSMatt Macythe receiving system, which will disable the ability to do a raw send to that
377eda14cbcSMatt Macysystem for incrementals.
378eda14cbcSMatt Macy.It Fl e , -embed
379eda14cbcSMatt MacyGenerate a more compact stream by using
380eda14cbcSMatt Macy.Sy WRITE_EMBEDDED
381eda14cbcSMatt Macyrecords for blocks which are stored more compactly on disk by the
382eda14cbcSMatt Macy.Sy embedded_data
383eda14cbcSMatt Macypool feature.
384eda14cbcSMatt MacyThis flag has no effect if the
385eda14cbcSMatt Macy.Sy embedded_data
386eda14cbcSMatt Macyfeature is disabled.
387eda14cbcSMatt MacyThe receiving system must have the
388eda14cbcSMatt Macy.Sy embedded_data
389eda14cbcSMatt Macyfeature enabled.
390eda14cbcSMatt MacyIf the
391eda14cbcSMatt Macy.Sy lz4_compress
392eda14cbcSMatt Macyfeature is active on the sending system, then the receiving system must have
39316038816SMartin Matuskathat feature enabled as well.
394bb2d13b6SMartin MatuskaDatasets that are sent with this flag may not be received as an encrypted
395bb2d13b6SMartin Matuskadataset,
39616038816SMartin Matuskasince encrypted datasets cannot use the
397eda14cbcSMatt Macy.Sy embedded_data
398eda14cbcSMatt Macyfeature.
399eda14cbcSMatt MacySee
4003ff01b23SMartin Matuska.Xr zpool-features 7
401eda14cbcSMatt Macyfor details on ZFS feature flags and the
402eda14cbcSMatt Macy.Sy embedded_data
403eda14cbcSMatt Macyfeature.
404eda14cbcSMatt Macy.It Fl i Ar snapshot Ns | Ns Ar bookmark
405eda14cbcSMatt MacyGenerate an incremental send stream.
406eda14cbcSMatt MacyThe incremental source must be an earlier snapshot in the destination's history.
407eda14cbcSMatt MacyIt will commonly be an earlier snapshot in the destination's file system, in
408eda14cbcSMatt Macywhich case it can be specified as the last component of the name
409eda14cbcSMatt Macy.Po the
410eda14cbcSMatt Macy.Sy #
411eda14cbcSMatt Macyor
412eda14cbcSMatt Macy.Sy @
413eda14cbcSMatt Macycharacter and following
414eda14cbcSMatt Macy.Pc .
415eda14cbcSMatt Macy.Pp
416eda14cbcSMatt MacyIf the incremental target is a clone, the incremental source can be the origin
417eda14cbcSMatt Macysnapshot, or an earlier snapshot in the origin's filesystem, or the origin's
418eda14cbcSMatt Macyorigin, etc.
419eda14cbcSMatt Macy.It Fl n , -dryrun
420eda14cbcSMatt MacyDo a dry-run
421eda14cbcSMatt Macy.Pq Qq No-op
422eda14cbcSMatt Macysend.
423eda14cbcSMatt MacyDo not generate any actual send data.
424eda14cbcSMatt MacyThis is useful in conjunction with the
425eda14cbcSMatt Macy.Fl v
426eda14cbcSMatt Macyor
427eda14cbcSMatt Macy.Fl P
428eda14cbcSMatt Macyflags to determine what data will be sent.
429eda14cbcSMatt MacyIn this case, the verbose output will be written to standard output
430eda14cbcSMatt Macy.Po contrast with a non-dry-run, where the stream is written to standard output
431eda14cbcSMatt Macyand the verbose output goes to standard error
432eda14cbcSMatt Macy.Pc .
433eda14cbcSMatt Macy.It Fl v , -verbose
434eda14cbcSMatt MacyPrint verbose information about the stream package generated.
435eda14cbcSMatt MacyThis information includes a per-second report of how much data has been sent.
436eda14cbcSMatt Macy.El
437eda14cbcSMatt Macy.It Xo
4387877fdebSMatt Macy.Nm zfs
439eda14cbcSMatt Macy.Cm send
440eda14cbcSMatt Macy.Fl -redact Ar redaction_bookmark
441*15f0b8c3SMartin Matuska.Op Fl DLPVcenpv
442eda14cbcSMatt Macy.Op Fl i Ar snapshot Ns | Ns Ar bookmark
443eda14cbcSMatt Macy.Ar snapshot
444eda14cbcSMatt Macy.Xc
445eda14cbcSMatt MacyGenerate a redacted send stream.
446eda14cbcSMatt MacyThis send stream contains all blocks from the snapshot being sent that aren't
447eda14cbcSMatt Macyincluded in the redaction list contained in the bookmark specified by the
448eda14cbcSMatt Macy.Fl -redact
449eda14cbcSMatt Macy(or
45016038816SMartin Matuska.Fl d )
45116038816SMartin Matuskaflag.
452eda14cbcSMatt MacyThe resulting send stream is said to be redacted with respect to the snapshots
453eda14cbcSMatt Macythe bookmark specified by the
454eda14cbcSMatt Macy.Fl -redact No flag was created with .
455eda14cbcSMatt MacyThe bookmark must have been created by running
45616038816SMartin Matuska.Nm zfs Cm redact
457eda14cbcSMatt Macyon the snapshot being sent.
45816038816SMartin Matuska.Pp
459eda14cbcSMatt MacyThis feature can be used to allow clones of a filesystem to be made available on
460eda14cbcSMatt Macya remote system, in the case where their parent need not (or needs to not) be
461eda14cbcSMatt Macyusable.
462eda14cbcSMatt MacyFor example, if a filesystem contains sensitive data, and it has clones where
463eda14cbcSMatt Macythat sensitive data has been secured or replaced with dummy data, redacted sends
464eda14cbcSMatt Macycan be used to replicate the secured data without replicating the original
465eda14cbcSMatt Macysensitive data, while still sharing all possible blocks.
466eda14cbcSMatt MacyA snapshot that has been redacted with respect to a set of snapshots will
467eda14cbcSMatt Macycontain all blocks referenced by at least one snapshot in the set, but will
468eda14cbcSMatt Macycontain none of the blocks referenced by none of the snapshots in the set.
469eda14cbcSMatt MacyIn other words, if all snapshots in the set have modified a given block in the
470eda14cbcSMatt Macyparent, that block will not be sent; but if one or more snapshots have not
471eda14cbcSMatt Macymodified a block in the parent, they will still reference the parent's block, so
472eda14cbcSMatt Macythat block will be sent.
473eda14cbcSMatt MacyNote that only user data will be redacted.
47416038816SMartin Matuska.Pp
475eda14cbcSMatt MacyWhen the redacted send stream is received, we will generate a redacted
476eda14cbcSMatt Macysnapshot.
477eda14cbcSMatt MacyDue to the nature of redaction, a redacted dataset can only be used in the
478eda14cbcSMatt Macyfollowing ways:
47916038816SMartin Matuska.Bl -enum -width "a."
48016038816SMartin Matuska.It
48116038816SMartin MatuskaTo receive, as a clone, an incremental send from the original snapshot to one
482eda14cbcSMatt Macyof the snapshots it was redacted with respect to.
483eda14cbcSMatt MacyIn this case, the stream will produce a valid dataset when received because all
484eda14cbcSMatt Macyblocks that were redacted in the parent are guaranteed to be present in the
485eda14cbcSMatt Macychild's send stream.
486eda14cbcSMatt MacyThis use case will produce a normal snapshot, which can be used just like other
487eda14cbcSMatt Macysnapshots.
48816038816SMartin Matuska.
48916038816SMartin Matuska.It
49016038816SMartin MatuskaTo receive an incremental send from the original snapshot to something
491eda14cbcSMatt Macyredacted with respect to a subset of the set of snapshots the initial snapshot
492eda14cbcSMatt Macywas redacted with respect to.
493eda14cbcSMatt MacyIn this case, each block that was redacted in the original is still redacted
494eda14cbcSMatt Macy(redacting with respect to additional snapshots causes less data to be redacted
495eda14cbcSMatt Macy(because the snapshots define what is permitted, and everything else is
496eda14cbcSMatt Macyredacted)).
497eda14cbcSMatt MacyThis use case will produce a new redacted snapshot.
49816038816SMartin Matuska.It
49916038816SMartin MatuskaTo receive an incremental send from a redaction bookmark of the original
500eda14cbcSMatt Macysnapshot that was created when redacting with respect to a subset of the set of
501eda14cbcSMatt Macysnapshots the initial snapshot was created with respect to
502eda14cbcSMatt Macyanything else.
503eda14cbcSMatt MacyA send stream from such a redaction bookmark will contain all of the blocks
504eda14cbcSMatt Macynecessary to fill in any redacted data, should it be needed, because the sending
505eda14cbcSMatt Macysystem is aware of what blocks were originally redacted.
506eda14cbcSMatt MacyThis will either produce a normal snapshot or a redacted one, depending on
507eda14cbcSMatt Macywhether the new send stream is redacted.
50816038816SMartin Matuska.It
50916038816SMartin MatuskaTo receive an incremental send from a redacted version of the initial
510eda14cbcSMatt Macysnapshot that is redacted with respect to a subject of the set of snapshots the
511eda14cbcSMatt Macyinitial snapshot was created with respect to.
512eda14cbcSMatt MacyA send stream from a compatible redacted dataset will contain all of the blocks
513eda14cbcSMatt Macynecessary to fill in any redacted data.
514eda14cbcSMatt MacyThis will either produce a normal snapshot or a redacted one, depending on
515eda14cbcSMatt Macywhether the new send stream is redacted.
51616038816SMartin Matuska.It
51716038816SMartin MatuskaTo receive a full send as a clone of the redacted snapshot.
518eda14cbcSMatt MacySince the stream is a full send, it definitionally contains all the data needed
519eda14cbcSMatt Macyto create a new dataset.
520eda14cbcSMatt MacyThis use case will either produce a normal snapshot or a redacted one, depending
521eda14cbcSMatt Macyon whether the full send stream was redacted.
52216038816SMartin Matuska.El
52316038816SMartin Matuska.Pp
52416038816SMartin MatuskaThese restrictions are detected and enforced by
52516038816SMartin Matuska.Nm zfs Cm receive ;
52616038816SMartin Matuskaa redacted send stream will contain the list of snapshots that the stream is
527eda14cbcSMatt Macyredacted with respect to.
528eda14cbcSMatt MacyThese are stored with the redacted snapshot, and are used to detect and
52916038816SMartin Matuskacorrectly handle the cases above.
53016038816SMartin MatuskaNote that for technical reasons,
53116038816SMartin Matuskaraw sends and redacted sends cannot be combined at this time.
532eda14cbcSMatt Macy.It Xo
5337877fdebSMatt Macy.Nm zfs
534eda14cbcSMatt Macy.Cm send
535*15f0b8c3SMartin Matuska.Op Fl PVenv
536eda14cbcSMatt Macy.Fl t
537eda14cbcSMatt Macy.Ar receive_resume_token
538eda14cbcSMatt Macy.Xc
539eda14cbcSMatt MacyCreates a send stream which resumes an interrupted receive.
540eda14cbcSMatt MacyThe
541eda14cbcSMatt Macy.Ar receive_resume_token
542eda14cbcSMatt Macyis the value of this property on the filesystem or volume that was being
543eda14cbcSMatt Macyreceived into.
544eda14cbcSMatt MacySee the documentation for
54516038816SMartin Matuska.Nm zfs Cm receive Fl s
546eda14cbcSMatt Macyfor more details.
547eda14cbcSMatt Macy.It Xo
5487877fdebSMatt Macy.Nm zfs
549eda14cbcSMatt Macy.Cm send
550*15f0b8c3SMartin Matuska.Op Fl PVnv
551eda14cbcSMatt Macy.Op Fl i Ar snapshot Ns | Ns Ar bookmark
552eda14cbcSMatt Macy.Fl S
553eda14cbcSMatt Macy.Ar filesystem
554eda14cbcSMatt Macy.Xc
555eda14cbcSMatt MacyGenerate a send stream from a dataset that has been partially received.
556eda14cbcSMatt Macy.Bl -tag -width "-L"
557eda14cbcSMatt Macy.It Fl S , -saved
558eda14cbcSMatt MacyThis flag requires that the specified filesystem previously received a resumable
55916038816SMartin Matuskasend that did not finish and was interrupted.
56016038816SMartin MatuskaIn such scenarios this flag
56116038816SMartin Matuskaenables the user to send this partially received state.
56216038816SMartin MatuskaUsing this flag will always use the last fully received snapshot
56316038816SMartin Matuskaas the incremental source if it exists.
564eda14cbcSMatt Macy.El
565eda14cbcSMatt Macy.It Xo
5667877fdebSMatt Macy.Nm zfs
567eda14cbcSMatt Macy.Cm redact
568eda14cbcSMatt Macy.Ar snapshot redaction_bookmark
56916038816SMartin Matuska.Ar redaction_snapshot Ns …
570eda14cbcSMatt Macy.Xc
571eda14cbcSMatt MacyGenerate a new redaction bookmark.
572eda14cbcSMatt MacyIn addition to the typical bookmark information, a redaction bookmark contains
573eda14cbcSMatt Macythe list of redacted blocks and the list of redaction snapshots specified.
574eda14cbcSMatt MacyThe redacted blocks are blocks in the snapshot which are not referenced by any
575eda14cbcSMatt Macyof the redaction snapshots.
576eda14cbcSMatt MacyThese blocks are found by iterating over the metadata in each redaction snapshot
577eda14cbcSMatt Macyto determine what has been changed since the target snapshot.
578eda14cbcSMatt MacyRedaction is designed to support redacted zfs sends; see the entry for
57916038816SMartin Matuska.Nm zfs Cm send
580eda14cbcSMatt Macyfor more information on the purpose of this operation.
581eda14cbcSMatt MacyIf a redact operation fails partway through (due to an error or a system
582eda14cbcSMatt Macyfailure), the redaction can be resumed by rerunning the same command.
583eda14cbcSMatt Macy.El
584eda14cbcSMatt Macy.Ss Redaction
585eda14cbcSMatt MacyZFS has support for a limited version of data subsetting, in the form of
58616038816SMartin Matuskaredaction.
58716038816SMartin MatuskaUsing the
58816038816SMartin Matuska.Nm zfs Cm redact
589eda14cbcSMatt Macycommand, a
590eda14cbcSMatt Macy.Sy redaction bookmark
59116038816SMartin Matuskacan be created that stores a list of blocks containing sensitive information.
59216038816SMartin MatuskaWhen provided to
59316038816SMartin Matuska.Nm zfs Cm send ,
594eda14cbcSMatt Macythis causes a
595eda14cbcSMatt Macy.Sy redacted send
59616038816SMartin Matuskato occur.
59716038816SMartin MatuskaRedacted sends omit the blocks containing sensitive information,
59816038816SMartin Matuskareplacing them with REDACT records.
59916038816SMartin MatuskaWhen these send streams are received, a
600eda14cbcSMatt Macy.Sy redacted dataset
60116038816SMartin Matuskais created.
60216038816SMartin MatuskaA redacted dataset cannot be mounted by default, since it is incomplete.
60316038816SMartin MatuskaIt can be used to receive other send streams.
60416038816SMartin MatuskaIn this way datasets can be used for data backup and replication,
60516038816SMartin Matuskawith all the benefits that zfs send and receive have to offer,
60616038816SMartin Matuskawhile protecting sensitive information from being
607eda14cbcSMatt Macystored on less-trusted machines or services.
608eda14cbcSMatt Macy.Pp
60916038816SMartin MatuskaFor the purposes of redaction, there are two steps to the process.
61016038816SMartin MatuskaA redact step, and a send/receive step.
61116038816SMartin MatuskaFirst, a redaction bookmark is created.
61216038816SMartin MatuskaThis is done by providing the
61316038816SMartin Matuska.Nm zfs Cm redact
614eda14cbcSMatt Macycommand with a parent snapshot, a bookmark to be created, and a number of
61516038816SMartin Matuskaredaction snapshots.
61616038816SMartin MatuskaThese redaction snapshots must be descendants of the parent snapshot,
61716038816SMartin Matuskaand they should modify data that is considered sensitive in some way.
61816038816SMartin MatuskaAny blocks of data modified by all of the redaction snapshots will
619eda14cbcSMatt Macybe listed in the redaction bookmark, because it represents the truly sensitive
62016038816SMartin Matuskainformation.
62116038816SMartin MatuskaWhen it comes to the send step, the send process will not send
622eda14cbcSMatt Macythe blocks listed in the redaction bookmark, instead replacing them with
62316038816SMartin MatuskaREDACT records.
62416038816SMartin MatuskaWhen received on the target system, this will create a
625eda14cbcSMatt Macyredacted dataset, missing the data that corresponds to the blocks in the
62616038816SMartin Matuskaredaction bookmark on the sending system.
62716038816SMartin MatuskaThe incremental send streams from
628eda14cbcSMatt Macythe original parent to the redaction snapshots can then also be received on
629eda14cbcSMatt Macythe target system, and this will produce a complete snapshot that can be used
63016038816SMartin Matuskanormally.
63116038816SMartin MatuskaIncrementals from one snapshot on the parent filesystem and another
632eda14cbcSMatt Macycan also be done by sending from the redaction bookmark, rather than the
633eda14cbcSMatt Macysnapshots themselves.
634eda14cbcSMatt Macy.Pp
63516038816SMartin MatuskaIn order to make the purpose of the feature more clear, an example is provided.
63616038816SMartin MatuskaConsider a zfs filesystem containing four files.
63716038816SMartin MatuskaThese files represent information for an online shopping service.
638bb2d13b6SMartin MatuskaOne file contains a list of usernames and passwords, another contains purchase
639bb2d13b6SMartin Matuskahistories,
64016038816SMartin Matuskaa third contains click tracking data, and a fourth contains user preferences.
64116038816SMartin MatuskaThe owner of this data wants to make it available for their development teams to
64216038816SMartin Matuskatest against, and their market research teams to do analysis on.
64316038816SMartin MatuskaThe development teams need information about user preferences and the click
644eda14cbcSMatt Macytracking data, while the market research teams need information about purchase
64516038816SMartin Matuskahistories and user preferences.
64616038816SMartin MatuskaNeither needs access to the usernames and passwords.
64716038816SMartin MatuskaHowever, because all of this data is stored in one ZFS filesystem,
64816038816SMartin Matuskait must all be sent and received together.
64916038816SMartin MatuskaIn addition, the owner of the data
650eda14cbcSMatt Macywants to take advantage of features like compression, checksumming, and
651bb2d13b6SMartin Matuskasnapshots, so they do want to continue to use ZFS to store and transmit their
652bb2d13b6SMartin Matuskadata.
65316038816SMartin MatuskaRedaction can help them do so.
65416038816SMartin MatuskaFirst, they would make two clones of a snapshot of the data on the source.
65516038816SMartin MatuskaIn one clone, they create the setup they want their market research team to see;
65616038816SMartin Matuskathey delete the usernames and passwords file,
65716038816SMartin Matuskaand overwrite the click tracking data with dummy information.
65816038816SMartin MatuskaIn another, they create the setup they want the development teams
659eda14cbcSMatt Macyto see, by replacing the passwords with fake information and replacing the
66016038816SMartin Matuskapurchase histories with randomly generated ones.
66116038816SMartin MatuskaThey would then create a redaction bookmark on the parent snapshot,
66216038816SMartin Matuskausing snapshots on the two clones as redaction snapshots.
66316038816SMartin MatuskaThe parent can then be sent, redacted, to the target
66416038816SMartin Matuskaserver where the research and development teams have access.
665bb2d13b6SMartin MatuskaFinally, incremental sends from the parent snapshot to each of the clones can be
666bb2d13b6SMartin Matuskasent
667eda14cbcSMatt Macyto and received on the target server; these snapshots are identical to the
668eda14cbcSMatt Macyones on the source, and are ready to be used, while the parent snapshot on the
669eda14cbcSMatt Macytarget contains none of the username and password data present on the source,
670eda14cbcSMatt Macybecause it was removed by the redacted send operation.
67116038816SMartin Matuska.
672da5137abSMartin Matuska.Sh EXAMPLES
673da5137abSMartin Matuska.\" These are, respectively, examples 12, 13 from zfs.8
674da5137abSMartin Matuska.\" Make sure to update them bidirectionally
675da5137abSMartin Matuska.Ss Example 1 : No Remotely Replicating ZFS Data
676da5137abSMartin MatuskaThe following commands send a full stream and then an incremental stream to a
677da5137abSMartin Matuskaremote machine, restoring them into
678da5137abSMartin Matuska.Em poolB/received/fs@a
679da5137abSMartin Matuskaand
680da5137abSMartin Matuska.Em poolB/received/fs@b ,
681da5137abSMartin Matuskarespectively.
682da5137abSMartin Matuska.Em poolB
683da5137abSMartin Matuskamust contain the file system
684da5137abSMartin Matuska.Em poolB/received ,
685da5137abSMartin Matuskaand must not initially contain
686da5137abSMartin Matuska.Em poolB/received/fs .
687da5137abSMartin Matuska.Bd -literal -compact -offset Ds
688da5137abSMartin Matuska.No # Nm zfs Cm send Ar pool/fs@a |
689da5137abSMartin Matuska.No "   " Nm ssh Ar host Nm zfs Cm receive Ar poolB/received/fs Ns @ Ns Ar a
690da5137abSMartin Matuska.No # Nm zfs Cm send Fl i Ar a pool/fs@b |
691da5137abSMartin Matuska.No "   " Nm ssh Ar host Nm zfs Cm receive Ar poolB/received/fs
692da5137abSMartin Matuska.Ed
693da5137abSMartin Matuska.
694da5137abSMartin Matuska.Ss Example 2 : No Using the Nm zfs Cm receive Fl d No Option
695da5137abSMartin MatuskaThe following command sends a full stream of
696da5137abSMartin Matuska.Ar poolA/fsA/fsB@snap
697da5137abSMartin Matuskato a remote machine, receiving it into
698da5137abSMartin Matuska.Ar poolB/received/fsA/fsB@snap .
699da5137abSMartin MatuskaThe
700da5137abSMartin Matuska.Ar fsA/fsB@snap
701da5137abSMartin Matuskaportion of the received snapshot's name is determined from the name of the sent
702da5137abSMartin Matuskasnapshot.
703da5137abSMartin Matuska.Ar poolB
704da5137abSMartin Matuskamust contain the file system
705da5137abSMartin Matuska.Ar poolB/received .
706da5137abSMartin MatuskaIf
707da5137abSMartin Matuska.Ar poolB/received/fsA
708da5137abSMartin Matuskadoes not exist, it is created as an empty file system.
709da5137abSMartin Matuska.Bd -literal -compact -offset Ds
710da5137abSMartin Matuska.No # Nm zfs Cm send Ar poolA/fsA/fsB@snap |
711da5137abSMartin Matuska.No "   " Nm ssh Ar host Nm zfs Cm receive Fl d Ar poolB/received
712da5137abSMartin Matuska.Ed
713da5137abSMartin Matuska.
714eda14cbcSMatt Macy.Sh SEE ALSO
715eda14cbcSMatt Macy.Xr zfs-bookmark 8 ,
716eda14cbcSMatt Macy.Xr zfs-receive 8 ,
717eda14cbcSMatt Macy.Xr zfs-redact 8 ,
718eda14cbcSMatt Macy.Xr zfs-snapshot 8
719