Home

reflink

Reflink, short for reference link, is a feature used by some copy-on-write file systems to create a new file that shares the same data blocks as an existing file. The two files appear as separate entities, but initially they reference the same on-disk blocks. A write to either file triggers a copy-on-write operation, resulting in distinct data blocks for the modified file while the other retains its original content.

This capability is commonly available on copy-on-write file systems such as Btrfs and similar technologies. In

Scope and limitations: Reflink copies are only possible within the same filesystem that implements the feature.

See also: Copy-on-write, cloning, lightweight copies, Btrfs.

practice,
reflink
allows
a
fast,
space-efficient
“copy”
of
a
file,
since
no
data
is
immediately
duplicated.
Users
can
create
such
a
copy
via
high-level
tools
that
support
reflink,
notably
the
cp
command
with
the
--reflink
option
(for
example,
cp
--reflink=auto
src
dst).
If
the
destination
filesystem
does
not
support
reflink,
the
tool
will
usually
fall
back
to
a
regular
data
copy.
They
do
not
cross
filesystem
boundaries.
Deleting
one
of
the
two
files
does
not
necessarily
reclaim
all
data
blocks
until
the
last
link
is
removed.
The
performance
benefit
includes
reduced
I/O
and
faster
duplication
for
large
files,
but
some
backup
and
deduplication
strategies
may
not
treat
reflinked
copies
as
independent.