$linuxjunkies
>

zfs-receive(8)

Receives a ZFS dataset stream and reconstructs the dataset on the receiving system.

UbuntuDebianFedoraArch

Synopsis

zfs receive [-vnFeu] [-d|-e] [-o prop=value]... [dataset|snapshot]

Description

The zfs receive command reads a stream (typically created by zfs send) from standard input and reconstructs ZFS datasets and snapshots. It is commonly used for backup, replication, and migration of ZFS storage pools.

The receiving system must have the parent dataset already created. Receive operations are transactional and atomic—partial streams will roll back automatically if interrupted. The command preserves dataset properties, snapshots, and incremental changes when using incremental streams.

Common options

FlagWhat it does
-vVerbose output; prints dataset name and size of each received snapshot
-nPerform a dry-run; validate the stream without writing data
-FForce rollback of the target dataset to the snapshot from the send stream before receiving
-eDiscard everything in the stream before the first snapshot; use for incremental streams to new dataset
-dDiscard the first element of the dataset path; useful for changing the dataset hierarchy
-uReceive and mount the dataset, even if it was previously not mounted
-o prop=valueOverride or set dataset properties during receive (e.g., -o mountpoint=/mnt/data)
-x propExclude a dataset property from being received; useful for not overwriting local settings

Examples

Send a full snapshot from local pool to a remote system over SSH

zfs send pool/dataset@snapshot | ssh remote zfs receive pool/dataset

Receive an incremental stream (changes between snap1 and snap2) into a backup pool

zfs send -i pool/dataset@snap1 pool/dataset@snap2 | zfs receive backup/dataset

Perform a dry-run to validate a backup stream before actually receiving it

zfs receive -n pool/dataset < backup.zfs

Force rollback the target dataset and receive the snapshot stream, overwriting local changes

zfs receive -F pool/dataset < latest-snapshot.zfs

Receive a recursive snapshot stream, stripping the first element to place under backup pool

zfs send -R pool/dataset@snap | zfs receive -d backup

Receive a full backup with verbose output showing progress

zfs receive -v pool/restored < full-backup.zfs

Send incremental stream with progress monitoring (pv) and auto-mount on receive

zfs send -i pool/data@daily pool/data@daily-2 | pv | ssh remote zfs receive -u backup/data

Related commands