4 .\" The contents of this file are subject to the terms of the
5 .\" Common Development and Distribution License (the "License").
6 .\" You may not use this file except in compliance with the License.
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 .\" or http://www.opensolaris.org/os/licensing.
10 .\" See the License for the specific language governing permissions
11 .\" and limitations under the License.
13 .\" When distributing Covered Code, include this CDDL HEADER in each
14 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 .\" If applicable, add the following below this CDDL HEADER, with the
16 .\" fields enclosed by brackets "[]" replaced with your own identifying
17 .\" information: Portions Copyright [yyyy] [name of copyright owner]
22 .\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
23 .\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
24 .\" Copyright (c) 2011, 2019 by Delphix. All rights reserved.
25 .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
26 .\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
27 .\" Copyright (c) 2014 by Adam Stevko. All rights reserved.
28 .\" Copyright (c) 2014 Integros [integros.com]
29 .\" Copyright 2019 Richard Laager. All rights reserved.
30 .\" Copyright 2018 Nexenta Systems, Inc.
31 .\" Copyright 2019 Joyent, Inc.
38 .Nd Generate a send stream, which may be of a filesystem, and may be incremental from a bookmark.
43 .Op Oo Fl I Ns | Ns Fl i Oc Ar snapshot
48 .Op Fl i Ar snapshot Ns | Ns Ar bookmark
49 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
52 .Fl -redact Ar redaction_bookmark
55 .Op Fl i Ar snapshot Ns | Ns Ar bookmark
61 .Ar receive_resume_token
68 .Ar snapshot redaction_bookmark
69 .Ar redaction_snapshot Ns ...
76 .Op Oo Fl I Ns | Ns Fl i Oc Ar snapshot
79 Creates a stream representation of the second
81 which is written to standard output.
82 The output can be redirected to a file or to a different system
83 .Po for example, using
86 By default, a full stream is generated.
89 Deduplicated send is no longer supported.
90 This flag is accepted for backwards compatibility, but a regular,
91 non-deduplicated stream will be generated.
93 Generate a stream package that sends all intermediary snapshots from the first
94 snapshot to the second snapshot.
98 .Fl i Em @a Em fs@b Ns \&; Fl i Em @b Em fs@c Ns \&; Fl i Em @c Em fs@d .
99 The incremental source may be specified as with the
102 .It Fl L, -large-block
103 Generate a stream which may contain blocks larger than 128KB.
104 This flag has no effect if the
106 pool feature is disabled, or if the
108 property of this filesystem has never been set above 128KB.
109 The receiving system must have the
111 pool feature enabled as well.
114 for details on ZFS feature flags and the
118 Print machine-parsable verbose information about the stream package generated.
120 Generate a replication stream package, which will replicate the specified
121 file system, and all descendent file systems, up to the named snapshot.
122 When received, all properties, snapshots, descendent file systems, and clones
129 flags are used in conjunction with the
131 flag, an incremental replication stream is generated.
132 The current values of properties, and current snapshot and file system names are
133 set when the stream is received.
136 flag is specified when this stream is received, snapshots and file systems that
137 do not exist on the sending side are destroyed. If the
139 flag is used to send encrypted datasets, then
141 must also be specified.
143 Generate a more compact stream by using
145 records for blocks which are stored more compactly on disk by the
148 This flag has no effect if the
151 The receiving system must have the
156 feature is active on the sending system, then the receiving system must have
157 that feature enabled as well. Datasets that are sent with this flag may not be
158 received as an encrypted dataset, since encrypted datasets cannot use the
163 for details on ZFS feature flags and the
167 Sends only received property values whether or not they are overridden by local
168 settings, but only if the dataset has ever been received. Use this option when
171 to restore received properties backed up on the sent dataset and to avoid
172 sending local settings that may have nothing to do with the source dataset,
173 but only with how the data is backed up.
174 .It Fl c, -compressed
175 Generate a more compact stream by using compressed WRITE records for blocks
176 which are compressed on disk and in memory
183 feature is active on the sending system, then the receiving system must have
184 that feature enabled as well.
187 feature is enabled on the sending system but the
189 option is not supplied in conjunction with
191 then the data will be decompressed before sending so it can be split into
194 For encrypted datasets, send data exactly as it exists on disk. This allows
195 backups to be taken even if encryption keys are not currently loaded. The
196 backup may then be received on an untrusted machine since that machine will
197 not have the encryption keys to read the protected data or alter it without
198 being detected. Upon being received, the dataset will have the same encryption
199 keys as it did on the send side, although the
201 property will be defaulted to
203 if not otherwise provided. For unencrypted datasets, this flag will be
206 Note that if you do not use this flag for sending encrypted datasets, data will
207 be sent unencrypted and may be re-encrypted with a different encryption key on
208 the receiving system, which will disable the ability to do a raw send to that
209 system for incrementals.
211 Generate a stream package that includes any snapshot holds (created with the
213 command), and indicating to
215 that the holds be applied to the dataset on the receiving system.
217 Generate an incremental stream from the first
219 .Pq the incremental source
222 .Pq the incremental target .
223 The incremental source can be specified as the last component of the snapshot
227 character and following
229 and it is assumed to be from the same file system as the incremental target.
231 If the destination is a clone, the source may be the origin snapshot, which must
242 Do not generate any actual send data.
243 This is useful in conjunction with the
247 flags to determine what data will be sent.
248 In this case, the verbose output will be written to standard output
249 .Po contrast with a non-dry-run, where the stream is written to standard output
250 and the verbose output goes to standard error
253 Include the dataset's properties in the stream.
254 This flag is implicit when
257 The receiving system must also support this feature. Sends of encrypted datasets
260 when using this flag.
262 Print verbose information about the stream package generated.
263 This information includes a per-second report of how much data has been sent.
265 The format of the stream is committed.
266 You will be able to receive your streams on future versions of ZFS.
272 .Op Fl i Ar snapshot Ns | Ns Ar bookmark
273 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
275 Generate a send stream, which may be of a filesystem, and may be incremental
277 If the destination is a filesystem or volume, the pool must be read-only, or the
278 filesystem must not be mounted.
279 When the stream generated from a filesystem or volume is received, the default
280 snapshot name will be
283 .It Fl L, -large-block
284 Generate a stream which may contain blocks larger than 128KB.
285 This flag has no effect if the
287 pool feature is disabled, or if the
289 property of this filesystem has never been set above 128KB.
290 The receiving system must have the
292 pool feature enabled as well.
295 for details on ZFS feature flags and the
299 Print machine-parsable verbose information about the stream package generated.
300 .It Fl c, -compressed
301 Generate a more compact stream by using compressed WRITE records for blocks
302 which are compressed on disk and in memory
309 feature is active on the sending system, then the receiving system must have
310 that feature enabled as well.
313 feature is enabled on the sending system but the
315 option is not supplied in conjunction with
317 then the data will be decompressed before sending so it can be split into
320 For encrypted datasets, send data exactly as it exists on disk. This allows
321 backups to be taken even if encryption keys are not currently loaded. The
322 backup may then be received on an untrusted machine since that machine will
323 not have the encryption keys to read the protected data or alter it without
324 being detected. Upon being received, the dataset will have the same encryption
325 keys as it did on the send side, although the
327 property will be defaulted to
329 if not otherwise provided. For unencrypted datasets, this flag will be
332 Note that if you do not use this flag for sending encrypted datasets, data will
333 be sent unencrypted and may be re-encrypted with a different encryption key on
334 the receiving system, which will disable the ability to do a raw send to that
335 system for incrementals.
337 Generate a more compact stream by using
339 records for blocks which are stored more compactly on disk by the
342 This flag has no effect if the
345 The receiving system must have the
350 feature is active on the sending system, then the receiving system must have
351 that feature enabled as well. Datasets that are sent with this flag may not be
352 received as an encrypted dataset, since encrypted datasets cannot use the
357 for details on ZFS feature flags and the
360 .It Fl i Ar snapshot Ns | Ns Ar bookmark
361 Generate an incremental send stream.
362 The incremental source must be an earlier snapshot in the destination's history.
363 It will commonly be an earlier snapshot in the destination's file system, in
364 which case it can be specified as the last component of the name
369 character and following
372 If the incremental target is a clone, the incremental source can be the origin
373 snapshot, or an earlier snapshot in the origin's filesystem, or the origin's
379 Do not generate any actual send data.
380 This is useful in conjunction with the
384 flags to determine what data will be sent.
385 In this case, the verbose output will be written to standard output
386 .Po contrast with a non-dry-run, where the stream is written to standard output
387 and the verbose output goes to standard error
390 Print verbose information about the stream package generated.
391 This information includes a per-second report of how much data has been sent.
396 .Fl -redact Ar redaction_bookmark
399 .Op Fl i Ar snapshot Ns | Ns Ar bookmark
402 Generate a redacted send stream.
403 This send stream contains all blocks from the snapshot being sent that aren't
404 included in the redaction list contained in the bookmark specified by the
409 The resulting send stream is said to be redacted with respect to the snapshots
410 the bookmark specified by the
411 .Fl -redact No flag was created with.
412 The bookmark must have been created by running
414 on the snapshot being sent.
416 This feature can be used to allow clones of a filesystem to be made available on
417 a remote system, in the case where their parent need not (or needs to not) be
419 For example, if a filesystem contains sensitive data, and it has clones where
420 that sensitive data has been secured or replaced with dummy data, redacted sends
421 can be used to replicate the secured data without replicating the original
422 sensitive data, while still sharing all possible blocks.
423 A snapshot that has been redacted with respect to a set of snapshots will
424 contain all blocks referenced by at least one snapshot in the set, but will
425 contain none of the blocks referenced by none of the snapshots in the set.
426 In other words, if all snapshots in the set have modified a given block in the
427 parent, that block will not be sent; but if one or more snapshots have not
428 modified a block in the parent, they will still reference the parent's block, so
429 that block will be sent.
430 Note that only user data will be redacted.
432 When the redacted send stream is received, we will generate a redacted
434 Due to the nature of redaction, a redacted dataset can only be used in the
437 1. To receive, as a clone, an incremental send from the original snapshot to one
438 of the snapshots it was redacted with respect to.
439 In this case, the stream will produce a valid dataset when received because all
440 blocks that were redacted in the parent are guaranteed to be present in the
442 This use case will produce a normal snapshot, which can be used just like other
445 2. To receive an incremental send from the original snapshot to something
446 redacted with respect to a subset of the set of snapshots the initial snapshot
447 was redacted with respect to.
448 In this case, each block that was redacted in the original is still redacted
449 (redacting with respect to additional snapshots causes less data to be redacted
450 (because the snapshots define what is permitted, and everything else is
452 This use case will produce a new redacted snapshot.
454 3. To receive an incremental send from a redaction bookmark of the original
455 snapshot that was created when redacting with respect to a subset of the set of
456 snapshots the initial snapshot was created with respect to
458 A send stream from such a redaction bookmark will contain all of the blocks
459 necessary to fill in any redacted data, should it be needed, because the sending
460 system is aware of what blocks were originally redacted.
461 This will either produce a normal snapshot or a redacted one, depending on
462 whether the new send stream is redacted.
464 4. To receive an incremental send from a redacted version of the initial
465 snapshot that is redacted with respect to a subject of the set of snapshots the
466 initial snapshot was created with respect to.
467 A send stream from a compatible redacted dataset will contain all of the blocks
468 necessary to fill in any redacted data.
469 This will either produce a normal snapshot or a redacted one, depending on
470 whether the new send stream is redacted.
472 5. To receive a full send as a clone of the redacted snapshot.
473 Since the stream is a full send, it definitionally contains all the data needed
474 to create a new dataset.
475 This use case will either produce a normal snapshot or a redacted one, depending
476 on whether the full send stream was redacted.
478 These restrictions are detected and enforced by \fBzfs receive\fR; a
479 redacted send stream will contain the list of snapshots that the stream is
480 redacted with respect to.
481 These are stored with the redacted snapshot, and are used to detect and
482 correctly handle the cases above. Note that for technical reasons, raw sends
483 and redacted sends cannot be combined at this time.
489 .Ar receive_resume_token
491 Creates a send stream which resumes an interrupted receive.
493 .Ar receive_resume_token
494 is the value of this property on the filesystem or volume that was being
496 See the documentation for
503 .Op Fl i Ar snapshot Ns | Ns Ar bookmark
507 Generate a send stream from a dataset that has been partially received.
510 This flag requires that the specified filesystem previously received a resumable
511 send that did not finish and was interrupted. In such scenarios this flag
512 enables the user to send this partially received state. Using this flag will
513 always use the last fully received snapshot as the incremental source if it
519 .Ar snapshot redaction_bookmark
520 .Ar redaction_snapshot Ns ...
522 Generate a new redaction bookmark.
523 In addition to the typical bookmark information, a redaction bookmark contains
524 the list of redacted blocks and the list of redaction snapshots specified.
525 The redacted blocks are blocks in the snapshot which are not referenced by any
526 of the redaction snapshots.
527 These blocks are found by iterating over the metadata in each redaction snapshot
528 to determine what has been changed since the target snapshot.
529 Redaction is designed to support redacted zfs sends; see the entry for
531 for more information on the purpose of this operation.
532 If a redact operation fails partway through (due to an error or a system
533 failure), the redaction can be resumed by rerunning the same command.
536 ZFS has support for a limited version of data subsetting, in the form of
540 .Sy redaction bookmark
541 can be created that stores a list of blocks containing sensitive information. When
547 to occur. Redacted sends omit the blocks containing sensitive information,
548 replacing them with REDACT records. When these send streams are received, a
550 is created. A redacted dataset cannot be mounted by default, since it is
551 incomplete. It can be used to receive other send streams. In this way datasets
552 can be used for data backup and replication, with all the benefits that zfs send
553 and receive have to offer, while protecting sensitive information from being
554 stored on less-trusted machines or services.
556 For the purposes of redaction, there are two steps to the process. A redact
557 step, and a send/receive step. First, a redaction bookmark is created. This is
558 done by providing the
560 command with a parent snapshot, a bookmark to be created, and a number of
561 redaction snapshots. These redaction snapshots must be descendants of the
562 parent snapshot, and they should modify data that is considered sensitive in
563 some way. Any blocks of data modified by all of the redaction snapshots will
564 be listed in the redaction bookmark, because it represents the truly sensitive
565 information. When it comes to the send step, the send process will not send
566 the blocks listed in the redaction bookmark, instead replacing them with
567 REDACT records. When received on the target system, this will create a
568 redacted dataset, missing the data that corresponds to the blocks in the
569 redaction bookmark on the sending system. The incremental send streams from
570 the original parent to the redaction snapshots can then also be received on
571 the target system, and this will produce a complete snapshot that can be used
572 normally. Incrementals from one snapshot on the parent filesystem and another
573 can also be done by sending from the redaction bookmark, rather than the
574 snapshots themselves.
576 In order to make the purpose of the feature more clear, an example is
577 provided. Consider a zfs filesystem containing four files. These files
578 represent information for an online shopping service. One file contains a list
579 of usernames and passwords, another contains purchase histories, a third
580 contains click tracking data, and a fourth contains user preferences. The
581 owner of this data wants to make it available for their development teams to
582 test against, and their market research teams to do analysis on. The
583 development teams need information about user preferences and the click
584 tracking data, while the market research teams need information about purchase
585 histories and user preferences. Neither needs access to the usernames and
586 passwords. However, because all of this data is stored in one ZFS filesystem,
587 it must all be sent and received together. In addition, the owner of the data
588 wants to take advantage of features like compression, checksumming, and
589 snapshots, so they do want to continue to use ZFS to store and transmit their
590 data. Redaction can help them do so. First, they would make two clones of a
591 snapshot of the data on the source. In one clone, they create the setup they
592 want their market research team to see; they delete the usernames and
593 passwords file, and overwrite the click tracking data with dummy
594 information. In another, they create the setup they want the development teams
595 to see, by replacing the passwords with fake information and replacing the
596 purchase histories with randomly generated ones. They would then create a
597 redaction bookmark on the parent snapshot, using snapshots on the two clones
598 as redaction snapshots. The parent can then be sent, redacted, to the target
599 server where the research and development teams have access. Finally,
600 incremental sends from the parent snapshot to each of the clones can be send
601 to and received on the target server; these snapshots are identical to the
602 ones on the source, and are ready to be used, while the parent snapshot on the
603 target contains none of the username and password data present on the source,
604 because it was removed by the redacted send operation.