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]
21 .\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
22 .\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
23 .\" Copyright (c) 2011, 2019 by Delphix. All rights reserved.
24 .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
25 .\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
26 .\" Copyright (c) 2014 by Adam Stevko. All rights reserved.
27 .\" Copyright (c) 2014 Integros [integros.com]
28 .\" Copyright 2019 Richard Laager. All rights reserved.
29 .\" Copyright 2018 Nexenta Systems, Inc.
30 .\" Copyright 2019 Joyent, Inc.
38 .Nd generate backup stream of ZFS dataset
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
54 .Op Fl i Ar snapshot Ns | Ns Ar bookmark
60 .Ar receive_resume_token
67 .Ar snapshot redaction_bookmark
68 .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.
119 .It Fl R , -replicate
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.
140 flag is used to send encrypted datasets, then
142 must also be specified.
144 Generate a more compact stream by using
146 records for blocks which are stored more compactly on disk by the
149 This flag has no effect if the
152 The receiving system must have the
157 feature is active on the sending system, then the receiving system must have
158 that feature enabled as well.
159 Datasets that are sent with this flag may not be
160 received as an encrypted dataset, since encrypted datasets cannot use the
165 for details on ZFS feature flags and the
169 Sends only received property values whether or not they are overridden by local
170 settings, but only if the dataset has ever been received.
171 Use this option when you want
173 to restore received properties backed up on the sent dataset and to avoid
174 sending local settings that may have nothing to do with the source dataset,
175 but only with how the data is backed up.
176 .It Fl c , -compressed
177 Generate a more compact stream by using compressed WRITE records for blocks
178 which are compressed on disk and in memory
185 feature is active on the sending system, then the receiving system must have
186 that feature enabled as well.
189 feature is enabled on the sending system but the
191 option is not supplied in conjunction with
193 then the data will be decompressed before sending so it can be split into
197 will not have their data recompressed on the receiver side using
198 .Fl o Sy compress Ns = Ar value .
199 The data will stay compressed as it was from the sender.
200 The new compression property will be set for future data.
202 For encrypted datasets, send data exactly as it exists on disk.
203 This allows backups to be taken even if encryption keys are not currently loaded.
204 The backup may then be received on an untrusted machine since that machine will
205 not have the encryption keys to read the protected data or alter it without
207 Upon being received, the dataset will have the same encryption
208 keys as it did on the send side, although the
210 property will be defaulted to
212 if not otherwise provided.
213 For unencrypted datasets, this flag will be equivalent to
215 Note that if you do not use this flag for sending encrypted datasets, data will
216 be sent unencrypted and may be re-encrypted with a different encryption key on
217 the receiving system, which will disable the ability to do a raw send to that
218 system for incrementals.
220 Generate a stream package that includes any snapshot holds (created with the
222 command), and indicating to
224 that the holds be applied to the dataset on the receiving system.
226 Generate an incremental stream from the first
228 .Pq the incremental source
231 .Pq the incremental target .
232 The incremental source can be specified as the last component of the snapshot
236 character and following
238 and it is assumed to be from the same file system as the incremental target.
240 If the destination is a clone, the source may be the origin snapshot, which must
251 Do not generate any actual send data.
252 This is useful in conjunction with the
256 flags to determine what data will be sent.
257 In this case, the verbose output will be written to standard output
258 .Po contrast with a non-dry-run, where the stream is written to standard output
259 and the verbose output goes to standard error
262 Include the dataset's properties in the stream.
263 This flag is implicit when
266 The receiving system must also support this feature.
267 Sends of encrypted datasets must use
269 when using this flag.
270 .It Fl s , -skip-missing
271 Allows sending a replication stream even when there are snapshots missing in the
273 When a snapshot is missing, instead of throwing an error and aborting the send,
274 a warning is printed to the standard error stream and the dataset to which it belongs
275 and its descendents are skipped.
276 This flag can only be used in conjunction with
279 Print verbose information about the stream package generated.
280 This information includes a per-second report of how much data has been sent.
282 The format of the stream is committed.
283 You will be able to receive your streams on future versions of ZFS.
289 .Op Fl i Ar snapshot Ns | Ns Ar bookmark
290 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
292 Generate a send stream, which may be of a filesystem, and may be incremental
294 If the destination is a filesystem or volume, the pool must be read-only, or the
295 filesystem must not be mounted.
296 When the stream generated from a filesystem or volume is received, the default
297 snapshot name will be
301 Deduplicated send is no longer supported.
302 This flag is accepted for backwards compatibility, but a regular,
303 non-deduplicated stream will be generated.
304 .It Fl L , -large-block
305 Generate a stream which may contain blocks larger than 128KB.
306 This flag has no effect if the
308 pool feature is disabled, or if the
310 property of this filesystem has never been set above 128KB.
311 The receiving system must have the
313 pool feature enabled as well.
316 for details on ZFS feature flags and the
320 Print machine-parsable verbose information about the stream package generated.
321 .It Fl c , -compressed
322 Generate a more compact stream by using compressed WRITE records for blocks
323 which are compressed on disk and in memory
330 feature is active on the sending system, then the receiving system must have
331 that feature enabled as well.
334 feature is enabled on the sending system but the
336 option is not supplied in conjunction with
338 then the data will be decompressed before sending so it can be split into
341 For encrypted datasets, send data exactly as it exists on disk.
342 This allows backups to be taken even if encryption keys are not currently loaded.
343 The backup may then be received on an untrusted machine since that machine will
344 not have the encryption keys to read the protected data or alter it without
346 Upon being received, the dataset will have the same encryption
347 keys as it did on the send side, although the
349 property will be defaulted to
351 if not otherwise provided.
352 For unencrypted datasets, this flag will be equivalent to
354 Note that if you do not use this flag for sending encrypted datasets, data will
355 be sent unencrypted and may be re-encrypted with a different encryption key on
356 the receiving system, which will disable the ability to do a raw send to that
357 system for incrementals.
359 Generate a more compact stream by using
361 records for blocks which are stored more compactly on disk by the
364 This flag has no effect if the
367 The receiving system must have the
372 feature is active on the sending system, then the receiving system must have
373 that feature enabled as well.
374 Datasets that are sent with this flag may not be received as an encrypted dataset,
375 since encrypted datasets cannot use the
380 for details on ZFS feature flags and the
383 .It Fl i Ar snapshot Ns | Ns Ar bookmark
384 Generate an incremental send stream.
385 The incremental source must be an earlier snapshot in the destination's history.
386 It will commonly be an earlier snapshot in the destination's file system, in
387 which case it can be specified as the last component of the name
392 character and following
395 If the incremental target is a clone, the incremental source can be the origin
396 snapshot, or an earlier snapshot in the origin's filesystem, or the origin's
402 Do not generate any actual send data.
403 This is useful in conjunction with the
407 flags to determine what data will be sent.
408 In this case, the verbose output will be written to standard output
409 .Po contrast with a non-dry-run, where the stream is written to standard output
410 and the verbose output goes to standard error
413 Print verbose information about the stream package generated.
414 This information includes a per-second report of how much data has been sent.
419 .Fl -redact Ar redaction_bookmark
421 .Op Fl i Ar snapshot Ns | Ns Ar bookmark
424 Generate a redacted send stream.
425 This send stream contains all blocks from the snapshot being sent that aren't
426 included in the redaction list contained in the bookmark specified by the
431 The resulting send stream is said to be redacted with respect to the snapshots
432 the bookmark specified by the
433 .Fl -redact No flag was created with.
434 The bookmark must have been created by running
436 on the snapshot being sent.
438 This feature can be used to allow clones of a filesystem to be made available on
439 a remote system, in the case where their parent need not (or needs to not) be
441 For example, if a filesystem contains sensitive data, and it has clones where
442 that sensitive data has been secured or replaced with dummy data, redacted sends
443 can be used to replicate the secured data without replicating the original
444 sensitive data, while still sharing all possible blocks.
445 A snapshot that has been redacted with respect to a set of snapshots will
446 contain all blocks referenced by at least one snapshot in the set, but will
447 contain none of the blocks referenced by none of the snapshots in the set.
448 In other words, if all snapshots in the set have modified a given block in the
449 parent, that block will not be sent; but if one or more snapshots have not
450 modified a block in the parent, they will still reference the parent's block, so
451 that block will be sent.
452 Note that only user data will be redacted.
454 When the redacted send stream is received, we will generate a redacted
456 Due to the nature of redaction, a redacted dataset can only be used in the
458 .Bl -enum -width "a."
460 To receive, as a clone, an incremental send from the original snapshot to one
461 of the snapshots it was redacted with respect to.
462 In this case, the stream will produce a valid dataset when received because all
463 blocks that were redacted in the parent are guaranteed to be present in the
465 This use case will produce a normal snapshot, which can be used just like other
469 To receive an incremental send from the original snapshot to something
470 redacted with respect to a subset of the set of snapshots the initial snapshot
471 was redacted with respect to.
472 In this case, each block that was redacted in the original is still redacted
473 (redacting with respect to additional snapshots causes less data to be redacted
474 (because the snapshots define what is permitted, and everything else is
476 This use case will produce a new redacted snapshot.
478 To receive an incremental send from a redaction bookmark of the original
479 snapshot that was created when redacting with respect to a subset of the set of
480 snapshots the initial snapshot was created with respect to
482 A send stream from such a redaction bookmark will contain all of the blocks
483 necessary to fill in any redacted data, should it be needed, because the sending
484 system is aware of what blocks were originally redacted.
485 This will either produce a normal snapshot or a redacted one, depending on
486 whether the new send stream is redacted.
488 To receive an incremental send from a redacted version of the initial
489 snapshot that is redacted with respect to a subject of the set of snapshots the
490 initial snapshot was created with respect to.
491 A send stream from a compatible redacted dataset will contain all of the blocks
492 necessary to fill in any redacted data.
493 This will either produce a normal snapshot or a redacted one, depending on
494 whether the new send stream is redacted.
496 To receive a full send as a clone of the redacted snapshot.
497 Since the stream is a full send, it definitionally contains all the data needed
498 to create a new dataset.
499 This use case will either produce a normal snapshot or a redacted one, depending
500 on whether the full send stream was redacted.
503 These restrictions are detected and enforced by
505 a redacted send stream will contain the list of snapshots that the stream is
506 redacted with respect to.
507 These are stored with the redacted snapshot, and are used to detect and
508 correctly handle the cases above.
509 Note that for technical reasons,
510 raw sends and redacted sends cannot be combined at this time.
516 .Ar receive_resume_token
518 Creates a send stream which resumes an interrupted receive.
520 .Ar receive_resume_token
521 is the value of this property on the filesystem or volume that was being
523 See the documentation for
524 .Nm zfs Cm receive Fl s
530 .Op Fl i Ar snapshot Ns | Ns Ar bookmark
534 Generate a send stream from a dataset that has been partially received.
537 This flag requires that the specified filesystem previously received a resumable
538 send that did not finish and was interrupted.
539 In such scenarios this flag
540 enables the user to send this partially received state.
541 Using this flag will always use the last fully received snapshot
542 as the incremental source if it exists.
547 .Ar snapshot redaction_bookmark
548 .Ar redaction_snapshot Ns …
550 Generate a new redaction bookmark.
551 In addition to the typical bookmark information, a redaction bookmark contains
552 the list of redacted blocks and the list of redaction snapshots specified.
553 The redacted blocks are blocks in the snapshot which are not referenced by any
554 of the redaction snapshots.
555 These blocks are found by iterating over the metadata in each redaction snapshot
556 to determine what has been changed since the target snapshot.
557 Redaction is designed to support redacted zfs sends; see the entry for
559 for more information on the purpose of this operation.
560 If a redact operation fails partway through (due to an error or a system
561 failure), the redaction can be resumed by rerunning the same command.
564 ZFS has support for a limited version of data subsetting, in the form of
569 .Sy redaction bookmark
570 can be created that stores a list of blocks containing sensitive information.
576 Redacted sends omit the blocks containing sensitive information,
577 replacing them with REDACT records.
578 When these send streams are received, a
581 A redacted dataset cannot be mounted by default, since it is incomplete.
582 It can be used to receive other send streams.
583 In this way datasets can be used for data backup and replication,
584 with all the benefits that zfs send and receive have to offer,
585 while protecting sensitive information from being
586 stored on less-trusted machines or services.
588 For the purposes of redaction, there are two steps to the process.
589 A redact step, and a send/receive step.
590 First, a redaction bookmark is created.
591 This is done by providing the
593 command with a parent snapshot, a bookmark to be created, and a number of
595 These redaction snapshots must be descendants of the parent snapshot,
596 and they should modify data that is considered sensitive in some way.
597 Any blocks of data modified by all of the redaction snapshots will
598 be listed in the redaction bookmark, because it represents the truly sensitive
600 When it comes to the send step, the send process will not send
601 the blocks listed in the redaction bookmark, instead replacing them with
603 When received on the target system, this will create a
604 redacted dataset, missing the data that corresponds to the blocks in the
605 redaction bookmark on the sending system.
606 The incremental send streams from
607 the original parent to the redaction snapshots can then also be received on
608 the target system, and this will produce a complete snapshot that can be used
610 Incrementals from one snapshot on the parent filesystem and another
611 can also be done by sending from the redaction bookmark, rather than the
612 snapshots themselves.
614 In order to make the purpose of the feature more clear, an example is provided.
615 Consider a zfs filesystem containing four files.
616 These files represent information for an online shopping service.
617 One file contains a list of usernames and passwords, another contains purchase histories,
618 a third contains click tracking data, and a fourth contains user preferences.
619 The owner of this data wants to make it available for their development teams to
620 test against, and their market research teams to do analysis on.
621 The development teams need information about user preferences and the click
622 tracking data, while the market research teams need information about purchase
623 histories and user preferences.
624 Neither needs access to the usernames and passwords.
625 However, because all of this data is stored in one ZFS filesystem,
626 it must all be sent and received together.
627 In addition, the owner of the data
628 wants to take advantage of features like compression, checksumming, and
629 snapshots, so they do want to continue to use ZFS to store and transmit their data.
630 Redaction can help them do so.
631 First, they would make two clones of a snapshot of the data on the source.
632 In one clone, they create the setup they want their market research team to see;
633 they delete the usernames and passwords file,
634 and overwrite the click tracking data with dummy information.
635 In another, they create the setup they want the development teams
636 to see, by replacing the passwords with fake information and replacing the
637 purchase histories with randomly generated ones.
638 They would then create a redaction bookmark on the parent snapshot,
639 using snapshots on the two clones as redaction snapshots.
640 The parent can then be sent, redacted, to the target
641 server where the research and development teams have access.
642 Finally, incremental sends from the parent snapshot to each of the clones can be sent
643 to and received on the target server; these snapshots are identical to the
644 ones on the source, and are ready to be used, while the parent snapshot on the
645 target contains none of the username and password data present on the source,
646 because it was removed by the redacted send operation.