ZFS-REWRITE(8)
β¨ zfs-rewrite π
okay bestie, welcome to zfs-rewrite β that's the manual page for the zfs rewrite command in the System Manager's Manual section. She's here to rewrite your files without changing a single byte of them and honestly? iconic behavior. π
πΈ NAME πΈ
zfs-rewrite β rewrite specified files without modification. no cap, the data stays exactly the same, it just gets a whole new lease on life. β¨
π¦ SYNOPSIS π¦
zfs rewrite [-Prvx] [-l length] [-o offset] file|directoryβ¦
π DESCRIPTION π
So here's the tea: this command rewrites blocks of the file you point at as is, without modification, but at a new location, and possibly with new properties β like, imagine the file got atomically read and written back. glow up but make it byte-identical. π«Ά
if you wanna know which properties can actually get applied during a rewrite, go read the βNOTESβ section below, it's all in there. π
π OPTIONS π
-Pβ perform a physical rewrite, preserving the logical birth time of blocks. by default, rewrite updates logical birth times, which makes blocks look modified in snapshots and incremental send streams. a physical rewrite keeps those logical birth times intact, so you avoid unnecessary inclusion in incremental streams. β οΈ heads up though: physical rewrite requires thephysical_rewritefeature to be enabled on the pool β no feature, no rewrite, periodt.-llength β rewrite at most this number of bytes. that's it, that's the whole vibe. π-ooffset β start at this offset in bytes. like, where do we begin, bestie? π-rβ recurse into directories. go down the whole tree, main character energy. π³-vβ print the names of all successfully rewritten files. very "let me announce every W out loud". π£οΈ-xβ don't cross file system mount points when recursing. stay in your lane (affectionate). π§
π₯ NOTES π₯
okay this is the part you actually need, so like, pay attention. π
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 metadata without changing the logical size will be applied. that includes:
checksumcompressiondedupcopies
but bestieβ¦ changes to properties that affect the size of a logical block, like recordsize, will have no effect. she said no. π
rewrite of cloned blocks and blocks that are part of any snapshots β same as some property changes β may increase pool space usage. keep an eye on that. π
also: holes that were never written, or were previously zero-compressed, are not rewritten and will remain holes even if compression is disabled. a hole is a hole is a hole. π³οΈβ¨
and this one's lowkey important: if a -l or -o value requests a rewrite to regions past the end of the file, then those regions are silently ignored, and no error is reported. she justβ¦ doesn't mention it. π
by default, rewritten blocks update their logical birth time, meaning they'll be included in incremental zfs send streams as modified data. when you use the -P flag though, rewritten blocks preserve their logical birth time, since there are no user data changes. slay. π
π SEE ALSO π
and that's the whole page, bestie!! π₯³ this was brought to you by OpenZFS, dated November 5, 2025 β go rewrite something, you absolute icon. ππ¦πΈ
π¦ where this page comes from
- alpine 3.23: zfs-doc 2.4.4-r0 Β· CDDL-1.0
- alpine 3.24: zfs-doc 2.4.4-r0 Β· CDDL-1.0
- nixos 26.05: zfs-user 2.4.4
- nixpkgs unstable: zfs-user 2.4.4
- ubuntu resolute: zfsutils-linux 2.4.1-1ubuntu5 Β· CDDL-1.0
- ubuntu resolute: zfsutils-linux 2.4.1-1ubuntu5.1 Β· CDDL-1.0
- ubuntu stonking: zfsutils-linux 2.4.4-1ubuntu4 Β· CDDL-1.0
- π the page's license: CDDL-1.0
- Copyright (c) 2025 iXsystems, Inc
- Copyright (c) 2025, Klara, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms