xfs_logprint
Print XFS filesystem log information
SYNOPSIS
xfs_logprint [ options ] device
PARAMETERS
-b block
Specifies the starting log block number from which to begin printing. Useful for examining specific sections of the log.
-c count
Limits the output to the specified number of log blocks, starting from the beginning or a specified offset (if -b is used).
-f filename
Reads the XFS log from an external log file rather than directly from a device. This is particularly useful for offline analysis or when the filesystem on the device is unmountable.
-l logstart
Starts printing log records from a specific log sequence number (LSN). LSNs provide a unique identifier for each record in the log.
-t timestamp
Prints log records that occurred at or after the specified timestamp. The timestamp format typically adheres to ISO 8601 (e.g., YYYY-MM-DD[THH:MM:SS]).
-x
Outputs the log contents in a raw hexadecimal dump format, providing a byte-level view of the log records, which is crucial for low-level debugging.
device
The block device (e.g., /dev/sdb1) containing the XFS filesystem whose log is to be analyzed. For consistency and safety, it is generally recommended to use this command on an unmounted device.
DESCRIPTION
xfs_logprint is a low-level debugging utility designed for the XFS filesystem. Its primary function is to print the raw contents of the XFS journal, also known as the log. The XFS journal plays a critical role in ensuring filesystem consistency and quick recovery after system crashes by recording metadata changes. This command is explicitly not intended for routine system administration but rather for advanced users, developers, and forensic investigators who need to deeply examine the log's internal structure and raw records.
The output is highly technical, presenting log records, transactions, and various metadata operations in a human-readable format. It is particularly valuable for diagnosing complex filesystem corruption, analyzing crash recovery scenarios, or gaining a deeper understanding of XFS internals when standard tools are insufficient.
CAVEATS
THIS COMMAND IS ONLY FOR XFS DEVELOPERS. DO NOT USE.
The output of xfs_logprint is highly technical and requires a deep understanding of XFS internals, including its journaling mechanisms and data structures. It is not intended for general troubleshooting or routine system administration. Misinterpreting the log output can lead to incorrect diagnoses of filesystem problems. While xfs_logprint performs read-only operations, it's generally safer and recommended to use it on an unmounted XFS filesystem to ensure a static view of the log and avoid any potential conflicts with live filesystem activity.
PURPOSE AND AUDIENCE
xfs_logprint is an expert-level debugging and diagnostic tool specifically designed for XFS filesystem developers and highly experienced system administrators. Its primary purpose is to provide an in-depth view into the XFS journal, which is essential for troubleshooting complex filesystem issues and understanding internal XFS operations. It is explicitly not recommended for users without specialized knowledge due to the complexity of its output.
OUTPUT INTERPRETATION
The command's output consists of raw log records, which represent atomic metadata operations (e.g., inode updates, directory entries, transaction commits). Interpreting this output accurately requires profound knowledge of XFS data structures, journaling semantics, and transaction flows. Without this expertise, the log dump will appear as a cryptic sequence of internal messages.
SAFETY AND RECOMMENDED USAGE
Although xfs_logprint is a read-only utility and does not modify the filesystem, it is strongly advised to use it on an unmounted XFS filesystem. Analyzing an unmounted log ensures data consistency and provides a stable snapshot without interference from ongoing filesystem activity. While it can read from a mounted device, an unmounted state is preferred for reliable and consistent log analysis, especially during forensic or advanced debugging scenarios.
HISTORY
XFS, developed by Silicon Graphics (SGI) in the early 1990s, was designed as a high-performance journaling filesystem. It was open-sourced and integrated into the Linux kernel around 2001. xfs_logprint is a core component of the xfsprogs utility suite, providing specialized tools for XFS filesystem management. Its development has been intrinsically linked to the journaling architecture of XFS, enabling low-level inspection of the transaction log. This capability has been crucial for debugging and understanding the filesystem's crash recovery behavior since XFS's early days, solidifying its role as a key developer utility.
SEE ALSO
xfs_repair(8), xfs_check(8), xfs_info(8), xfs_admin(8)