Storage reporting is still shows wrong size #3141

Closed
opened 2026-02-05 07:50:58 +03:00 by OVERLORD · 21 comments
Owner

Originally created by @picarica on GitHub (May 15, 2024).

The bug

my web ui installed within truenas shows 256kb of usage even when 600 pictures and several 100gb videos uploaded
i saw this issue #2462 and saw it was solved? but it doesnt seem like #2560 i thought this was a fix too, but sitll not
my behavior is same as in this 2 months old reddit thread https://www.reddit.com/r/immich/comments/1b4ai01/real_capacity_of_immich_with_truenas/

The OS that Immich Server is running on

TrueNAS-SCALE-24.04.0

Version of Immich Server

v1.105.1

Version of Immich Mobile App

not relevant

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

not sure truenas default

Your .env content

not sure

Reproduction steps

1. install truenas
2. install immich
3. issue exists

Relevant log output

No response

Additional information

with truenas i am using default ixvolumes i wonder if host path would be used if it would fix the issue

Originally created by @picarica on GitHub (May 15, 2024). ### The bug my web ui installed within truenas shows 256kb of usage even when 600 pictures and several 100gb videos uploaded i saw this issue #2462 and saw it was solved? but it doesnt seem like #2560 i thought this was a fix too, but sitll not my behavior is same as in this 2 months old reddit thread https://www.reddit.com/r/immich/comments/1b4ai01/real_capacity_of_immich_with_truenas/ ### The OS that Immich Server is running on TrueNAS-SCALE-24.04.0 ### Version of Immich Server v1.105.1 ### Version of Immich Mobile App not relevant ### Platform with the issue - [X] Server - [X] Web - [X] Mobile ### Your docker-compose.yml content ```YAML not sure truenas default ``` ### Your .env content ```Shell not sure ``` ### Reproduction steps ```bash 1. install truenas 2. install immich 3. issue exists ``` ### Relevant log output _No response_ ### Additional information with truenas i am using default ixvolumes i wonder if host path would be used if it would fix the issue
Author
Owner

@mertalev commented on GitHub (May 19, 2024):

I think this might be a quirk of ZFS since everything is on a separate dataset. We only look at the library folder to get disk usage info, so in this case the used space is just the size of the library folder. I'm not sure what the best way to fix this would be.

@mertalev commented on GitHub (May 19, 2024): I think this might be a quirk of ZFS since everything is on a separate dataset. We only look at the library folder to get disk usage info, so in this case the used space is just the size of the library folder. I'm not sure what the best way to fix this would be.
Author
Owner

@picarica commented on GitHub (May 23, 2024):

idk this may sound amateurish but just getting size with du and report it to GUI? should work on zfs no ?

@picarica commented on GitHub (May 23, 2024): idk this may sound amateurish but just getting size with **du** and report it to GUI? should work on zfs no ?
Author
Owner

@mdafer commented on GitHub (May 23, 2024):

One workaround, that worked for me (using geesefs to mount S3 buckets as local storage), is to set a quota limit on your account. Eg. instead of unlimited, use 100 TB for example. This way I can now see the used storage out of the limit.

Using du could deteriorate performance pretty quickly for us (who mount different kinds of storage, especially Object stores such as minio or s3), in my case, it could take hours to traverse the whole tree and get the total size.

I haven't checked how the size is being calculated when a limit is set, and I could be mistaken, but I'm assuming that it's calculated from the meta in Immich rather than from storage as I'm pretty sure it would be much slower to do it accurately from storage in my case.

@mdafer commented on GitHub (May 23, 2024): One workaround, that worked for me (using geesefs to mount S3 buckets as local storage), is to set a quota limit on your account. Eg. instead of unlimited, use 100 TB for example. This way I can now see the used storage out of the limit. Using du could deteriorate performance pretty quickly for us (who mount different kinds of storage, especially Object stores such as minio or s3), in my case, it could take hours to traverse the whole tree and get the total size. I haven't checked how the size is being calculated when a limit is set, and I could be mistaken, but I'm assuming that it's calculated from the meta in Immich rather than from storage as I'm pretty sure it would be much slower to do it accurately from storage in my case.
Author
Owner

@mertalev commented on GitHub (May 23, 2024):

I'm assuming that it's calculated from the meta in Immich rather than from storage

This is right. Usage is stored in the DB and updated when assets are added or deleted.

I suppose we could change to display the immich library size instead of the disk size. The latter is hard to get right since you can mount different drives for each folder, filesystems can handle usage differently, etc.

@mertalev commented on GitHub (May 23, 2024): > I'm assuming that it's calculated from the meta in Immich rather than from storage This is right. Usage is stored in the DB and updated when assets are added or deleted. I suppose we could change to display the immich library size instead of the disk size. The latter is hard to get right since you can mount different drives for each folder, filesystems can handle usage differently, etc.
Author
Owner

@danieldietzler commented on GitHub (Sep 21, 2024):

This sounds like it has been clarified/become a feature request more than an issue.

@danieldietzler commented on GitHub (Sep 21, 2024): This sounds like it has been clarified/become a feature request more than an issue.
Author
Owner

