Skip to content

fix(storage): a disk without partitions keeps its own fsused - #32

Merged
inkly merged 1 commit into
mainfrom
fix/whole-disk-fsused
Nov 13, 2026
Merged

inkly merged 1 commit into
mainfrom
fix/whole-disk-fsused

Conversation

@inkly

@inkly inkly commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

A filesystem made on the whole disk (e.g. /dev/sdd, no partition) has no children, so the loop in LSBLK summed 0 and overwrote lsblk's fsused with it. /v1/storage then returned used: "0" and the UI usage bar stayed empty (the UI fallback only covers a missing/empty used).

The fix replaces fsused with the children's sum only when the disk has children.

Reported in ReCasaOS/CasaOS#142 (used: "0", avail 180 GB of 983 GB, path: /dev/sdd).

Not tested: no unit test (the logic sits inside LSBLK, which shells out to lsblk) and the package does not build on this Windows checkout (generated code missing); not run against a real partitionless disk.

A filesystem made on the whole disk (/dev/sdd, no partition) has no children, so the loop summed 0 and overwrote lsblk's fsused with it: the API reported used=0 and the usage bar stayed empty. Only replace fsused with the children's sum when there are children. Reported in CasaOS#142.
@inkly
inkly merged commit 1b85dab into main Nov 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant