mount: Structure needs cleaning. How to repair without losing data?

Latest response

I am meeting the following issue:
[root@hostname ~]# mount /dev/db2vg/lcData /home/db2inst2
mount: mount /dev/mapper/db2vg-lcData on /home/db2inst2 failed: Structure needs cleaning
[root@hostname ~]# xfs_repair -n /dev/db2vg/lcData

a detail in the attachment.

How can I repair this filesystem without losing my data?



[root@hostname ~]# xfs_repair /dev/db2vg/lcData

Phase 1 - find and verify superblock...
Phase 2 - using internal log
        - zero log...
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_repair.  If you are unable to mount the filesystem, then use
the -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.

I am getting below error and i have did the rapair as well as per above xfs_repair /dev/mapper/mpathb. but no luck. mount /dev/mapper/mpathb /sanstoragebackup/ mount: Structure needs cleaning

Please help me out.

Yes, that error suggests to clear log using -L option while using xfs_repair. So, be careful while running with this option as this may become fatal. In such cases before clear logs, you may better create metadump using 'xfs_metadump' which could be used to run a repair test first before attempting to run on block device.