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 47*3f9d360cSMartin Matuska.Op Fl DLPcensvw 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 1133ff01b23SMartin 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 1643ff01b23SMartin 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 288*3f9d360cSMartin Matuska.Op Fl DLPcenvw 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-- . 299*3f9d360cSMartin Matuska.Bl -tag -width "-D" 300*3f9d360cSMartin Matuska.It Fl D , -dedup 301*3f9d360cSMartin MatuskaDeduplicated send is no longer supported. 302*3f9d360cSMartin MatuskaThis flag is accepted for backwards compatibility, but a regular, 303*3f9d360cSMartin Matuskanon-deduplicated stream will be generated. 304eda14cbcSMatt Macy.It Fl L , -large-block 305eda14cbcSMatt MacyGenerate a stream which may contain blocks larger than 128KB. 306eda14cbcSMatt MacyThis flag has no effect if the 307eda14cbcSMatt Macy.Sy large_blocks 308eda14cbcSMatt Macypool feature is disabled, or if the 309eda14cbcSMatt Macy.Sy recordsize 310eda14cbcSMatt Macyproperty of this filesystem has never been set above 128KB. 311eda14cbcSMatt MacyThe receiving system must have the 312eda14cbcSMatt Macy.Sy large_blocks 313eda14cbcSMatt Macypool feature enabled as well. 314eda14cbcSMatt MacySee 3153ff01b23SMartin Matuska.Xr zpool-features 7 316eda14cbcSMatt Macyfor details on ZFS feature flags and the 317eda14cbcSMatt Macy.Sy large_blocks 318eda14cbcSMatt Macyfeature. 319eda14cbcSMatt Macy.It Fl P , -parsable 320eda14cbcSMatt MacyPrint machine-parsable verbose information about the stream package generated. 321eda14cbcSMatt Macy.It Fl c , -compressed 322eda14cbcSMatt MacyGenerate a more compact stream by using compressed WRITE records for blocks 323eda14cbcSMatt Macywhich are compressed on disk and in memory 324eda14cbcSMatt Macy.Po see the 325eda14cbcSMatt Macy.Sy compression 326eda14cbcSMatt Macyproperty for details 327eda14cbcSMatt Macy.Pc . 328eda14cbcSMatt MacyIf the 329eda14cbcSMatt Macy.Sy lz4_compress 330eda14cbcSMatt Macyfeature is active on the sending system, then the receiving system must have 331eda14cbcSMatt Macythat feature enabled as well. 332eda14cbcSMatt MacyIf the 333eda14cbcSMatt Macy.Sy large_blocks 334eda14cbcSMatt Macyfeature is enabled on the sending system but the 335eda14cbcSMatt Macy.Fl L 336eda14cbcSMatt Macyoption is not supplied in conjunction with 337eda14cbcSMatt Macy.Fl c , 338eda14cbcSMatt Macythen the data will be decompressed before sending so it can be split into 339eda14cbcSMatt Macysmaller block sizes. 340eda14cbcSMatt Macy.It Fl w , -raw 34116038816SMartin MatuskaFor encrypted datasets, send data exactly as it exists on disk. 34216038816SMartin MatuskaThis allows backups to be taken even if encryption keys are not currently loaded. 34316038816SMartin MatuskaThe backup may then be received on an untrusted machine since that machine will 344eda14cbcSMatt Macynot have the encryption keys to read the protected data or alter it without 34516038816SMartin Matuskabeing detected. 34616038816SMartin MatuskaUpon being received, the dataset will have the same encryption 347eda14cbcSMatt Macykeys as it did on the send side, although the 348eda14cbcSMatt Macy.Sy keylocation 349eda14cbcSMatt Macyproperty will be defaulted to 350eda14cbcSMatt Macy.Sy prompt 35116038816SMartin Matuskaif not otherwise provided. 35216038816SMartin MatuskaFor unencrypted datasets, this flag will be equivalent to 353eda14cbcSMatt Macy.Fl Lec . 354eda14cbcSMatt MacyNote that if you do not use this flag for sending encrypted datasets, data will 355eda14cbcSMatt Macybe sent unencrypted and may be re-encrypted with a different encryption key on 356eda14cbcSMatt Macythe receiving system, which will disable the ability to do a raw send to that 357eda14cbcSMatt Macysystem for incrementals. 358eda14cbcSMatt Macy.It Fl e , -embed 359eda14cbcSMatt MacyGenerate a more compact stream by using 360eda14cbcSMatt Macy.Sy WRITE_EMBEDDED 361eda14cbcSMatt Macyrecords for blocks which are stored more compactly on disk by the 362eda14cbcSMatt Macy.Sy embedded_data 363eda14cbcSMatt Macypool feature. 364eda14cbcSMatt MacyThis flag has no effect if the 365eda14cbcSMatt Macy.Sy embedded_data 366eda14cbcSMatt Macyfeature is disabled. 367eda14cbcSMatt MacyThe receiving system must have the 368eda14cbcSMatt Macy.Sy embedded_data 369eda14cbcSMatt Macyfeature enabled. 370eda14cbcSMatt MacyIf the 371eda14cbcSMatt Macy.Sy lz4_compress 372eda14cbcSMatt Macyfeature is active on the sending system, then the receiving system must have 37316038816SMartin Matuskathat feature enabled as well. 37416038816SMartin MatuskaDatasets that are sent with this flag may not be received as an encrypted dataset, 37516038816SMartin Matuskasince encrypted datasets cannot use the 376eda14cbcSMatt Macy.Sy embedded_data 377eda14cbcSMatt Macyfeature. 378eda14cbcSMatt MacySee 3793ff01b23SMartin Matuska.Xr zpool-features 7 380eda14cbcSMatt Macyfor details on ZFS feature flags and the 381eda14cbcSMatt Macy.Sy embedded_data 382eda14cbcSMatt Macyfeature. 383eda14cbcSMatt Macy.It Fl i Ar snapshot Ns | Ns Ar bookmark 384eda14cbcSMatt MacyGenerate an incremental send stream. 385eda14cbcSMatt MacyThe incremental source must be an earlier snapshot in the destination's history. 386eda14cbcSMatt MacyIt will commonly be an earlier snapshot in the destination's file system, in 387eda14cbcSMatt Macywhich case it can be specified as the last component of the name 388eda14cbcSMatt Macy.Po the 389eda14cbcSMatt Macy.Sy # 390eda14cbcSMatt Macyor 391eda14cbcSMatt Macy.Sy @ 392eda14cbcSMatt Macycharacter and following 393eda14cbcSMatt Macy.Pc . 394eda14cbcSMatt Macy.Pp 395eda14cbcSMatt MacyIf the incremental target is a clone, the incremental source can be the origin 396eda14cbcSMatt Macysnapshot, or an earlier snapshot in the origin's filesystem, or the origin's 397eda14cbcSMatt Macyorigin, etc. 398eda14cbcSMatt Macy.It Fl n , -dryrun 399eda14cbcSMatt MacyDo a dry-run 400eda14cbcSMatt Macy.Pq Qq No-op 401eda14cbcSMatt Macysend. 402eda14cbcSMatt MacyDo not generate any actual send data. 403eda14cbcSMatt MacyThis is useful in conjunction with the 404eda14cbcSMatt Macy.Fl v 405eda14cbcSMatt Macyor 406eda14cbcSMatt Macy.Fl P 407eda14cbcSMatt Macyflags to determine what data will be sent. 408eda14cbcSMatt MacyIn this case, the verbose output will be written to standard output 409eda14cbcSMatt Macy.Po contrast with a non-dry-run, where the stream is written to standard output 410eda14cbcSMatt Macyand the verbose output goes to standard error 411eda14cbcSMatt Macy.Pc . 412eda14cbcSMatt Macy.It Fl v , -verbose 413eda14cbcSMatt MacyPrint verbose information about the stream package generated. 414eda14cbcSMatt MacyThis information includes a per-second report of how much data has been sent. 415eda14cbcSMatt Macy.El 416eda14cbcSMatt Macy.It Xo 4177877fdebSMatt Macy.Nm zfs 418eda14cbcSMatt Macy.Cm send 419eda14cbcSMatt Macy.Fl -redact Ar redaction_bookmark 420eda14cbcSMatt Macy.Op Fl DLPcenpv 421eda14cbcSMatt Macy.Op Fl i Ar snapshot Ns | Ns Ar bookmark 422eda14cbcSMatt Macy.Ar snapshot 423eda14cbcSMatt Macy.Xc 424eda14cbcSMatt MacyGenerate a redacted send stream. 425eda14cbcSMatt MacyThis send stream contains all blocks from the snapshot being sent that aren't 426eda14cbcSMatt Macyincluded in the redaction list contained in the bookmark specified by the 427eda14cbcSMatt Macy.Fl -redact 428eda14cbcSMatt Macy(or 42916038816SMartin Matuska.Fl d ) 43016038816SMartin Matuskaflag. 431eda14cbcSMatt MacyThe resulting send stream is said to be redacted with respect to the snapshots 432eda14cbcSMatt Macythe bookmark specified by the 433eda14cbcSMatt Macy.Fl -redact No flag was created with. 434eda14cbcSMatt MacyThe bookmark must have been created by running 43516038816SMartin Matuska.Nm zfs Cm redact 436eda14cbcSMatt Macyon the snapshot being sent. 43716038816SMartin Matuska.Pp 438eda14cbcSMatt MacyThis feature can be used to allow clones of a filesystem to be made available on 439eda14cbcSMatt Macya remote system, in the case where their parent need not (or needs to not) be 440eda14cbcSMatt Macyusable. 441eda14cbcSMatt MacyFor example, if a filesystem contains sensitive data, and it has clones where 442eda14cbcSMatt Macythat sensitive data has been secured or replaced with dummy data, redacted sends 443eda14cbcSMatt Macycan be used to replicate the secured data without replicating the original 444eda14cbcSMatt Macysensitive data, while still sharing all possible blocks. 445eda14cbcSMatt MacyA snapshot that has been redacted with respect to a set of snapshots will 446eda14cbcSMatt Macycontain all blocks referenced by at least one snapshot in the set, but will 447eda14cbcSMatt Macycontain none of the blocks referenced by none of the snapshots in the set. 448eda14cbcSMatt MacyIn other words, if all snapshots in the set have modified a given block in the 449eda14cbcSMatt Macyparent, that block will not be sent; but if one or more snapshots have not 450eda14cbcSMatt Macymodified a block in the parent, they will still reference the parent's block, so 451eda14cbcSMatt Macythat block will be sent. 452eda14cbcSMatt MacyNote that only user data will be redacted. 45316038816SMartin Matuska.Pp 454eda14cbcSMatt MacyWhen the redacted send stream is received, we will generate a redacted 455eda14cbcSMatt Macysnapshot. 456eda14cbcSMatt MacyDue to the nature of redaction, a redacted dataset can only be used in the 457eda14cbcSMatt Macyfollowing ways: 45816038816SMartin Matuska.Bl -enum -width "a." 45916038816SMartin Matuska.It 46016038816SMartin MatuskaTo receive, as a clone, an incremental send from the original snapshot to one 461eda14cbcSMatt Macyof the snapshots it was redacted with respect to. 462eda14cbcSMatt MacyIn this case, the stream will produce a valid dataset when received because all 463eda14cbcSMatt Macyblocks that were redacted in the parent are guaranteed to be present in the 464eda14cbcSMatt Macychild's send stream. 465eda14cbcSMatt MacyThis use case will produce a normal snapshot, which can be used just like other 466eda14cbcSMatt Macysnapshots. 46716038816SMartin Matuska. 46816038816SMartin Matuska.It 46916038816SMartin MatuskaTo receive an incremental send from the original snapshot to something 470eda14cbcSMatt Macyredacted with respect to a subset of the set of snapshots the initial snapshot 471eda14cbcSMatt Macywas redacted with respect to. 472eda14cbcSMatt MacyIn this case, each block that was redacted in the original is still redacted 473eda14cbcSMatt Macy(redacting with respect to additional snapshots causes less data to be redacted 474eda14cbcSMatt Macy(because the snapshots define what is permitted, and everything else is 475eda14cbcSMatt Macyredacted)). 476eda14cbcSMatt MacyThis use case will produce a new redacted snapshot. 47716038816SMartin Matuska.It 47816038816SMartin MatuskaTo receive an incremental send from a redaction bookmark of the original 479eda14cbcSMatt Macysnapshot that was created when redacting with respect to a subset of the set of 480eda14cbcSMatt Macysnapshots the initial snapshot was created with respect to 481eda14cbcSMatt Macyanything else. 482eda14cbcSMatt MacyA send stream from such a redaction bookmark will contain all of the blocks 483eda14cbcSMatt Macynecessary to fill in any redacted data, should it be needed, because the sending 484eda14cbcSMatt Macysystem is aware of what blocks were originally redacted. 485eda14cbcSMatt MacyThis will either produce a normal snapshot or a redacted one, depending on 486eda14cbcSMatt Macywhether the new send stream is redacted. 48716038816SMartin Matuska.It 48816038816SMartin MatuskaTo receive an incremental send from a redacted version of the initial 489eda14cbcSMatt Macysnapshot that is redacted with respect to a subject of the set of snapshots the 490eda14cbcSMatt Macyinitial snapshot was created with respect to. 491eda14cbcSMatt MacyA send stream from a compatible redacted dataset will contain all of the blocks 492eda14cbcSMatt Macynecessary to fill in any redacted data. 493eda14cbcSMatt MacyThis will either produce a normal snapshot or a redacted one, depending on 494eda14cbcSMatt Macywhether the new send stream is redacted. 49516038816SMartin Matuska.It 49616038816SMartin MatuskaTo receive a full send as a clone of the redacted snapshot. 497eda14cbcSMatt MacySince the stream is a full send, it definitionally contains all the data needed 498eda14cbcSMatt Macyto create a new dataset. 499eda14cbcSMatt MacyThis use case will either produce a normal snapshot or a redacted one, depending 500eda14cbcSMatt Macyon whether the full send stream was redacted. 50116038816SMartin Matuska.El 50216038816SMartin Matuska.Pp 50316038816SMartin MatuskaThese restrictions are detected and enforced by 50416038816SMartin Matuska.Nm zfs Cm receive ; 50516038816SMartin Matuskaa redacted send stream will contain the list of snapshots that the stream is 506eda14cbcSMatt Macyredacted with respect to. 507eda14cbcSMatt MacyThese are stored with the redacted snapshot, and are used to detect and 50816038816SMartin Matuskacorrectly handle the cases above. 50916038816SMartin MatuskaNote that for technical reasons, 51016038816SMartin Matuskaraw sends and redacted sends cannot be combined at this time. 511eda14cbcSMatt Macy.It Xo 5127877fdebSMatt Macy.Nm zfs 513eda14cbcSMatt Macy.Cm send 514eda14cbcSMatt Macy.Op Fl Penv 515eda14cbcSMatt Macy.Fl t 516eda14cbcSMatt Macy.Ar receive_resume_token 517eda14cbcSMatt Macy.Xc 518eda14cbcSMatt MacyCreates a send stream which resumes an interrupted receive. 519eda14cbcSMatt MacyThe 520eda14cbcSMatt Macy.Ar receive_resume_token 521eda14cbcSMatt Macyis the value of this property on the filesystem or volume that was being 522eda14cbcSMatt Macyreceived into. 523eda14cbcSMatt MacySee the documentation for 52416038816SMartin Matuska.Nm zfs Cm receive Fl s 525eda14cbcSMatt Macyfor more details. 526eda14cbcSMatt Macy.It Xo 5277877fdebSMatt Macy.Nm zfs 528eda14cbcSMatt Macy.Cm send 529eda14cbcSMatt Macy.Op Fl Pnv 530eda14cbcSMatt Macy.Op Fl i Ar snapshot Ns | Ns Ar bookmark 531eda14cbcSMatt Macy.Fl S 532eda14cbcSMatt Macy.Ar filesystem 533eda14cbcSMatt Macy.Xc 534eda14cbcSMatt MacyGenerate a send stream from a dataset that has been partially received. 535eda14cbcSMatt Macy.Bl -tag -width "-L" 536eda14cbcSMatt Macy.It Fl S , -saved 537eda14cbcSMatt MacyThis flag requires that the specified filesystem previously received a resumable 53816038816SMartin Matuskasend that did not finish and was interrupted. 53916038816SMartin MatuskaIn such scenarios this flag 54016038816SMartin Matuskaenables the user to send this partially received state. 54116038816SMartin MatuskaUsing this flag will always use the last fully received snapshot 54216038816SMartin Matuskaas the incremental source if it exists. 543eda14cbcSMatt Macy.El 544eda14cbcSMatt Macy.It Xo 5457877fdebSMatt Macy.Nm zfs 546eda14cbcSMatt Macy.Cm redact 547eda14cbcSMatt Macy.Ar snapshot redaction_bookmark 54816038816SMartin Matuska.Ar redaction_snapshot Ns … 549eda14cbcSMatt Macy.Xc 550eda14cbcSMatt MacyGenerate a new redaction bookmark. 551eda14cbcSMatt MacyIn addition to the typical bookmark information, a redaction bookmark contains 552eda14cbcSMatt Macythe list of redacted blocks and the list of redaction snapshots specified. 553eda14cbcSMatt MacyThe redacted blocks are blocks in the snapshot which are not referenced by any 554eda14cbcSMatt Macyof the redaction snapshots. 555eda14cbcSMatt MacyThese blocks are found by iterating over the metadata in each redaction snapshot 556eda14cbcSMatt Macyto determine what has been changed since the target snapshot. 557eda14cbcSMatt MacyRedaction is designed to support redacted zfs sends; see the entry for 55816038816SMartin Matuska.Nm zfs Cm send 559eda14cbcSMatt Macyfor more information on the purpose of this operation. 560eda14cbcSMatt MacyIf a redact operation fails partway through (due to an error or a system 561eda14cbcSMatt Macyfailure), the redaction can be resumed by rerunning the same command. 562eda14cbcSMatt Macy.El 563eda14cbcSMatt Macy.Ss Redaction 564eda14cbcSMatt MacyZFS has support for a limited version of data subsetting, in the form of 56516038816SMartin Matuskaredaction. 56616038816SMartin MatuskaUsing the 56716038816SMartin Matuska.Nm zfs Cm redact 568eda14cbcSMatt Macycommand, a 569eda14cbcSMatt Macy.Sy redaction bookmark 57016038816SMartin Matuskacan be created that stores a list of blocks containing sensitive information. 57116038816SMartin MatuskaWhen provided to 57216038816SMartin Matuska.Nm zfs Cm send , 573eda14cbcSMatt Macythis causes a 574eda14cbcSMatt Macy.Sy redacted send 57516038816SMartin Matuskato occur. 57616038816SMartin MatuskaRedacted sends omit the blocks containing sensitive information, 57716038816SMartin Matuskareplacing them with REDACT records. 57816038816SMartin MatuskaWhen these send streams are received, a 579eda14cbcSMatt Macy.Sy redacted dataset 58016038816SMartin Matuskais created. 58116038816SMartin MatuskaA redacted dataset cannot be mounted by default, since it is incomplete. 58216038816SMartin MatuskaIt can be used to receive other send streams. 58316038816SMartin MatuskaIn this way datasets can be used for data backup and replication, 58416038816SMartin Matuskawith all the benefits that zfs send and receive have to offer, 58516038816SMartin Matuskawhile protecting sensitive information from being 586eda14cbcSMatt Macystored on less-trusted machines or services. 587eda14cbcSMatt Macy.Pp 58816038816SMartin MatuskaFor the purposes of redaction, there are two steps to the process. 58916038816SMartin MatuskaA redact step, and a send/receive step. 59016038816SMartin MatuskaFirst, a redaction bookmark is created. 59116038816SMartin MatuskaThis is done by providing the 59216038816SMartin Matuska.Nm zfs Cm redact 593eda14cbcSMatt Macycommand with a parent snapshot, a bookmark to be created, and a number of 59416038816SMartin Matuskaredaction snapshots. 59516038816SMartin MatuskaThese redaction snapshots must be descendants of the parent snapshot, 59616038816SMartin Matuskaand they should modify data that is considered sensitive in some way. 59716038816SMartin MatuskaAny blocks of data modified by all of the redaction snapshots will 598eda14cbcSMatt Macybe listed in the redaction bookmark, because it represents the truly sensitive 59916038816SMartin Matuskainformation. 60016038816SMartin MatuskaWhen it comes to the send step, the send process will not send 601eda14cbcSMatt Macythe blocks listed in the redaction bookmark, instead replacing them with 60216038816SMartin MatuskaREDACT records. 60316038816SMartin MatuskaWhen received on the target system, this will create a 604eda14cbcSMatt Macyredacted dataset, missing the data that corresponds to the blocks in the 60516038816SMartin Matuskaredaction bookmark on the sending system. 60616038816SMartin MatuskaThe incremental send streams from 607eda14cbcSMatt Macythe original parent to the redaction snapshots can then also be received on 608eda14cbcSMatt Macythe target system, and this will produce a complete snapshot that can be used 60916038816SMartin Matuskanormally. 61016038816SMartin MatuskaIncrementals from one snapshot on the parent filesystem and another 611eda14cbcSMatt Macycan also be done by sending from the redaction bookmark, rather than the 612eda14cbcSMatt Macysnapshots themselves. 613eda14cbcSMatt Macy.Pp 61416038816SMartin MatuskaIn order to make the purpose of the feature more clear, an example is provided. 61516038816SMartin MatuskaConsider a zfs filesystem containing four files. 61616038816SMartin MatuskaThese files represent information for an online shopping service. 61716038816SMartin MatuskaOne file contains a list of usernames and passwords, another contains purchase histories, 61816038816SMartin Matuskaa third contains click tracking data, and a fourth contains user preferences. 61916038816SMartin MatuskaThe owner of this data wants to make it available for their development teams to 62016038816SMartin Matuskatest against, and their market research teams to do analysis on. 62116038816SMartin MatuskaThe development teams need information about user preferences and the click 622eda14cbcSMatt Macytracking data, while the market research teams need information about purchase 62316038816SMartin Matuskahistories and user preferences. 62416038816SMartin MatuskaNeither needs access to the usernames and passwords. 62516038816SMartin MatuskaHowever, because all of this data is stored in one ZFS filesystem, 62616038816SMartin Matuskait must all be sent and received together. 62716038816SMartin MatuskaIn addition, the owner of the data 628eda14cbcSMatt Macywants to take advantage of features like compression, checksumming, and 62916038816SMartin Matuskasnapshots, so they do want to continue to use ZFS to store and transmit their data. 63016038816SMartin MatuskaRedaction can help them do so. 63116038816SMartin MatuskaFirst, they would make two clones of a snapshot of the data on the source. 63216038816SMartin MatuskaIn one clone, they create the setup they want their market research team to see; 63316038816SMartin Matuskathey delete the usernames and passwords file, 63416038816SMartin Matuskaand overwrite the click tracking data with dummy information. 63516038816SMartin MatuskaIn another, they create the setup they want the development teams 636eda14cbcSMatt Macyto see, by replacing the passwords with fake information and replacing the 63716038816SMartin Matuskapurchase histories with randomly generated ones. 63816038816SMartin MatuskaThey would then create a redaction bookmark on the parent snapshot, 63916038816SMartin Matuskausing snapshots on the two clones as redaction snapshots. 64016038816SMartin MatuskaThe parent can then be sent, redacted, to the target 64116038816SMartin Matuskaserver where the research and development teams have access. 64216038816SMartin MatuskaFinally, incremental sends from the parent snapshot to each of the clones can be sent 643eda14cbcSMatt Macyto and received on the target server; these snapshots are identical to the 644eda14cbcSMatt Macyones on the source, and are ready to be used, while the parent snapshot on the 645eda14cbcSMatt Macytarget contains none of the username and password data present on the source, 646eda14cbcSMatt Macybecause it was removed by the redacted send operation. 64716038816SMartin Matuska. 648eda14cbcSMatt Macy.Sh SEE ALSO 649eda14cbcSMatt Macy.Xr zfs-bookmark 8 , 650eda14cbcSMatt Macy.Xr zfs-receive 8 , 651eda14cbcSMatt Macy.Xr zfs-redact 8 , 652eda14cbcSMatt Macy.Xr zfs-snapshot 8 653