@dragonfly8677 commented on GitHub (Sep 22, 2024):

So is there a feature request created for this? Because I'd definitely argue that installing Immich on TrueNAS Scale with the official app and default settings should warrant correctly showing the amount of used space. It not displaying correctly definitely sounds like a bug more so than a feature request.

@dragonfly8677 commented on GitHub (Sep 22, 2024): So is there a feature request created for this? Because I'd definitely argue that installing Immich on TrueNAS Scale with the official app and default settings should warrant correctly showing the amount of used space. It not displaying correctly definitely sounds like a bug more so than a feature request.
Author
Owner

@alextran1502 commented on GitHub (Sep 22, 2024):

@Elyviere the TrueNAS template is handled by the TrueNAS team, I think it will have to be handled from that end

@alextran1502 commented on GitHub (Sep 22, 2024): @Elyviere the TrueNAS template is handled by the TrueNAS team, I think it will have to be handled from that end
Author
Owner

@johansmolinski commented on GitHub (May 20, 2025):

TrueNAS team claims it has to do with how Immich calculates the size. https://github.com/truenas/apps/issues/2249

@johansmolinski commented on GitHub (May 20, 2025): TrueNAS team claims it has to do with how Immich calculates the size. https://github.com/truenas/apps/issues/2249
Author
Owner

@stavros-k commented on GitHub (May 20, 2025):

No its not exactly that. I've said that it will probably get better after https://github.com/truenas/apps/issues/893.
But truenas/apps can't change how calculation is done.

@stavros-k commented on GitHub (May 20, 2025): No its not exactly that. I've said that it will probably get better after https://github.com/truenas/apps/issues/893. But truenas/apps can't change how calculation is done.
Author
Owner

@stavros-k commented on GitHub (May 20, 2025):

Btw I just run this on the immich server container and it looks normal to me

> const fs = require("fs");
undefined
> fs.statfs("/usr/src/app/upload/library", (err, stats) => {
...   if (err) {
...     console.error(err);
...     return;
...   }
...   console.log({
...     "available (GB)": (stats.bavail * stats.bsize / 1024 / 1024 / 1024).toFixed(2),
...     "free (GB)": (stats.bfree * stats.bsize / 1024 / 1024 / 1024).toFixed(2),
...     "total (GB)": (stats.blocks * stats.bsize / 1024 / 1024 / 1024).toFixed(2),
...   });
... });
undefined
> {
  'available (GB)': '421.07',
  'free (GB)': '421.07',
  'total (GB)': '421.07'
}
Image

(Based on code here e7edbcdf04/server/src/repositories/storage.repository.ts (L166))

