You manage a CentOS 7 server that runs a critical application storing data on an XFS filesystem mounted at /data. The server experiences an unexpected power outage. After rebooting, the application fails to start, and you suspect filesystem corruption. You boot into single-user mode and attempt to mount /data, but the mount fails with an error: 'mount: /dev/sdb1: can't read superblock'. You run 'xfs_repair -n /dev/sdb1' and it reports the log is dirty and must be replayed or the filesystem repaired with the -L option (force log zeroing). You want to recover the filesystem with minimal data loss. Which action should you take?
-L zeros the log and forces a replay, which is necessary when the log is corrupt.
Why this answer
Xfs_repair -L /dev/sdb1 forces the log to be zeroed (cleared) and then performs a full filesystem check and repair. This is necessary when the log is dirty and cannot be replayed normally due to corruption, such as after an unclean shutdown. The -L option is the standard recovery method for XFS when the log is damaged, and it minimizes data loss by only discarding the log (which contains metadata changes that were not yet written to disk) while preserving the rest of the filesystem data.
Exam trap
The trap here is that candidates familiar with ext4 may instinctively choose fsck (Option C), not realizing that XFS has its own repair tool (xfs_repair) and that fsck is incompatible with XFS filesystems.
How to eliminate wrong answers
Option B is wrong because mounting with 'norecovery' bypasses log replay entirely, leaving the filesystem in an inconsistent state and preventing any repair; it is used for read-only access to salvage data, not for recovery. Option C is wrong because fsck is designed for ext2/ext3/ext4 filesystems, not XFS; running fsck on an XFS filesystem can cause further damage or fail to recognize the filesystem type. Option D is wrong because xfs_admin -U generate changes the UUID of the filesystem, which does not address superblock corruption or dirty log issues; it is used for UUID management, not repair.