1*b1c1ee44SMartin Matuska.\" SPDX-License-Identifier: CDDL-1.0 2*b1c1ee44SMartin Matuska.\" 3*b1c1ee44SMartin Matuska.\" CDDL HEADER START 4*b1c1ee44SMartin Matuska.\" 5*b1c1ee44SMartin Matuska.\" The contents of this file are subject to the terms of the 6*b1c1ee44SMartin Matuska.\" Common Development and Distribution License (the "License"). 7*b1c1ee44SMartin Matuska.\" You may not use this file except in compliance with the License. 8*b1c1ee44SMartin Matuska.\" 9*b1c1ee44SMartin Matuska.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*b1c1ee44SMartin Matuska.\" or https://opensource.org/licenses/CDDL-1.0. 11*b1c1ee44SMartin Matuska.\" See the License for the specific language governing permissions 12*b1c1ee44SMartin Matuska.\" and limitations under the License. 13*b1c1ee44SMartin Matuska.\" 14*b1c1ee44SMartin Matuska.\" When distributing Covered Code, include this CDDL HEADER in each 15*b1c1ee44SMartin Matuska.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*b1c1ee44SMartin Matuska.\" If applicable, add the following below this CDDL HEADER, with the 17*b1c1ee44SMartin Matuska.\" fields enclosed by brackets "[]" replaced with your own identifying 18*b1c1ee44SMartin Matuska.\" information: Portions Copyright [yyyy] [name of copyright owner] 19*b1c1ee44SMartin Matuska.\" 20*b1c1ee44SMartin Matuska.\" CDDL HEADER END 21*b1c1ee44SMartin Matuska.\" 22*b1c1ee44SMartin Matuska.\" Copyright (c) 2025 iXsystems, Inc. 23*b1c1ee44SMartin Matuska.\" 24*b1c1ee44SMartin Matuska.Dd May 6, 2025 25*b1c1ee44SMartin Matuska.Dt ZFS-REWRITE 8 26*b1c1ee44SMartin Matuska.Os 27*b1c1ee44SMartin Matuska. 28*b1c1ee44SMartin Matuska.Sh NAME 29*b1c1ee44SMartin Matuska.Nm zfs-rewrite 30*b1c1ee44SMartin Matuska.Nd rewrite specified files without modification 31*b1c1ee44SMartin Matuska.Sh SYNOPSIS 32*b1c1ee44SMartin Matuska.Nm zfs 33*b1c1ee44SMartin Matuska.Cm rewrite 34*b1c1ee44SMartin Matuska.Oo Fl rvx Ns Oc 35*b1c1ee44SMartin Matuska.Op Fl l Ar length 36*b1c1ee44SMartin Matuska.Op Fl o Ar offset 37*b1c1ee44SMartin Matuska.Ar file Ns | Ns Ar directory Ns … 38*b1c1ee44SMartin Matuska. 39*b1c1ee44SMartin Matuska.Sh DESCRIPTION 40*b1c1ee44SMartin MatuskaRewrite blocks of specified 41*b1c1ee44SMartin Matuska.Ar file 42*b1c1ee44SMartin Matuskaas is without modification at a new location and possibly with new 43*b1c1ee44SMartin Matuskaproperties, such as checksum, compression, dedup, copies, etc, 44*b1c1ee44SMartin Matuskaas if they were atomically read and written back. 45*b1c1ee44SMartin Matuska.Bl -tag -width "-r" 46*b1c1ee44SMartin Matuska.It Fl l Ar length 47*b1c1ee44SMartin MatuskaRewrite at most this number of bytes. 48*b1c1ee44SMartin Matuska.It Fl o Ar offset 49*b1c1ee44SMartin MatuskaStart at this offset in bytes. 50*b1c1ee44SMartin Matuska.It Fl r 51*b1c1ee44SMartin MatuskaRecurse into directories. 52*b1c1ee44SMartin Matuska.It Fl v 53*b1c1ee44SMartin MatuskaPrint names of all successfully rewritten files. 54*b1c1ee44SMartin Matuska.It Fl x 55*b1c1ee44SMartin MatuskaDon't cross file system mount points when recursing. 56*b1c1ee44SMartin Matuska.El 57*b1c1ee44SMartin Matuska.Sh NOTES 58*b1c1ee44SMartin MatuskaRewrite of cloned blocks and blocks that are part of any snapshots, 59*b1c1ee44SMartin Matuskasame as some property changes may increase pool space usage. 60*b1c1ee44SMartin MatuskaHoles that were never written or were previously zero-compressed are 61*b1c1ee44SMartin Matuskanot rewritten and will remain holes even if compression is disabled. 62*b1c1ee44SMartin Matuska.Pp 63*b1c1ee44SMartin MatuskaRewritten blocks will be seen as modified in next snapshot and as such 64*b1c1ee44SMartin Matuskaincluded into the incremental 65*b1c1ee44SMartin Matuska.Nm zfs Cm send 66*b1c1ee44SMartin Matuskastream. 67*b1c1ee44SMartin Matuska.Pp 68*b1c1ee44SMartin MatuskaIf a 69*b1c1ee44SMartin Matuska.Fl l 70*b1c1ee44SMartin Matuskaor 71*b1c1ee44SMartin Matuska.Fl o 72*b1c1ee44SMartin Matuskavalue request a rewrite to regions past the end of the file, then those 73*b1c1ee44SMartin Matuskaregions are silently ignored, and no error is reported. 74*b1c1ee44SMartin Matuska. 75*b1c1ee44SMartin Matuska.Sh SEE ALSO 76*b1c1ee44SMartin Matuska.Xr zfsprops 7 77