@stavros-k commented on GitHub (May 20, 2025): Btw I just run this on the immich server container and it looks normal to me ```js > const fs = require("fs"); undefined > fs.statfs("/usr/src/app/upload/library", (err, stats) => { ... if (err) { ... console.error(err); ... return; ... } ... console.log({ ... "available (GB)": (stats.bavail * stats.bsize / 1024 / 1024 / 1024).toFixed(2), ... "free (GB)": (stats.bfree * stats.bsize / 1024 / 1024 / 1024).toFixed(2), ... "total (GB)": (stats.blocks * stats.bsize / 1024 / 1024 / 1024).toFixed(2), ... }); ... }); undefined > { 'available (GB)': '421.07', 'free (GB)': '421.07', 'total (GB)': '421.07' } ``` <img width="533" alt="Image" src="https://github.com/user-attachments/assets/3248ce5b-ac34-49f1-bf4a-fd826dde7502" /> (Based on code here https://github.com/immich-app/immich/blob/e7edbcdf0416a947860ab972520d5bbfa5d8e13a/server/src/repositories/storage.repository.ts#L166)
Author
Owner

@dragonfly8677 commented on GitHub (May 20, 2025):

Appears to be working now, this is from my hosted immich web page today:

Image

@dragonfly8677 commented on GitHub (May 20, 2025): Appears to be working now, this is from my hosted immich web page today: ![Image](https://github.com/user-attachments/assets/ecb2aeec-61a5-4031-92c7-1bd7cb7a9888)
Author
Owner

@johansmolinski commented on GitHub (May 20, 2025):

I seem to still be triggering some edge case. I'll try to see whatever I can find out myself.

Image

@johansmolinski commented on GitHub (May 20, 2025): I seem to still be triggering some edge case. I'll try to see whatever I can find out myself. ![Image](https://github.com/user-attachments/assets/9c604c36-b730-4c24-985f-744823a77edc)
Author
Owner

@dragonfly8677 commented on GitHub (May 20, 2025):

I'm on TrueNAS 25.04 in case that helps, but seeing as you have the latest Immich version it appears you are too.

@dragonfly8677 commented on GitHub (May 20, 2025): I'm on TrueNAS 25.04 in case that helps, but seeing as you have the latest Immich version it appears you are too.
Author
Owner

@johansmolinski commented on GitHub (May 20, 2025):

I don't think so actually. Need to verify when I get home. I think I still am on 24.x. Thanks for the hint!

@johansmolinski commented on GitHub (May 20, 2025): I don't think so actually. Need to verify when I get home. I think I still am on 24.x. Thanks for the hint!
Author
Owner

@mainman94 commented on GitHub (May 23, 2025):

I have the exact same issue. Fresh TrueNAS installation and fresh immich setup.
immich:
App Version: v1.132.3
Version: v1.7.44

TrueNAS: 25.04.0

@mainman94 commented on GitHub (May 23, 2025): I have the exact same issue. Fresh TrueNAS installation and fresh immich setup. immich: App Version: v1.132.3 Version: v1.7.44 TrueNAS: 25.04.0
Author
Owner

@vkushwaha17 commented on GitHub (May 28, 2025):

Even i am having the same issue, where Immich shows 256Kib of 2Tib.
I have set the correct perssions as well, but still no luck.

I feel may be it is related to mount path of the containers, i am using a separate pool for the apps and different pool for immich storage.
Any help appreciated !!

@vkushwaha17 commented on GitHub (May 28, 2025): Even i am having the same issue, where Immich shows 256Kib of 2Tib. I have set the correct perssions as well, but still no luck. I feel may be it is related to mount path of the containers, i am using a separate pool for the apps and different pool for immich storage. Any help appreciated !!
Author
Owner

@MrBacca commented on GitHub (May 29, 2025):

One workaround, that worked for me (using geesefs to mount S3 buckets as local storage), is to set a quota limit on your account. Eg. instead of unlimited, use 100 TB for example. This way I can now see the used storage out of the limit.

Using du could deteriorate performance pretty quickly for us (who mount different kinds of storage, especially Object stores such as minio or s3), in my case, it could take hours to traverse the whole tree and get the total size.

I haven't checked how the size is being calculated when a limit is set, and I could be mistaken, but I'm assuming that it's calculated from the meta in Immich rather than from storage as I'm pretty sure it would be much slower to do it accurately from storage in my case.

This works to fix the problem

@MrBacca commented on GitHub (May 29, 2025): > One workaround, that worked for me (using geesefs to mount S3 buckets as local storage), is to set a quota limit on your account. Eg. instead of unlimited, use 100 TB for example. This way I can now see the used storage out of the limit. > > Using du could deteriorate performance pretty quickly for us (who mount different kinds of storage, especially Object stores such as minio or s3), in my case, it could take hours to traverse the whole tree and get the total size. > > I haven't checked how the size is being calculated when a limit is set, and I could be mistaken, but I'm assuming that it's calculated from the meta in Immich rather than from storage as I'm pretty sure it would be much slower to do it accurately from storage in my case. This works to fix the problem
Author
Owner

@MichalCRP commented on GitHub (Jun 1, 2025):

One workaround, that worked for me (using geesefs to mount S3 buckets as local storage), is to set a quota limit on your account. Eg. instead of unlimited, use 100 TB for example. This way I can now see the used storage out of the limit.
Using du could deteriorate performance pretty quickly for us (who mount different kinds of storage, especially Object stores such as minio or s3), in my case, it could take hours to traverse the whole tree and get the total size.
I haven't checked how the size is being calculated when a limit is set, and I could be mistaken, but I'm assuming that it's calculated from the meta in Immich rather than from storage as I'm pretty sure it would be much slower to do it accurately from storage in my case.

This works to fix the problem

Works for me too, thanks

@MichalCRP commented on GitHub (Jun 1, 2025): > > One workaround, that worked for me (using geesefs to mount S3 buckets as local storage), is to set a quota limit on your account. Eg. instead of unlimited, use 100 TB for example. This way I can now see the used storage out of the limit. > > Using du could deteriorate performance pretty quickly for us (who mount different kinds of storage, especially Object stores such as minio or s3), in my case, it could take hours to traverse the whole tree and get the total size. > > I haven't checked how the size is being calculated when a limit is set, and I could be mistaken, but I'm assuming that it's calculated from the meta in Immich rather than from storage as I'm pretty sure it would be much slower to do it accurately from storage in my case. > > This works to fix the problem Works for me too, thanks
Author
Owner

@porjo commented on GitHub (Jun 2, 2025):

set a quota limit on your account. Eg. instead of unlimited, use 100 TB

Works for me too, thanks

Can sometime explain what is meant here? Are they talking about quota on the zfs dataset used by Immich?

@porjo commented on GitHub (Jun 2, 2025): >> set a quota limit on your account. Eg. instead of unlimited, use 100 TB > Works for me too, thanks Can sometime explain what is meant here? Are they talking about quota on the zfs dataset used by Immich?
Author
Owner

@MrBacca commented on GitHub (Jun 2, 2025):

In immich you edit the users space(storage) in the administration page.

@MrBacca commented on GitHub (Jun 2, 2025): In immich you edit the users space(storage) in the administration page.
Author
Owner

@vkushwaha17 commented on GitHub (Jun 8, 2025):

Workaround works for me as well.
login > click on profile > Administration > give specific storage and not unlimited

@vkushwaha17 commented on GitHub (Jun 8, 2025): Workaround works for me as well. login > click on profile > Administration > give specific storage and not unlimited
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#3141