From bb1e01459ba92fc173ded42c70e549cf8cec78d5 Mon Sep 17 00:00:00 2001 From: Akizon77 Date: Tue, 10 Mar 2026 15:55:04 +0800 Subject: [PATCH] fix: https://github.com/komari-monitor/komari/issues/402 --- monitoring/unit/disk.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/monitoring/unit/disk.go b/monitoring/unit/disk.go index bca8661..8fc055f 100644 --- a/monitoring/unit/disk.go +++ b/monitoring/unit/disk.go @@ -83,26 +83,21 @@ func isPhysicalDisk(part disk.PartitionStat) bool { } mountpoint := strings.ToLower(part.Mountpoint) // 排除挂载点 - var mountpointsToExclude = []string{ + var mountpointsToExcludePerfix = []string{ "/tmp", "/var/tmp", - "/dev/shm", + "/dev", "/run", - "/run/lock", - "/run/user", "/var/lib/containers", "/var/lib/docker", "/proc", - "/dev/pts", "/sys", "/sys/fs/cgroup", - "/dev/mqueue", "/etc/resolv.conf", "/etc/host", // /etc/hosts,/etc/hostname - "/dev/hugepages", "/nix/store", } - for _, mp := range mountpointsToExclude { + for _, mp := range mountpointsToExcludePerfix { if mountpoint == mp || strings.HasPrefix(mountpoint, mp) { return false } @@ -123,6 +118,7 @@ func isPhysicalDisk(part disk.PartitionStat) bool { var fstypeToExclude = []string{ "tmpfs", "devtmpfs", + "udev", "nfs", "cifs", "smb", @@ -136,6 +132,9 @@ func isPhysicalDisk(part disk.PartitionStat) bool { "cgroup", "mqueue", "hugetlbfs", + "debugfs", + "binfmt_misc", + "securityfs", } for _, fs := range fstypeToExclude { if fstype == fs || strings.HasPrefix(fstype, fs) {