summaryrefslogtreecommitdiffstats
path: root/man/man8
diff options
context:
space:
mode:
authorLOLi <[email protected]>2017-05-10 01:21:09 +0200
committerBrian Behlendorf <[email protected]>2017-05-09 16:21:09 -0700
commita3eeab2de68670a4481eab3d086982aff23b6906 (patch)
tree5e3da58bca04309596df84dd84b591e8631eae0f /man/man8
parent305bc4b370b20de81eaf10a1cf724374258b74d1 (diff)
Add property overriding (-o|-x) to 'zfs receive'
This allows users to specify "-o property=value" to override and "-x property" to exclude properties when receiving a zfs send stream. Both native and user properties can be specified. This is useful when using zfs send/receive for periodic backup/replication because it lets users change properties such as canmount, mountpoint, or compression without modifying the source. References: https://www.illumos.org/issues/2745 https://www.illumos.org/issues/3753 Reviewed by: Matthew Ahrens <[email protected]> Reviewed-by: Alek Pinchuk <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: loli10K <[email protected]> Closes #1350 Closes #5349
Diffstat (limited to 'man/man8')
-rw-r--r--man/man8/zfs.846
1 files changed, 42 insertions, 4 deletions
diff --git a/man/man8/zfs.8 b/man/man8/zfs.8
index 5d0b79b99..c591ca788 100644
--- a/man/man8/zfs.8
+++ b/man/man8/zfs.8
@@ -190,12 +190,14 @@ zfs \- configures ZFS file systems
.LP
.nf
-\fBzfs\fR \fBreceive\fR [\fB-Fnsuv\fR] [\fB-o origin\fR=\fIsnapshot\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
+\fBzfs\fR \fBreceive\fR [\fB-Fnsuv\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... [\fB-x\fR \fIproperty\fR] ...
+ \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
.fi
.LP
.nf
-\fBzfs\fR \fBreceive\fR [\fB-Fnsuv\fR] [\fB-d\fR|\fB-e\fR] [\fB-o origin\fR=\fIsnapshot\fR] \fIfilesystem\fR
+\fBzfs\fR \fBreceive\fR [\fB-Fnsuv\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... [\fB-x\fR \fIproperty\fR] ...
+ [\fB-d\fR|\fB-e\fR] \fIfilesystem\fR
.fi
.LP
@@ -2984,11 +2986,11 @@ Creates a send stream which resumes an interrupted receive. The \fIreceive_resum
.sp
.ne 2
.na
-\fB\fBzfs receive\fR [\fB-Fnsuv\fR] [\fB-o origin\fR=\fIsnapshot\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
+\fB\fBzfs receive\fR [\fB-Fnsuv\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... [\fB-x\fR \fIproperty\fR] ... \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
.ad
.br
.na
-\fB\fBzfs receive\fR [\fB-Fnsuv\fR] [\fB-d\fR|\fB-e\fR] [\fB-o origin\fR=\fIsnapshot\fR] \fIfilesystem\fR\fR
+\fB\fBzfs receive\fR [\fB-Fnsuv\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... [\fB-x\fR \fIproperty\fR] ... [\fB-d\fR|\fB-e\fR] \fIfilesystem\fR\fR
.ad
.sp .6
.RS 4n
@@ -2998,6 +3000,8 @@ If an incremental stream is received, then the destination file system must alre
.sp
When a snapshot replication package stream that is generated by using the \fBzfs send\fR \fB-R\fR command is received, any snapshots that do not exist on the sending location are destroyed by using the \fBzfs destroy\fR \fB-d\fR command.
.sp
+If \fB-o\fR \fIproperty\fR=\fIvalue\fR or \fB-x\fR \fIproperty\fR is specified, it applies to the effective value of the property throughout the entire subtree of replicated datasets. Effective property values will be set (-o) or inherited (-x) on the topmost in the replicated subtree. In descendant datasets, if the property is set by the send stream, it will be overridden by forcing the property to be inherited from the topmost filesystem. Received properties are retained in spite of being overridden and may be restored with \fBzfs inherit\fR \fB-S\fR. Specifying \fB-o origin\fR=\fIsnapshot\fR is a special case because, even if \fBorigin\fR is a read-only property and cannot be set, it allows to receive the send stream as a clone of the given snapshot.
+.sp
The name of the snapshot (and file system, if a full stream is received) that this subcommand creates depends on the argument type and the use of the \fB-d\fR or \fB-e\fR options.
.sp
If the argument is a snapshot name, the specified \fIsnapshot\fR is created. If the argument is a file system or volume name, a snapshot with the same name as the sent snapshot is created within the specified \fIfilesystem\fR or \fIvolume\fR. If neither of the \fB-d\fR or \fB-e\fR options are specified, the provided target snapshot name is used exactly as provided.
@@ -3060,6 +3064,40 @@ Print verbose information about the stream and the time required to perform the
.sp
.ne 2
+.mk
+.na
+\fB-o\fR \fIproperty\fR=\fIvalue\fR
+.ad
+.sp .6
+.RS 4n
+Sets the specified property as if the command \fBzfs set\fR \fIproperty\fR=\fIvalue\fR was invoked immediately before the receive. When receiving a stream from \fBzfs send -R\fR, causes the property to be inherited by all descendant datasets, as through \fBzfs inherit\fR \fIproperty\fR was run on any descendant datasets that have this property set on the sending system.
+.sp
+Any editable ZFS property can be set at receive time. Set-once properties bound to the received data, such as \fBnormalization\fR and \fBcasesensitivity\fR, cannot be set at receive time even when the datasets are newly created by zfs receive. Additionally both settable properties \fBversion\fR and \fBvolsize\fR cannot be set at receive time.
+.sp
+The \fB-o\fR option may be specified multiple times, for different properties. An error results if the same property is specified in multiple \fB-o\fR or \fB-x\fR options.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB-x\fR \fIproperty\fR
+.ad
+.sp .6
+.RS 4n
+Ensures that the effective value of the specified property after the receive is unaffected by the value of that property in the send stream (if any), as if the property had been excluded from the send stream.
+.sp
+If the specified property is not present in the send stream, this option does nothing.
+.sp
+If a received property needs to be overridden, the effective value will be set or inherited, depending on whether the property is inheritable or not.
+.sp
+In the case of an incremental update, \fB-x\fR leaves any existing local setting or explicit inheritance unchanged.
+.sp
+All \fB-o\fR restrictions on set-once and special properties apply equally to \fB-x\fR.
+.RE
+
+.sp
+.ne 2
.na
\fB\fB-d\fR\fR
.ad