1eda14cbcSMatt Macy.\" 2eda14cbcSMatt Macy.\" CDDL HEADER START 3eda14cbcSMatt Macy.\" 4eda14cbcSMatt Macy.\" The contents of this file are subject to the terms of the 5eda14cbcSMatt Macy.\" Common Development and Distribution License (the "License"). 6eda14cbcSMatt Macy.\" You may not use this file except in compliance with the License. 7eda14cbcSMatt Macy.\" 8eda14cbcSMatt Macy.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9eda14cbcSMatt Macy.\" or http://www.opensolaris.org/os/licensing. 10eda14cbcSMatt Macy.\" See the License for the specific language governing permissions 11eda14cbcSMatt Macy.\" and limitations under the License. 12eda14cbcSMatt Macy.\" 13eda14cbcSMatt Macy.\" When distributing Covered Code, include this CDDL HEADER in each 14eda14cbcSMatt Macy.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15eda14cbcSMatt Macy.\" If applicable, add the following below this CDDL HEADER, with the 16eda14cbcSMatt Macy.\" fields enclosed by brackets "[]" replaced with your own identifying 17eda14cbcSMatt Macy.\" information: Portions Copyright [yyyy] [name of copyright owner] 18eda14cbcSMatt Macy.\" 19eda14cbcSMatt Macy.\" CDDL HEADER END 20eda14cbcSMatt Macy.\" 21eda14cbcSMatt Macy.\" Copyright (c) 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.\" 3216038816SMartin Matuska.Dd April 15, 2021 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 4216038816SMartin Matuska.Op Fl DLPRbcehnpsvw 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 4716038816SMartin Matuska.Op Fl DLPRcenpsvw 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.Op Fl i Ar snapshot Ns | Ns Ar bookmark 55eda14cbcSMatt Macy.Ar snapshot 567877fdebSMatt Macy.Nm zfs 57eda14cbcSMatt Macy.Cm send 58eda14cbcSMatt Macy.Op Fl Penv 59eda14cbcSMatt Macy.Fl t 60eda14cbcSMatt Macy.Ar receive_resume_token 617877fdebSMatt Macy.Nm zfs 62eda14cbcSMatt Macy.Cm send 63eda14cbcSMatt Macy.Op Fl Pnv 64eda14cbcSMatt Macy.Fl S Ar filesystem 657877fdebSMatt Macy.Nm zfs 66eda14cbcSMatt Macy.Cm redact 67eda14cbcSMatt Macy.Ar snapshot redaction_bookmark 6816038816SMartin Matuska.Ar redaction_snapshot Ns … 6916038816SMartin Matuska. 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 113*3ff01b23SMartin Matuska.Xr zpool-features 7 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 13716038816SMartin Matuskado not exist on the sending side are destroyed. 13816038816SMartin MatuskaIf the 139eda14cbcSMatt Macy.Fl R 140eda14cbcSMatt Macyflag is used to send encrypted datasets, then 141eda14cbcSMatt Macy.Fl w 142eda14cbcSMatt Macymust also be specified. 143eda14cbcSMatt Macy.It Fl e , -embed 144eda14cbcSMatt MacyGenerate a more compact stream by using 145eda14cbcSMatt Macy.Sy WRITE_EMBEDDED 146eda14cbcSMatt Macyrecords for blocks which are stored more compactly on disk by the 147eda14cbcSMatt Macy.Sy embedded_data 148eda14cbcSMatt Macypool feature. 149eda14cbcSMatt MacyThis flag has no effect if the 150eda14cbcSMatt Macy.Sy embedded_data 151eda14cbcSMatt Macyfeature is disabled. 152eda14cbcSMatt MacyThe receiving system must have the 153eda14cbcSMatt Macy.Sy embedded_data 154eda14cbcSMatt Macyfeature enabled. 155eda14cbcSMatt MacyIf the 156eda14cbcSMatt Macy.Sy lz4_compress 157eda14cbcSMatt Macyfeature is active on the sending system, then the receiving system must have 15816038816SMartin Matuskathat feature enabled as well. 15916038816SMartin MatuskaDatasets that are sent with this flag may not be 160eda14cbcSMatt Macyreceived as an encrypted dataset, since encrypted datasets cannot use the 161eda14cbcSMatt Macy.Sy embedded_data 162eda14cbcSMatt Macyfeature. 163eda14cbcSMatt MacySee 164*3ff01b23SMartin Matuska.Xr zpool-features 7 165eda14cbcSMatt Macyfor details on ZFS feature flags and the 166eda14cbcSMatt Macy.Sy embedded_data 167eda14cbcSMatt Macyfeature. 168eda14cbcSMatt Macy.It Fl b , -backup 169eda14cbcSMatt MacySends only received property values whether or not they are overridden by local 17016038816SMartin Matuskasettings, but only if the dataset has ever been received. 17116038816SMartin MatuskaUse this option when you want 172eda14cbcSMatt Macy.Nm zfs Cm receive 173eda14cbcSMatt Macyto restore received properties backed up on the sent dataset and to avoid 174eda14cbcSMatt Macysending local settings that may have nothing to do with the source dataset, 175eda14cbcSMatt Macybut only with how the data is backed up. 176eda14cbcSMatt Macy.It Fl c , -compressed 177eda14cbcSMatt MacyGenerate a more compact stream by using compressed WRITE records for blocks 178eda14cbcSMatt Macywhich are compressed on disk and in memory 179eda14cbcSMatt Macy.Po see the 180eda14cbcSMatt Macy.Sy compression 181eda14cbcSMatt Macyproperty for details 182eda14cbcSMatt Macy.Pc . 183eda14cbcSMatt MacyIf the 184eda14cbcSMatt Macy.Sy lz4_compress 185eda14cbcSMatt Macyfeature is active on the sending system, then the receiving system must have 186eda14cbcSMatt Macythat feature enabled as well. 187eda14cbcSMatt MacyIf the 188eda14cbcSMatt Macy.Sy large_blocks 189eda14cbcSMatt Macyfeature is enabled on the sending system but the 190eda14cbcSMatt Macy.Fl L 191eda14cbcSMatt Macyoption is not supplied in conjunction with 192eda14cbcSMatt Macy.Fl c , 193eda14cbcSMatt Macythen the data will be decompressed before sending so it can be split into 19416038816SMartin Matuskasmaller block sizes. 19516038816SMartin MatuskaStreams sent with 1969db44a8eSMartin Matuska.Fl c 1979db44a8eSMartin Matuskawill not have their data recompressed on the receiver side using 19816038816SMartin Matuska.Fl o Sy compress Ns = Ar value . 19916038816SMartin MatuskaThe data will stay compressed as it was from the sender. 20016038816SMartin MatuskaThe new compression property will be set for future data. 201eda14cbcSMatt Macy.It Fl w , -raw 20216038816SMartin MatuskaFor encrypted datasets, send data exactly as it exists on disk. 20316038816SMartin MatuskaThis allows backups to be taken even if encryption keys are not currently loaded. 20416038816SMartin MatuskaThe backup may then be received on an untrusted machine since that machine will 205eda14cbcSMatt Macynot have the encryption keys to read the protected data or alter it without 20616038816SMartin Matuskabeing detected. 20716038816SMartin MatuskaUpon being received, the dataset will have the same encryption 208eda14cbcSMatt Macykeys as it did on the send side, although the 209eda14cbcSMatt Macy.Sy keylocation 210eda14cbcSMatt Macyproperty will be defaulted to 211eda14cbcSMatt Macy.Sy prompt 21216038816SMartin Matuskaif not otherwise provided. 21316038816SMartin MatuskaFor unencrypted datasets, this flag will be equivalent to 214eda14cbcSMatt Macy.Fl Lec . 215eda14cbcSMatt MacyNote that if you do not use this flag for sending encrypted datasets, data will 216eda14cbcSMatt Macybe sent unencrypted and may be re-encrypted with a different encryption key on 217eda14cbcSMatt Macythe receiving system, which will disable the ability to do a raw send to that 218eda14cbcSMatt Macysystem for incrementals. 219eda14cbcSMatt Macy.It Fl h , -holds 220eda14cbcSMatt MacyGenerate a stream package that includes any snapshot holds (created with the 22116038816SMartin Matuska.Nm zfs Cm hold 222eda14cbcSMatt Macycommand), and indicating to 22316038816SMartin Matuska.Nm zfs Cm receive 224eda14cbcSMatt Macythat the holds be applied to the dataset on the receiving system. 225eda14cbcSMatt Macy.It Fl i Ar snapshot 226eda14cbcSMatt MacyGenerate an incremental stream from the first 227eda14cbcSMatt Macy.Ar snapshot 228eda14cbcSMatt Macy.Pq the incremental source 229eda14cbcSMatt Macyto the second 230eda14cbcSMatt Macy.Ar snapshot 231eda14cbcSMatt Macy.Pq the incremental target . 232eda14cbcSMatt MacyThe incremental source can be specified as the last component of the snapshot 233eda14cbcSMatt Macyname 234eda14cbcSMatt Macy.Po the 235eda14cbcSMatt Macy.Sy @ 236eda14cbcSMatt Macycharacter and following 237eda14cbcSMatt Macy.Pc 238eda14cbcSMatt Macyand it is assumed to be from the same file system as the incremental target. 239eda14cbcSMatt Macy.Pp 240eda14cbcSMatt MacyIf the destination is a clone, the source may be the origin snapshot, which must 241eda14cbcSMatt Macybe fully specified 242eda14cbcSMatt Macy.Po for example, 243eda14cbcSMatt Macy.Em pool/fs@origin , 244eda14cbcSMatt Macynot just 245eda14cbcSMatt Macy.Em @origin 246eda14cbcSMatt Macy.Pc . 247eda14cbcSMatt Macy.It Fl n , -dryrun 248eda14cbcSMatt MacyDo a dry-run 249eda14cbcSMatt Macy.Pq Qq No-op 250eda14cbcSMatt Macysend. 251eda14cbcSMatt MacyDo not generate any actual send data. 252eda14cbcSMatt MacyThis is useful in conjunction with the 253eda14cbcSMatt Macy.Fl v 254eda14cbcSMatt Macyor 255eda14cbcSMatt Macy.Fl P 256eda14cbcSMatt Macyflags to determine what data will be sent. 257eda14cbcSMatt MacyIn this case, the verbose output will be written to standard output 258eda14cbcSMatt Macy.Po contrast with a non-dry-run, where the stream is written to standard output 259eda14cbcSMatt Macyand the verbose output goes to standard error 260eda14cbcSMatt Macy.Pc . 261eda14cbcSMatt Macy.It Fl p , -props 262eda14cbcSMatt MacyInclude the dataset's properties in the stream. 263eda14cbcSMatt MacyThis flag is implicit when 264eda14cbcSMatt Macy.Fl R 265eda14cbcSMatt Macyis specified. 26616038816SMartin MatuskaThe receiving system must also support this feature. 26716038816SMartin MatuskaSends of encrypted datasets must use 268eda14cbcSMatt Macy.Fl w 269eda14cbcSMatt Macywhen using this flag. 27016038816SMartin Matuska.It Fl s , -skip-missing 27116038816SMartin MatuskaAllows sending a replication stream even when there are snapshots missing in the 27216038816SMartin Matuskahierarchy. 27316038816SMartin MatuskaWhen a snapshot is missing, instead of throwing an error and aborting the send, 27416038816SMartin Matuskaa warning is printed to the standard error stream and the dataset to which it belongs 27516038816SMartin Matuskaand its descendents are skipped. 27616038816SMartin MatuskaThis flag can only be used in conjunction with 27716038816SMartin Matuska.Fl R . 278eda14cbcSMatt Macy.It Fl v , -verbose 279eda14cbcSMatt MacyPrint verbose information about the stream package generated. 280eda14cbcSMatt MacyThis information includes a per-second report of how much data has been sent. 281eda14cbcSMatt Macy.Pp 282eda14cbcSMatt MacyThe format of the stream is committed. 283eda14cbcSMatt MacyYou will be able to receive your streams on future versions of ZFS. 284eda14cbcSMatt Macy.El 285eda14cbcSMatt Macy.It Xo 2867877fdebSMatt Macy.Nm zfs 287eda14cbcSMatt Macy.Cm send 288eda14cbcSMatt Macy.Op Fl DLPRcenpvw 289eda14cbcSMatt Macy.Op Fl i Ar snapshot Ns | Ns Ar bookmark 290eda14cbcSMatt Macy.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot 291eda14cbcSMatt Macy.Xc 292eda14cbcSMatt MacyGenerate a send stream, which may be of a filesystem, and may be incremental 293eda14cbcSMatt Macyfrom a bookmark. 294eda14cbcSMatt MacyIf the destination is a filesystem or volume, the pool must be read-only, or the 295eda14cbcSMatt Macyfilesystem must not be mounted. 296eda14cbcSMatt MacyWhen the stream generated from a filesystem or volume is received, the default 297eda14cbcSMatt Macysnapshot name will be 298eda14cbcSMatt Macy.Qq --head-- . 299eda14cbcSMatt Macy.Bl -tag -width "-L" 300eda14cbcSMatt Macy.It Fl L , -large-block 301eda14cbcSMatt MacyGenerate a stream which may contain blocks larger than 128KB. 302eda14cbcSMatt MacyThis flag has no effect if the 303eda14cbcSMatt Macy.Sy large_blocks 304eda14cbcSMatt Macypool feature is disabled, or if the 305eda14cbcSMatt Macy.Sy recordsize 306eda14cbcSMatt Macyproperty of this filesystem has never been set above 128KB. 307eda14cbcSMatt MacyThe receiving system must have the 308eda14cbcSMatt Macy.Sy large_blocks 309eda14cbcSMatt Macypool feature enabled as well. 310eda14cbcSMatt MacySee 311*3ff01b23SMartin Matuska.Xr zpool-features 7 312eda14cbcSMatt Macyfor details on ZFS feature flags and the 313eda14cbcSMatt Macy.Sy large_blocks 314eda14cbcSMatt Macyfeature. 315eda14cbcSMatt Macy.It Fl P , -parsable 316eda14cbcSMatt MacyPrint machine-parsable verbose information about the stream package generated. 317eda14cbcSMatt Macy.It Fl c , -compressed 318eda14cbcSMatt MacyGenerate a more compact stream by using compressed WRITE records for blocks 319eda14cbcSMatt Macywhich are compressed on disk and in memory 320eda14cbcSMatt Macy.Po see the 321eda14cbcSMatt Macy.Sy compression 322eda14cbcSMatt Macyproperty for details 323eda14cbcSMatt Macy.Pc . 324eda14cbcSMatt MacyIf the 325eda14cbcSMatt Macy.Sy lz4_compress 326eda14cbcSMatt Macyfeature is active on the sending system, then the receiving system must have 327eda14cbcSMatt Macythat feature enabled as well. 328eda14cbcSMatt MacyIf the 329eda14cbcSMatt Macy.Sy large_blocks 330eda14cbcSMatt Macyfeature is enabled on the sending system but the 331eda14cbcSMatt Macy.Fl L 332eda14cbcSMatt Macyoption is not supplied in conjunction with 333eda14cbcSMatt Macy.Fl c , 334eda14cbcSMatt Macythen the data will be decompressed before sending so it can be split into 335eda14cbcSMatt Macysmaller block sizes. 336eda14cbcSMatt Macy.It Fl w , -raw 33716038816SMartin MatuskaFor encrypted datasets, send data exactly as it exists on disk. 33816038816SMartin MatuskaThis allows backups to be taken even if encryption keys are not currently loaded. 33916038816SMartin MatuskaThe backup may then be received on an untrusted machine since that machine will 340eda14cbcSMatt Macynot have the encryption keys to read the protected data or alter it without 34116038816SMartin Matuskabeing detected. 34216038816SMartin MatuskaUpon being received, the dataset will have the same encryption 343eda14cbcSMatt Macykeys as it did on the send side, although the 344eda14cbcSMatt Macy.Sy keylocation 345eda14cbcSMatt Macyproperty will be defaulted to 346eda14cbcSMatt Macy.Sy prompt 34716038816SMartin Matuskaif not otherwise provided. 34816038816SMartin MatuskaFor unencrypted datasets, this flag will be equivalent to 349eda14cbcSMatt Macy.Fl Lec . 350eda14cbcSMatt MacyNote that if you do not use this flag for sending encrypted datasets, data will 351eda14cbcSMatt Macybe sent unencrypted and may be re-encrypted with a different encryption key on 352eda14cbcSMatt Macythe receiving system, which will disable the ability to do a raw send to that 353eda14cbcSMatt Macysystem for incrementals. 354eda14cbcSMatt Macy.It Fl e , -embed 355eda14cbcSMatt MacyGenerate a more compact stream by using 356eda14cbcSMatt Macy.Sy WRITE_EMBEDDED 357eda14cbcSMatt Macyrecords for blocks which are stored more compactly on disk by the 358eda14cbcSMatt Macy.Sy embedded_data 359eda14cbcSMatt Macypool feature. 360eda14cbcSMatt MacyThis flag has no effect if the 361eda14cbcSMatt Macy.Sy embedded_data 362eda14cbcSMatt Macyfeature is disabled. 363eda14cbcSMatt MacyThe receiving system must have the 364eda14cbcSMatt Macy.Sy embedded_data 365eda14cbcSMatt Macyfeature enabled. 366eda14cbcSMatt MacyIf the 367eda14cbcSMatt Macy.Sy lz4_compress 368eda14cbcSMatt Macyfeature is active on the sending system, then the receiving system must have 36916038816SMartin Matuskathat feature enabled as well. 37016038816SMartin MatuskaDatasets that are sent with this flag may not be received as an encrypted dataset, 37116038816SMartin Matuskasince encrypted datasets cannot use the 372eda14cbcSMatt Macy.Sy embedded_data 373eda14cbcSMatt Macyfeature. 374eda14cbcSMatt MacySee 375*3ff01b23SMartin Matuska.Xr zpool-features 7 376eda14cbcSMatt Macyfor details on ZFS feature flags and the 377eda14cbcSMatt Macy.Sy embedded_data 378eda14cbcSMatt Macyfeature. 379eda14cbcSMatt Macy.It Fl i Ar snapshot Ns | Ns Ar bookmark 380eda14cbcSMatt MacyGenerate an incremental send stream. 381eda14cbcSMatt MacyThe incremental source must be an earlier snapshot in the destination's history. 382eda14cbcSMatt MacyIt will commonly be an earlier snapshot in the destination's file system, in 383eda14cbcSMatt Macywhich case it can be specified as the last component of the name 384eda14cbcSMatt Macy.Po the 385eda14cbcSMatt Macy.Sy # 386eda14cbcSMatt Macyor 387eda14cbcSMatt Macy.Sy @ 388eda14cbcSMatt Macycharacter and following 389eda14cbcSMatt Macy.Pc . 390eda14cbcSMatt Macy.Pp 391eda14cbcSMatt MacyIf the incremental target is a clone, the incremental source can be the origin 392eda14cbcSMatt Macysnapshot, or an earlier snapshot in the origin's filesystem, or the origin's 393eda14cbcSMatt Macyorigin, etc. 394eda14cbcSMatt Macy.It Fl n , -dryrun 395eda14cbcSMatt MacyDo a dry-run 396eda14cbcSMatt Macy.Pq Qq No-op 397eda14cbcSMatt Macysend. 398eda14cbcSMatt MacyDo not generate any actual send data. 399eda14cbcSMatt MacyThis is useful in conjunction with the 400eda14cbcSMatt Macy.Fl v 401eda14cbcSMatt Macyor 402eda14cbcSMatt Macy.Fl P 403eda14cbcSMatt Macyflags to determine what data will be sent. 404eda14cbcSMatt MacyIn this case, the verbose output will be written to standard output 405eda14cbcSMatt Macy.Po contrast with a non-dry-run, where the stream is written to standard output 406eda14cbcSMatt Macyand the verbose output goes to standard error 407eda14cbcSMatt Macy.Pc . 408eda14cbcSMatt Macy.It Fl v , -verbose 409eda14cbcSMatt MacyPrint verbose information about the stream package generated. 410eda14cbcSMatt MacyThis information includes a per-second report of how much data has been sent. 411eda14cbcSMatt Macy.El 412eda14cbcSMatt Macy.It Xo 4137877fdebSMatt Macy.Nm zfs 414eda14cbcSMatt Macy.Cm send 415eda14cbcSMatt Macy.Fl -redact Ar redaction_bookmark 416eda14cbcSMatt Macy.Op Fl DLPcenpv 417eda14cbcSMatt Macy.Op Fl i Ar snapshot Ns | Ns Ar bookmark 418eda14cbcSMatt Macy.Ar snapshot 419eda14cbcSMatt Macy.Xc 420eda14cbcSMatt MacyGenerate a redacted send stream. 421eda14cbcSMatt MacyThis send stream contains all blocks from the snapshot being sent that aren't 422eda14cbcSMatt Macyincluded in the redaction list contained in the bookmark specified by the 423eda14cbcSMatt Macy.Fl -redact 424eda14cbcSMatt Macy(or 42516038816SMartin Matuska.Fl d ) 42616038816SMartin Matuskaflag. 427eda14cbcSMatt MacyThe resulting send stream is said to be redacted with respect to the snapshots 428eda14cbcSMatt Macythe bookmark specified by the 429eda14cbcSMatt Macy.Fl -redact No flag was created with. 430eda14cbcSMatt MacyThe bookmark must have been created by running 43116038816SMartin Matuska.Nm zfs Cm redact 432eda14cbcSMatt Macyon the snapshot being sent. 43316038816SMartin Matuska.Pp 434eda14cbcSMatt MacyThis feature can be used to allow clones of a filesystem to be made available on 435eda14cbcSMatt Macya remote system, in the case where their parent need not (or needs to not) be 436eda14cbcSMatt Macyusable. 437eda14cbcSMatt MacyFor example, if a filesystem contains sensitive data, and it has clones where 438eda14cbcSMatt Macythat sensitive data has been secured or replaced with dummy data, redacted sends 439eda14cbcSMatt Macycan be used to replicate the secured data without replicating the original 440eda14cbcSMatt Macysensitive data, while still sharing all possible blocks. 441eda14cbcSMatt MacyA snapshot that has been redacted with respect to a set of snapshots will 442eda14cbcSMatt Macycontain all blocks referenced by at least one snapshot in the set, but will 443eda14cbcSMatt Macycontain none of the blocks referenced by none of the snapshots in the set. 444eda14cbcSMatt MacyIn other words, if all snapshots in the set have modified a given block in the 445eda14cbcSMatt Macyparent, that block will not be sent; but if one or more snapshots have not 446eda14cbcSMatt Macymodified a block in the parent, they will still reference the parent's block, so 447eda14cbcSMatt Macythat block will be sent. 448eda14cbcSMatt MacyNote that only user data will be redacted. 44916038816SMartin Matuska.Pp 450eda14cbcSMatt MacyWhen the redacted send stream is received, we will generate a redacted 451eda14cbcSMatt Macysnapshot. 452eda14cbcSMatt MacyDue to the nature of redaction, a redacted dataset can only be used in the 453eda14cbcSMatt Macyfollowing ways: 45416038816SMartin Matuska.Bl -enum -width "a." 45516038816SMartin Matuska.It 45616038816SMartin MatuskaTo receive, as a clone, an incremental send from the original snapshot to one 457eda14cbcSMatt Macyof the snapshots it was redacted with respect to. 458eda14cbcSMatt MacyIn this case, the stream will produce a valid dataset when received because all 459eda14cbcSMatt Macyblocks that were redacted in the parent are guaranteed to be present in the 460eda14cbcSMatt Macychild's send stream. 461eda14cbcSMatt MacyThis use case will produce a normal snapshot, which can be used just like other 462eda14cbcSMatt Macysnapshots. 46316038816SMartin Matuska. 46416038816SMartin Matuska.It 46516038816SMartin MatuskaTo receive an incremental send from the original snapshot to something 466eda14cbcSMatt Macyredacted with respect to a subset of the set of snapshots the initial snapshot 467eda14cbcSMatt Macywas redacted with respect to. 468eda14cbcSMatt MacyIn this case, each block that was redacted in the original is still redacted 469eda14cbcSMatt Macy(redacting with respect to additional snapshots causes less data to be redacted 470eda14cbcSMatt Macy(because the snapshots define what is permitted, and everything else is 471eda14cbcSMatt Macyredacted)). 472eda14cbcSMatt MacyThis use case will produce a new redacted snapshot. 47316038816SMartin Matuska.It 47416038816SMartin MatuskaTo receive an incremental send from a redaction bookmark of the original 475eda14cbcSMatt Macysnapshot that was created when redacting with respect to a subset of the set of 476eda14cbcSMatt Macysnapshots the initial snapshot was created with respect to 477eda14cbcSMatt Macyanything else. 478eda14cbcSMatt MacyA send stream from such a redaction bookmark will contain all of the blocks 479eda14cbcSMatt Macynecessary to fill in any redacted data, should it be needed, because the sending 480eda14cbcSMatt Macysystem is aware of what blocks were originally redacted. 481eda14cbcSMatt MacyThis will either produce a normal snapshot or a redacted one, depending on 482eda14cbcSMatt Macywhether the new send stream is redacted. 48316038816SMartin Matuska.It 48416038816SMartin MatuskaTo receive an incremental send from a redacted version of the initial 485eda14cbcSMatt Macysnapshot that is redacted with respect to a subject of the set of snapshots the 486eda14cbcSMatt Macyinitial snapshot was created with respect to. 487eda14cbcSMatt MacyA send stream from a compatible redacted dataset will contain all of the blocks 488eda14cbcSMatt Macynecessary to fill in any redacted data. 489eda14cbcSMatt MacyThis will either produce a normal snapshot or a redacted one, depending on 490eda14cbcSMatt Macywhether the new send stream is redacted. 49116038816SMartin Matuska.It 49216038816SMartin MatuskaTo receive a full send as a clone of the redacted snapshot. 493eda14cbcSMatt MacySince the stream is a full send, it definitionally contains all the data needed 494eda14cbcSMatt Macyto create a new dataset. 495eda14cbcSMatt MacyThis use case will either produce a normal snapshot or a redacted one, depending 496eda14cbcSMatt Macyon whether the full send stream was redacted. 49716038816SMartin Matuska.El 49816038816SMartin Matuska.Pp 49916038816SMartin MatuskaThese restrictions are detected and enforced by 50016038816SMartin Matuska.Nm zfs Cm receive ; 50116038816SMartin Matuskaa redacted send stream will contain the list of snapshots that the stream is 502eda14cbcSMatt Macyredacted with respect to. 503eda14cbcSMatt MacyThese are stored with the redacted snapshot, and are used to detect and 50416038816SMartin Matuskacorrectly handle the cases above. 50516038816SMartin MatuskaNote that for technical reasons, 50616038816SMartin Matuskaraw sends and redacted sends cannot be combined at this time. 507eda14cbcSMatt Macy.It Xo 5087877fdebSMatt Macy.Nm zfs 509eda14cbcSMatt Macy.Cm send 510eda14cbcSMatt Macy.Op Fl Penv 511eda14cbcSMatt Macy.Fl t 512eda14cbcSMatt Macy.Ar receive_resume_token 513eda14cbcSMatt Macy.Xc 514eda14cbcSMatt MacyCreates a send stream which resumes an interrupted receive. 515eda14cbcSMatt MacyThe 516eda14cbcSMatt Macy.Ar receive_resume_token 517eda14cbcSMatt Macyis the value of this property on the filesystem or volume that was being 518eda14cbcSMatt Macyreceived into. 519eda14cbcSMatt MacySee the documentation for 52016038816SMartin Matuska.Nm zfs Cm receive Fl s 521eda14cbcSMatt Macyfor more details. 522eda14cbcSMatt Macy.It Xo 5237877fdebSMatt Macy.Nm zfs 524eda14cbcSMatt Macy.Cm send 525eda14cbcSMatt Macy.Op Fl Pnv 526eda14cbcSMatt Macy.Op Fl i Ar snapshot Ns | Ns Ar bookmark 527eda14cbcSMatt Macy.Fl S 528eda14cbcSMatt Macy.Ar filesystem 529eda14cbcSMatt Macy.Xc 530eda14cbcSMatt MacyGenerate a send stream from a dataset that has been partially received. 531eda14cbcSMatt Macy.Bl -tag -width "-L" 532eda14cbcSMatt Macy.It Fl S , -saved 533eda14cbcSMatt MacyThis flag requires that the specified filesystem previously received a resumable 53416038816SMartin Matuskasend that did not finish and was interrupted. 53516038816SMartin MatuskaIn such scenarios this flag 53616038816SMartin Matuskaenables the user to send this partially received state. 53716038816SMartin MatuskaUsing this flag will always use the last fully received snapshot 53816038816SMartin Matuskaas the incremental source if it exists. 539eda14cbcSMatt Macy.El 540eda14cbcSMatt Macy.It Xo 5417877fdebSMatt Macy.Nm zfs 542eda14cbcSMatt Macy.Cm redact 543eda14cbcSMatt Macy.Ar snapshot redaction_bookmark 54416038816SMartin Matuska.Ar redaction_snapshot Ns … 545eda14cbcSMatt Macy.Xc 546eda14cbcSMatt MacyGenerate a new redaction bookmark. 547eda14cbcSMatt MacyIn addition to the typical bookmark information, a redaction bookmark contains 548eda14cbcSMatt Macythe list of redacted blocks and the list of redaction snapshots specified. 549eda14cbcSMatt MacyThe redacted blocks are blocks in the snapshot which are not referenced by any 550eda14cbcSMatt Macyof the redaction snapshots. 551eda14cbcSMatt MacyThese blocks are found by iterating over the metadata in each redaction snapshot 552eda14cbcSMatt Macyto determine what has been changed since the target snapshot. 553eda14cbcSMatt MacyRedaction is designed to support redacted zfs sends; see the entry for 55416038816SMartin Matuska.Nm zfs Cm send 555eda14cbcSMatt Macyfor more information on the purpose of this operation. 556eda14cbcSMatt MacyIf a redact operation fails partway through (due to an error or a system 557eda14cbcSMatt Macyfailure), the redaction can be resumed by rerunning the same command. 558eda14cbcSMatt Macy.El 559eda14cbcSMatt Macy.Ss Redaction 560eda14cbcSMatt MacyZFS has support for a limited version of data subsetting, in the form of 56116038816SMartin Matuskaredaction. 56216038816SMartin MatuskaUsing the 56316038816SMartin Matuska.Nm zfs Cm redact 564eda14cbcSMatt Macycommand, a 565eda14cbcSMatt Macy.Sy redaction bookmark 56616038816SMartin Matuskacan be created that stores a list of blocks containing sensitive information. 56716038816SMartin MatuskaWhen provided to 56816038816SMartin Matuska.Nm zfs Cm send , 569eda14cbcSMatt Macythis causes a 570eda14cbcSMatt Macy.Sy redacted send 57116038816SMartin Matuskato occur. 57216038816SMartin MatuskaRedacted sends omit the blocks containing sensitive information, 57316038816SMartin Matuskareplacing them with REDACT records. 57416038816SMartin MatuskaWhen these send streams are received, a 575eda14cbcSMatt Macy.Sy redacted dataset 57616038816SMartin Matuskais created. 57716038816SMartin MatuskaA redacted dataset cannot be mounted by default, since it is incomplete. 57816038816SMartin MatuskaIt can be used to receive other send streams. 57916038816SMartin MatuskaIn this way datasets can be used for data backup and replication, 58016038816SMartin Matuskawith all the benefits that zfs send and receive have to offer, 58116038816SMartin Matuskawhile protecting sensitive information from being 582eda14cbcSMatt Macystored on less-trusted machines or services. 583eda14cbcSMatt Macy.Pp 58416038816SMartin MatuskaFor the purposes of redaction, there are two steps to the process. 58516038816SMartin MatuskaA redact step, and a send/receive step. 58616038816SMartin MatuskaFirst, a redaction bookmark is created. 58716038816SMartin MatuskaThis is done by providing the 58816038816SMartin Matuska.Nm zfs Cm redact 589eda14cbcSMatt Macycommand with a parent snapshot, a bookmark to be created, and a number of 59016038816SMartin Matuskaredaction snapshots. 59116038816SMartin MatuskaThese redaction snapshots must be descendants of the parent snapshot, 59216038816SMartin Matuskaand they should modify data that is considered sensitive in some way. 59316038816SMartin MatuskaAny blocks of data modified by all of the redaction snapshots will 594eda14cbcSMatt Macybe listed in the redaction bookmark, because it represents the truly sensitive 59516038816SMartin Matuskainformation. 59616038816SMartin MatuskaWhen it comes to the send step, the send process will not send 597eda14cbcSMatt Macythe blocks listed in the redaction bookmark, instead replacing them with 59816038816SMartin MatuskaREDACT records. 59916038816SMartin MatuskaWhen received on the target system, this will create a 600eda14cbcSMatt Macyredacted dataset, missing the data that corresponds to the blocks in the 60116038816SMartin Matuskaredaction bookmark on the sending system. 60216038816SMartin MatuskaThe incremental send streams from 603eda14cbcSMatt Macythe original parent to the redaction snapshots can then also be received on 604eda14cbcSMatt Macythe target system, and this will produce a complete snapshot that can be used 60516038816SMartin Matuskanormally. 60616038816SMartin MatuskaIncrementals from one snapshot on the parent filesystem and another 607eda14cbcSMatt Macycan also be done by sending from the redaction bookmark, rather than the 608eda14cbcSMatt Macysnapshots themselves. 609eda14cbcSMatt Macy.Pp 61016038816SMartin MatuskaIn order to make the purpose of the feature more clear, an example is provided. 61116038816SMartin MatuskaConsider a zfs filesystem containing four files. 61216038816SMartin MatuskaThese files represent information for an online shopping service. 61316038816SMartin MatuskaOne file contains a list of usernames and passwords, another contains purchase histories, 61416038816SMartin Matuskaa third contains click tracking data, and a fourth contains user preferences. 61516038816SMartin MatuskaThe owner of this data wants to make it available for their development teams to 61616038816SMartin Matuskatest against, and their market research teams to do analysis on. 61716038816SMartin MatuskaThe development teams need information about user preferences and the click 618eda14cbcSMatt Macytracking data, while the market research teams need information about purchase 61916038816SMartin Matuskahistories and user preferences. 62016038816SMartin MatuskaNeither needs access to the usernames and passwords. 62116038816SMartin MatuskaHowever, because all of this data is stored in one ZFS filesystem, 62216038816SMartin Matuskait must all be sent and received together. 62316038816SMartin MatuskaIn addition, the owner of the data 624eda14cbcSMatt Macywants to take advantage of features like compression, checksumming, and 62516038816SMartin Matuskasnapshots, so they do want to continue to use ZFS to store and transmit their data. 62616038816SMartin MatuskaRedaction can help them do so. 62716038816SMartin MatuskaFirst, they would make two clones of a snapshot of the data on the source. 62816038816SMartin MatuskaIn one clone, they create the setup they want their market research team to see; 62916038816SMartin Matuskathey delete the usernames and passwords file, 63016038816SMartin Matuskaand overwrite the click tracking data with dummy information. 63116038816SMartin MatuskaIn another, they create the setup they want the development teams 632eda14cbcSMatt Macyto see, by replacing the passwords with fake information and replacing the 63316038816SMartin Matuskapurchase histories with randomly generated ones. 63416038816SMartin MatuskaThey would then create a redaction bookmark on the parent snapshot, 63516038816SMartin Matuskausing snapshots on the two clones as redaction snapshots. 63616038816SMartin MatuskaThe parent can then be sent, redacted, to the target 63716038816SMartin Matuskaserver where the research and development teams have access. 63816038816SMartin MatuskaFinally, incremental sends from the parent snapshot to each of the clones can be sent 639eda14cbcSMatt Macyto and received on the target server; these snapshots are identical to the 640eda14cbcSMatt Macyones on the source, and are ready to be used, while the parent snapshot on the 641eda14cbcSMatt Macytarget contains none of the username and password data present on the source, 642eda14cbcSMatt Macybecause it was removed by the redacted send operation. 64316038816SMartin Matuska. 644eda14cbcSMatt Macy.Sh SEE ALSO 645eda14cbcSMatt Macy.Xr zfs-bookmark 8 , 646eda14cbcSMatt Macy.Xr zfs-receive 8 , 647eda14cbcSMatt Macy.Xr zfs-redact 8 , 648eda14cbcSMatt Macy.Xr zfs-snapshot 8 649