[Feature] Show Storage space of Immich, not whole drive #16158
Replies: 3 comments
|
This is something I've been digging into recently and I think it's worth explaining why this happens at the code level, because the fix isn't as simple as swapping one number for another. Why the whole disk is shownThe storage numbers come from async checkDiskUsage(folder: string): Promise<DiskUsage> {
const stats = await fs.statfs(folder); // returns ENTIRE mount point stats
return {
available: stats.bavail * stats.bsize,
free: stats.bfree * stats.bsize,
total: stats.blocks * stats.bsize,
};
}
This feeds directly into const libraryBase = StorageCore.getBaseFolder(StorageFolder.Library);
const diskInfo = await this.storageRepository.checkDiskUsage(libraryBase);
serverInfo.diskUse = asHumanReadable(diskInfo.total - diskInfo.free);And then the sidebar widget ( Concrete example (Docker on a Linux VPS, CIFS-mounted NAS)
The sidebar shows "644 GiB of 1 TiB used" when Immich is responsible for only 267 GiB. A user with 50 GiB of their own photos sees the same inflated bar with no explanation. Related issuesThis also connects to #4318 (incorrect storage display on Mac), where the |
Proposed solutionHere's what I'd propose to fix the UX without touching the backend calculations (which remain correct for what they measure). 1a — Sidebar widget: three-tone bar for no-quota usersInstead of showing the raw The large grey block makes it immediately clear that the "used" space is not the user's doing. An alternative (Option A) would be to drop the volume context entirely for no-quota users and show only their own usage with a "no storage limit" label. 1b — Sidebar widget: disk-constrained quota usersThe current quota bar gives users false confidence: it shows headroom up to their quota limit, but if the physical disk is nearly full they will hit a wall before reaching it. This is confirmed in the source: private requireQuota(auth: AuthDto, size: number) {
if (auth.user.quotaSizeInBytes !== null &&
auth.user.quotaSizeInBytes < auth.user.quotaUsageInBytes + size) {
throw new BadRequestException('Quota has been exceeded!');
}
// ← no check against actual available disk space
}If the physical volume fills up while the user still has quota remaining, the upload fails with a raw OS-level I/O error — not a clean "disk is full" message. The sidebar meanwhile still shows the quota headroom as fully available, so the user has no warning before the failure. A three-segment bar should only appear when The ⚠ tooltip on the grey segment: "Your quota allows 450 GiB more, but only 243 GiB is free on the server's disk."
This way the bar is only as complex as it needs to be — the extra segments only appear when they carry actionable information. 2 — Admin server-status: dedicated "Volume Disk Space" cardAdd a card that separates what Immich manages from everything else on the volume, with a per-user breakdown — inspired by how another photo solution presents shared family storage: Legend: ░ white = Immich-managed · ▒ grey = other data on volume · ▓ black = free The ⓘ tooltip: "Disk space on this volume not tracked by Immich — may include external library source files, backups, or other services sharing the same mount." The per-user data is already available via the existing quota APIs — this is purely a presentation change, no new backend work needed. Why not use
|
|
Following up on my earlier comments — I've put together interactive mockups for all three proposed changes so the design is easier to evaluate without Change 1 — Sidebar: no-quota users Change 2 — Sidebar: quota users when disk is tighter than quota Change 3 — Admin server-status: Volume Disk Space section All three mockups use Tailwind CDN with Immich's actual utility classes ( Happy to open a draft PR if the direction looks good. |
Uh oh!
There was an error while loading. Please reload this page.
I have searched the existing feature requests to make sure this is not a duplicate request.
The feature
The Storage space indicator in the bottom left page of the screen is showing the total used space of my drive. But its including everything that is being used. Not just Immich. It would be more beneficial to show Immich usage broken out from the total.
Platform
All reactions