xfs error : “mount: Structure needs cleaning”

When we want to mount a xfs partition, sometimes we get “mount: Structure needs cleaning” error, and we can not mount a server.

# mount /dev/md2 /data
mount: Structure needs cleaning

Sometime using this command, we will get return

xfs_repair -n /dev/md2

But when we try to mount, we still get this error,

# xfs_check /dev/md2
ERROR: The filesystem has valuable metadata changes in a log which needs to
be replayed. Mount the filesystem to replay the log, and unmount it before
re-running xfs_check. If you are unable to mount the filesystem, then use
the xfs_repair -L option to destroy the log and attempt a repair.
Note that destroying the log may cause corruption — please attempt a mount
of the filesystem before doing this.

We can repair xfs device using this command,

xfs_repair -L /dev/md2

After that, try to mount using this command,

# mount /dev/sdb1 /disk2

Leave a Reply

Your email address will not be published. Required fields are marked *