From f285c3d1e2fa52075b759231ed5e7e73a9002cc6 Mon Sep 17 00:00:00 2001 From: Nic Jansma Date: Wed, 18 Jun 2025 01:59:50 -0400 Subject: [PATCH] logical_disk: skip unmounted volumes (#2084) --- internal/collector/logical_disk/logical_disk.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/collector/logical_disk/logical_disk.go b/internal/collector/logical_disk/logical_disk.go index e9e8f3e4..3d6a59a7 100644 --- a/internal/collector/logical_disk/logical_disk.go +++ b/internal/collector/logical_disk/logical_disk.go @@ -701,6 +701,11 @@ func getAllMountedVolumes() (map[string]string, error) { break } + if errors.Is(err, windows.ERROR_FILE_NOT_FOUND) { + // the volume is not mounted + break + } + if errors.Is(err, windows.ERROR_NO_MORE_FILES) { rootPathBuf = make([]uint16, (rootPathLen+1)/2)