Skip to content

Storage totals double-count shared filesystems across Arr root folders #2720

@nbellowe

Description

@nbellowe

Summary

Maintainerr's storage headline appears to double- or triple-count available space when Sonarr/Radarr expose multiple root-folder paths that all live on the same underlying filesystem.

In my case, /movies, /tv, and /downloads are all on the same 23.8 TB media filesystem, but Maintainerr reported about 66.4 TB available because those paths were summed independently.

Reproduction

Environment shape:

  • Radarr root folder: /movies
  • Sonarr root folder: /tv
  • Download path: /downloads
  • All three paths point to the same underlying filesystem

Live filesystem reality:

$ df -h /movies /tv /downloads
Filesystem  Size  Used Avail Use% Mounted on
data         22T  577G   22T   3% /movies
data         22T  577G   22T   3% /tv
data         22T  577G   22T   3% /downloads

Radarr diskspace payload:

[
  {"path":"/downloads","freeSpace":23214726447104,"totalSpace":23833675956224},
  {"path":"/movies","freeSpace":23214726447104,"totalSpace":23833675956224}
]

Sonarr diskspace/root-folder payload includes:

[
  {"path":"/tv","freeSpace":23214726447104,"totalSpace":23833675956224},
  {"path":"/downloads","freeSpace":23214726447104,"totalSpace":23833675956224}
]

Maintainerr /api/storage-metrics totals came back as:

{
  "freeSpace": 69721478995968,
  "totalSpace": 73006456774656,
  "mountCount": 6
}

Expected totals should have been roughly:

{
  "freeSpace": 23214726447104,
  "totalSpace": 23833675956224,
  "mountCount": 1
}

Suspected Cause

From reading the current source:

  • ServarrApi.getDiskspaceWithRootFolders() merges Arr /diskspace and /rootfolder entries by normalized path
  • StorageMetricsService.computeTotals() dedupes mounts by host + normalizeDiskPath(path)

That means different paths on the same filesystem, like /movies, /tv, and /downloads, are treated as distinct storage targets and summed independently.

Relevant files:

  • apps/server/src/modules/api/servarr-api/common/servarr-api.service.ts
  • apps/server/src/modules/storage-metrics/storage-metrics.service.ts

Expected Behavior

The storage headline should count a shared filesystem once, even if Arr exposes it through multiple root-folder paths.

Notes

I have a local workaround, but I have not opened a PR because I wasn't confident the dedupe is universally safe upstream. In particular, two different filesystems could theoretically have identical totalSpace/freeSpace, and Arr does not appear to expose a stable filesystem/device identifier in this payload.... unlikely but wanted to call it out.

I'm opening this issue first in case there is a preferred approach for:

  • selecting only root-folder-backed mounts for headline totals, or
  • teaching the totals logic how to identify shared filesystems more reliably

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions