Skip to content

[Bug]: Extra filesystem is ignored as duplicate when Docker Root Dir is located on the same partition #2103

Description

@SteffenV

Welcome!

  • I have read the Documentation
  • I have checked the Common Issues Guide and my problem was not mentioned there.
  • I have searched open and closed issues and my problem was not mentioned before.
  • I have verified I am using the latest version available. You can check the latest release here.

Component

Agent

Problem Description

Environment

  • Beszel Agent: 0.18.7
  • Docker Compose: 2.40.3
  • Ubuntu 24.04

Problem

An additional filesystem mounted via /extra-filesystems is detected correctly but is immediately discarded as a duplicate.

The affected filesystem is also the Docker Root Dir (/mnt/data/docker).

Other extra filesystems work as expected.

Docker Root Dir

Docker Root Dir: /mnt/data/docker

Filesystems

/dev/nvme0n1p3  -> /
/dev/nvme0n1p5  -> /home
/dev/nvme0n1p6  -> /mnt/data
/dev/sda1       -> /mnt/backup

Compose

agent:
  image: henrygd/beszel-agent
  network_mode: host
  privileged: true
  volumes:
    - /var/run/docker.sock:/var/run/docker.sock:ro
    - /sys:/sys:ro
    - /proc:/proc:ro
    - /dev:/dev:ro

    - /mnt/data/.beszel:/extra-filesystems/DATA:ro
    - /mnt/backup/.beszel:/extra-filesystems/BACKUP:ro
    - /home:/extra-filesystems/HOME:ro
    - /boot:/extra-filesystems/BOOT:ro

  environment:
    LOG_LEVEL: debug

Debug output

The agent correctly detects the partition:

Detected disk name=DATA device=DATA mount=/extra-filesystems/DATA

The partition also exists in the detected partitions:

/dev/nvme0n1p6 -> /mnt/data

and in diskstats:

nvme0n1p6:{...}

Immediately afterwards it is discarded:

Ignoring duplicate FS name=DATA mount=/extra-filesystems/DATA

Finally, DATA is missing from the exported Extra FS map:

DEBUG Extra FS data="map[BACKUP ... BOOT ... HOME ...]"

Only the filesystem that contains Docker's overlay2 storage is affected.

Expected behavior

DATA should appear in Extra FS exactly like BACKUP, HOME and BOOT.

Additional observation

The issue appears only for the filesystem that contains Docker's overlay2 storage (Docker Root Dir).

This might be related to duplicate detection when many overlay mounts exist on the same filesystem.

Expected Behavior

Extra filesystems should be reported using their real block device (e.g. nvme0n1p6, nvme0n1p5, sda1), and disk I/O statistics should be collected for them.

The mounted filesystems should appear in the dashboard with both usage and disk activity.

Steps to Reproduce

  1. Install Beszel Agent 0.18.7 in Docker.
  2. Use EXTRA_FILESYSTEMS to monitor additional mountpoints.
  3. Mount host directories into /extra-filesystems.

Example:

volumes:

  • /mnt/data:/extra-filesystems/DATA:ro
  • /home:/extra-filesystems/HOME:ro
  • /mnt/backup:/extra-filesystems/BACKUP:ro
  • /boot:/extra-filesystems/BOOT:ro

environment:
EXTRA_FILESYSTEMS=/extra-filesystems/DATA,/extra-filesystems/HOME,/extra-filesystems/BACKUP,/extra-filesystems/BOOT

The agent detects the host partitions correctly, but later replaces the real device names with the mount directory names (DATA, HOME, BACKUP), causing diskstats lookup to fail.

OS / Architecture

Ubuntu Server 24.04 LTS x86_64 (amd64) CPU: AMD Ryzen (12 threads) Filesystem: ext4 Docker Root Dir: /mnt/data/docker

Beszel version

Hub: 0.18.7 Agent: 0.18.7

Installation method

Docker

Configuration

Hub Logs

Hub starts normally.

No errors related to filesystem collection.

The agent connects successfully:

WebSocket connected host=192.168.110.94:8090

Agent Logs

Detected disk name=nvme0n1p3 device=nvme0n1p3 mount=/ io=nvme0n1p3 root=true

DEBUG /extra-filesystems mountpoint=/extra-filesystems/DATA
Detected disk name=DATA device=DATA mount=/extra-filesystems/DATA io=DATA root=false

DEBUG /extra-filesystems mountpoint=/extra-filesystems/HOME
Detected disk name=HOME device=HOME mount=/extra-filesystems/HOME io=HOME root=false

WARN Device not found in diskstats name=HOME
WARN Device not found in diskstats name=BACKUP
WARN Device not found in diskstats name=BOOT

DEBUG Extra FS data="map[BACKUP:... BOOT:... HOME:...]"

Docker Root Dir: /mnt/data/docker

/proc/diskstats contains:
- nvme0n1p6
- nvme0n1p5
- sda1

The agent searches for:
- DATA
- HOME
- BACKUP

instead of the actual block device names.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions