logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

zstream — manipulate ZFS send streams

Description

       The zstream utility manipulates ZFS send streams output by the zfssend command.

       zstreamdump [-Cvd] [file]
         Print  information  about  the  specified  send  stream, including headers and record counts.  The send
         stream may either be in the specified file, or provided on standard input.

         -C  Suppress the validation of checksums.

         -v  Verbose.  Print metadata for each record.

         -d  Dump data contained in each record.  Implies verbose.

         The zstreamdump alias is provided for compatibility and is equivalent to running zstreamdump.

       zstreamtokenresume_token
         Dumps zfs resume token information

       zstreamdecompress [-v] [object,offset[,type...]]
         Decompress selected records in a ZFS send stream provided on standard input, when the compression  type
         recorded  in  ZFS  metadata may be incorrect.  Specify the object number and byte offset of each record
         that you wish to decompress.  Optionally specify the compression type.  Valid compression types include
         off, gzip, lz4, lzjb, zstd, and zle.  The default is lz4.  Every record for that  object  beginning  at
         that  offset  will  be  decompressed,  if  possible.  It may not be possible, because the record may be
         corrupted in some but not all of the stream's snapshots.  Specifying a compression  type  of  off  will
         change  the stream's metadata accordingly, without attempting decompression.  This can be useful if the
         record is already uncompressed but the metadata insists otherwise.  The repaired stream will be written
         to standard output.

         -v  Verbose.  Print summary of decompressed records.

       zstreamredup [-v] file
         Deduplicated send streams can be generated by using the zfssend-D  command.   The  ability  to  send
         deduplicated  send  streams  is  deprecated.  In the future, the ability to receive a deduplicated send
         stream with zfsreceive will be removed.  However, deduplicated send streams can still be  received  by
         utilizing zstreamredup.

         The  zstreamredup  command  is  provided a file containing a deduplicated send stream, and outputs an
         equivalent non-deduplicated send stream on standard output.  Therefore, a deduplicated send stream  can
         be received by running:
               #zstreamredupDEDUP_STREAM_FILE | zfsreceive-v  Verbose.  Print summary of converted records.

       zstreamrecompress [-llevel] algorithm
         Recompresses  a  send  stream,  provided  on  standard input, using the provided algorithm and optional
         level, and writes the modified stream to standard output.  All WRITE records in the send stream will be
         recompressed, unless they fail to result in size reduction compared to being  left  uncompressed.   The
         provided  algorithm  can be any valid value to the compress property.  Note that encrypted send streams
         cannot be recompressed.

         -llevel
             Specifies compression level.  Only needed for algorithms where the level is not implied as part  of
             the name of the algorithm (e.g. gzip-3 does not require it, while zstd does, if a non-default level
             is desired).

Examples

       Heal a dataset that was corrupted due to OpenZFS bug #12762.  First, determine which records are corrupt.
       That  cannot  be  done  automatically;  it  requires information beyond ZFS's metadata.  If object 128 is
       corrupted at offset 0 and is compressed using lz4, then run this command:

       # zfssend-c | zstreamdecompress128,0,lz4 | zfsrecv

Name

       zstream — manipulate ZFS send streams

See Also

zfs(8), zfs-receive(8), zfs-send(8), https://github.com/openzfs/zfs/issues/12762

OpenZFS                                          October 4, 2022                                      ZSTREAM(8)

Synopsis

zstreamdump [-Cvd] [file]
       zstreamdecompress [-v] [object,offset[,type...]]
       zstreamredup [-v] filezstreamtokenresume_tokenzstreamrecompress [-llevel] algorithm

See Also