Skip to content

Commit 587d039

Browse files
committed
Apply @JaspalSuri's README Changes to man Page
Updates `dedup.1` with the improved README content.
1 parent 8798c9d commit 587d039

3 files changed

Lines changed: 54 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ causes several race conditions if underlying files are being modified. If a file
176176
acting as a clone source or target is modified between any of the following
177177
events, a file may be replaced by something that resembles it's previous state.
178178

179+
`dedup` operates by following this order of operations:
180+
179181
1. File metadata retrieval and comparison to previously seen files
180182
2. Creation of a clone from a source
181183
3. Application of file metadata from the target

dedup.1

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,53 @@ the same permissions, metadata, and ACLs. Support for copying metadata comes
206206
from
207207
.Xr copyfile 3
208208
.
209+
.Pp
210+
.Nm
211+
shouldn't be used on directories or files where files are actively being
212+
modified. In it's current implementation
213+
.Nm
214+
doesn't lock any files which causes several race conditions if underlying
215+
files are being modified. If a file acting as a clone source or target is
216+
modified between any of the following events, a file may be replaced by
217+
something that resembles it's previous state.
218+
.Pp
219+
.Nm
220+
operates by following this order of operations:
221+
.Bl -enum -offset indent
222+
.It
223+
File metadata retrieval and comparison to previously seen files
224+
.It
225+
Creation of a clone from a source
226+
.It
227+
Application of file metadata from the target
228+
.It
229+
Replacing the target with the clone
230+
.El
231+
.Pp
232+
For example, if file
233+
.Li a
234+
is seen and later file
235+
.Li b
236+
is found to be a match,
237+
.Li a
238+
may be changed, causing
239+
.Li b
240+
to be cloned to its new content. Likewise, file
241+
.Li b
242+
may be changed and then overwritten by a clone with it's previous content.
243+
.Pp
244+
It may be reasonable for future versions to include additional checks and locks
245+
to ensure modifications are detected prior to clone replacement.
246+
.Ss Block Corruption Risk
247+
APFS cloning deduplicates storage by making all instances of a file reference the
248+
same underlying blocks.
249+
.Em If even one of those blocks becomes corrupted, all cloned instances are
250+
.Em affected.
251+
This is not a problem with
252+
.Nm
253+
or something that
254+
.Nm
255+
can prevent, but is a fact of any filesystem. Reducing the number of copies in a
256+
single volume reduces one level of redundancy. This may pose a risk for unique or
257+
irreplaceable files. It is always a good idea to maintain backups on different
258+
logical volumes of any files, including ones that may be deduplicated.

dict

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ clonefile
2525
copyfile
2626
dedup
2727
deduplicated
28+
deduplicates
2829
deduplicating
2930
du
3031
enum
32+
filesystem
3133
hardlink
3234
hardlinked
3335
hw

0 commit comments

Comments
 (0)