3

I know that block 12024039 is bad on sda1 and I want to find out what file in the xfs filesystem is using that block and is thus corrupt. How do I do that? When I run

xfs_db -f -c 'blockget -b 12024039' /dev/sda1

I get the error

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_db.  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.

Is there anyway to do this without unmounting. This is something I do all the time with ext4 filesystems.

raines
  • 274
  • 2
  • 7
  • Try `-r Open device or filename read-only. This option is required if the filesystem is mounted.` – Mark Plotnick Jul 02 '19 at 12:01
  • 1
    Unfortunately "-r" instead of "-f" (or both) does not work either. Same result. – raines Jul 02 '19 at 15:25
  • Try `-i -r`. "Allows execution on a mounted filesystem, provided it is mounted read-only". I wanted to test it, but finally a reboot solved my issue. – mgutt Mar 12 '22 at 13:08
  • I now tried the same on a different machine and nope, I was not able to execute it without unmounting. Sad. – mgutt Jun 18 '23 at 10:18

0 Answers0