Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
ZFS-REWRITE(8)		     System Manager's Manual		  ZFS-REWRITE(8)

NAME
     zfs-rewrite -- rewrite specified files without modification

SYNOPSIS
     zfs rewrite [-Prvx] [-l length] [-o offset] file|directorya|

DESCRIPTION
     Rewrite  blocks of specified file as is without modification at a new loca-
     tion and possibly with new properties, as if they were atomically read  and
     written  back.   See  "NOTES".  for more information about property changes
     that may be applied during rewrite.

     -P  Perform physical rewrite, preserving logical birth time of blocks.   By
	 default,  rewrite  updates logical birth times, making blocks appear as
	 modified in snapshots and incremental send streams.   Physical  rewrite
	 preserves logical birth times, avoiding unnecessary inclusion in incre-
	 mental streams.  Physical rewrite requires the physical_rewrite feature
	 to be enabled on the pool.

     -l length
	 Rewrite at most this number of bytes.

     -o offset
	 Start at this offset in bytes.

     -r  Recurse into directories.

     -v  Print names of all successfully rewritten files.

     -x  Don't cross file system mount points when recursing.

NOTES
     Rewrite  works  by replacing an existing block with a new block of the same
     logical size.  Changed dataset properties that operate on the data or meta-
     data without changing the logical size  will  be  applied.   These  include
     checksum, compression, dedup and copies.  Changes to properties that affect
     the size of a logical block, like recordsize, will have no effect.

     Rewrite of cloned blocks and blocks that are part of any snapshots, same as
     some property changes may increase pool space usage.  Holes that were never
     written  or  were previously zero-compressed are not rewritten and will re-
     main holes even if compression is disabled.

     If a -l or -o value request a rewrite to regions past the end of the  file,
     then those regions are silently ignored, and no error is reported.

     By  default, rewritten blocks update their logical birth time, meaning they
     will be included in incremental zfs send streams as  modified  data.   When
     the  -P  flag  is used, rewritten blocks preserve their logical birth time,
     since there are no user data changes.

SEE ALSO
     zfsprops(7), zpool-features(7)

FreeBSD ports 15.quarterly	November 5, 2025		  ZFS-REWRITE(8)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=zfs-rewrite&sektion=8&manpath=FreeBSD+Ports+15.1.quarterly>

home | help