Home

xfsrepair

Xfs_repair is a file system repair utility for the XFS filesystem, part of the xfsprogs package. It is used to diagnose and repair metadata inconsistencies that can occur after unexpected shutdowns, crashes, or disk errors. The tool examines the on-disk structures of an XFS filesystem, including the superblock, inode and extent trees, directories, and free-space structures, and attempts to restore consistency so the filesystem can be mounted safely again.

Xfs_repair operates on an unmounted filesystem or one mounted read-only. It is invoked with the device file

Common usage patterns include performing a dry run with the -n option to review what would be

Xfs_repair is a tool focused on metadata integrity and consistency in the XFS family; it is typically

or
a
filesystem
image
as
an
argument,
for
example
xfs_repair
/dev/sdXN.
In
a
maintenance
environment,
it
should
be
run
on
a
non-mounted
or
read-only
filesystem.
The
tool
repairs
metadata
and
can
reclaim
orphaned
inodes
or
fix
directory
entries.
It
does
not
guarantee
full
data
recovery;
user
data
blocks
may
be
lost
if
they
have
been
overwritten
or
corrupted.
repaired
without
making
changes,
and
using
the
-L
option
to
zero
the
log
if
the
journal
is
corrupted.
There
are
additional
options
to
control
the
depth
of
repair
or
to
force
repairs
in
damaged
conditions,
and
users
are
advised
to
consult
the
manual
for
details.
After
a
successful
repair,
the
filesystem
can
be
mounted
again;
in
some
cases
a
subsequent
pass
is
unnecessary,
though
occasional
rechecks
may
be
performed
to
confirm
integrity.
used
as
part
of
a
broader
data
recovery
workflow
and
is
complemented
by
other
xfsprogs
utilities
such
as
mkfs.xfs
and
xfs_growfs.