[Bug]: No disk throughput for LVM volume on Synology: LV name never matches the device-mapper label (vg1-volume_1)
Author: rbmatthCreated Sep 30, 2026Updated Sep 30, 2026
Component
Agent
Description
Disk throughput is missing for an LVM-backed volume on Synology DSM, while usage for the same volume is reported correctly. The agent logs:
INFO Detected disk name=volume_1 device=/dev/vg1/volume_1 mount=/volume1 io=volume_1 root=false
WARN Device not found in diskstats name=volume_1This looks like the same symptom as #1790 (there it shows up as name=lv on /dev/vg1000/lv) and #365. This report is about why the existing matching logic misses it, in case auto-detection can be fixed instead of needing a config hint.
Environment
- Beszel agent v0.20.0 (binary agent, installed natively, not Docker;
EXTRA_FILESYSTEMS=/volume1) - Synology DS223j, DSM 7.4.1-90080, aarch64
- gopsutil v4.26.8 (from v0.20.0's go.mod)
What the system looks like
$ grep ' /volume1 ' /proc/mounts
/dev/vg1/volume_1 /volume1 btrfs rw,nodev,relatime,ssd,...
$ ls -l /dev/vg1/volume_1
lrwxrwxrwx 1 root root 24 ... /dev/vg1/volume_1 -> /dev/mapper/vg1-volume_1
$ for d in /sys/block/dm-*; do echo "$(basename $d) -> $(cat $d/dm/name)"; done
dm-0 -> vg1-syno_vg_reserved_area
dm-1 -> vg1-volume_1
$ grep -E ' (dm-|md)[0-9]+ ' /proc/diskstats # name, sectors read, sectors written
md0 2044576 171728
md1 16472 225992
md2 1121056 79241176
dm-0 672 56
dm-1 1114888 79241120So the volume's I/O is in /proc/diskstats as dm-1, with device-mapper name vg1-volume_1.
Why it doesn't match (from reading v0.20.0 agent/disk.go)
registerFilesystemStatssetskey = filepath.Base(device). For the mount source/dev/vg1/volume_1that isvolume_1.volume_1is not a key indiskIoCounters(the keys aredm-1,md2, ...), and the mount isn't under the/extra-filesystemspath (binary agent), so it falls tofindIoDevice("volume_1", ...).findIoDevicedoes compare againstd.Label, which gopsutil fills from/sys/block/dm-1/dm/name(vg1-volume_1). But the comparison is exact match, orprefixRelated(HasPrefixin either direction).volume_1is neither equal tovg1-volume_1nor a prefix of it. It is the LV part of the<VG>-<LV>device-mapper name, i.e. a suffix.- No match, so the key stays
volume_1, andinitializeDiskIoStatswarns becausediskIoCounters["volume_1"]doesn't exist.
The Label support that is already in findIoDevice would match if the lookup used vg1-volume_1.
Possible fixes (untested, only reasoned from the code above)
- Resolve the partition device's symlink before taking the base name:
/dev/vg1/volume_1->/dev/mapper/vg1-volume_1, base namevg1-volume_1. That is exactly the gopsutilLabel, so the existing exact-label branch infindIoDevicewould returndm-1. - Or, in
findIoDevice, also treat a label that ends with-<name>as a match (device-mapper names are<vg>-<lv>), ideally only when there is a single such candidate.
Happy to test a patch or a build on this NAS if that helps.
Related
- #1790 (feature request for a per-filesystem diskstats name hint; same symptom on Synology with
name=lv) - #365 (closed; Synology LVM, answered with the Docker folder-name workaround)
Source: henrygd/beszel