CGRU / cgru

CGRU - AFANASY
http://cgru.info/
GNU Lesser General Public License v3.0
278 stars 111 forks source link

HDD free wrong? #591

Open sebastianelsner opened 9 months ago

sebastianelsner commented 9 months ago

Hello,

I noticed the "hdd free" may not be correct. Please see the screenshot: "Afanasy Host info" on the left 22 GB vs. "df -h on the host on the right 13 GB"

Screenshot from 2024-01-16 12-51-05

The line must be here:

https://github.com/CGRU/cgru/blob/0119c0ed769940252af9b69295e25b335b6220c3/afanasy/src/render/res_linux.cpp#L299

The total hdd is correct (203 GB vs 204G) so there may be something wrong in the code above?!

sebastianelsner commented 9 months ago

Comparing several renders it seems to be off by around 10GB

timurhai commented 9 months ago

Hello! 204 - 181 = 23, so Afanasy works correct, but seems missing something, that df -h takes.

sebastianelsner commented 9 months ago

The difference seems to be the reserved block count for root. The reserved blocks allow system daemons to keep going even when the disk is full, while non-root processes will not be able to write to it.

So afanasy is overreporting the free space, which is kind of right, but also wrong since a rendering will never write to the root reserved space. I would aim at presenting the user available space in afanasy. I have a look at how to do that.