Linux/fsmon

From Forza's ramblings
Screenshot of fsmon, a terminal-based Btrfs I/O monitor, displaying a table of filesystems with read/write bandwidth, IOPS, and truncated long labels. Below are side-by-side charts showing read and write bandwidth over time. The header reads "Btrfs Filesystem I/O Monitor," and shortcuts (q=quit, L=labels, i=iops) are shown in the footer. The terminal size is 146x21, with version fsmon 0.1.0 in the top right.
fsmon with side-by-side disk I/O charts

fsmon: A Real-Time Btrfs I/O Monitor[edit | edit source]

BW and IOPS charts stacked together

fsmon is a Python-based terminal application for monitoring the I/O activity of Btrfs filesystems in real-time. It displays bandwidth and IOPS (input/output operations per second) statistics for all detected filesystems and their devices. The application is lightweight and efficient, using data from the Linux sysfs interface to minimise overhead.

Btrfs is a modern copy-on-write (CoW) filesystem designed for scalability and advanced data management features such as snapshots, RAID, and self-healing capabilities. fsmon complements these features by providing an easy way to monitor I/O performance in real-time.

While traditional I/O monitoring tools like iostat and iotop provide statistics for individual devices and processes, respectively, they lack the capability to aggregate data at the filesystem level. In contrast, fsmon consolidates statistics from all devices within a Btrfs filesystem, offering a comprehensive view of its overall activity.

Requirements[edit | edit source]

  • Python 3.6 or higher.
  • At least one mounted Btrfs filesystem.
  • Sufficient permissions to access /sys/fs/btrfs and related devices in /sys/block.

Usage[edit | edit source]

  • -h or --help: Display usage information.
  • -v or --version: Display version.

To run fsmon:

# ./fsmon.py
Real-time Btrfs I/O monitor displaying read/write bandwidth and IOPS.
  • Up/Down arrow keys: Navigate between filesystems.
  • q/Q: Quit the program.
  • l/L: Toggle between filesystem labels and UUIDs.
  • i/I: Switch between bandwidth and IOPS charts.

Terminal Size[edit | edit source]

A tiny terminal with fsmon

The minimum terminal size for fsmon is roughly 73x32 (columns x rows) with 5 filesystems and 2 charts. A smaller terminal will omit the charts and only show the list of filesystems and their statistics. fsmon attempts to fit the charts side-by-side or stacked, depending on the available space.

Download[edit | edit source]

The fsmon source code is available at https://git.tnonline.net/Forza/fsmon