Skip to content

feat(storage): GET /v1/disks/unreadable lists the mounts df cannot read - #31

Merged
inkly merged 1 commit into
mainfrom
feat/unreadable-mounts
Nov 11, 2026
Merged

inkly merged 1 commit into
mainfrom
feat/unreadable-mounts

Conversation

@inkly

@inkly inkly commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Follow-up of #30, from ReCasaOS/CasaOS#67: the reporter's storage list died on a dead NFS mount in /etc/fstab (df: /media/ser/fotos: Stale file handle). Since #30 the service survives it, but nothing tells the person the mount is dead. The reporter suggested pointing people at it.

Change. GET /v1/disks/unreadable answers [{mount_point, error}]:

  • runs df -P with LC_ALL=C and reads only its complaints on stderr (df: <path>: <complaint>, path unquoted when df quoted it);
  • leaves out "Permission denied" / "Operation not permitted": that is root being refused another user's FUSE mount (a desktop's /run/user/1000/doc), not a dead mount;
  • a df that does not answer within 15 s (a hard NFS mount whose server is gone) is one entry with an empty mount_point;
  • an empty list on a healthy box. Under /v1/disks, so the gateway already routes it.

The dashboard part is in CasaOS-UI (a row in "Needs attention" per entry).

Proof. Tests on the parsing (a stale handle, a quoted path with a space, one with a quote, the two refusals left out, a line that is not df's) and on the timeout. Run on Linux (WSL); the rest of the package passed there except the two helper-script tests, which fail in that copy on CRLF line endings only. Not looked at: a real dead NFS or FUSE mount, and a real hung df.

A dead NFS share ("Stale file handle") or a FUSE mount whose program
died was said nowhere: the storage list left it out. The new route runs
df -P in English and returns each mount it complains about, with the
complaint. Root being refused another user's FUSE mount (a desktop's
/run/user/1000/doc) is not a dead mount and is left out; a df that does
not answer within 15 s, as on a hard NFS mount whose server is gone, is
one entry with no mount point. For "Needs attention" on the dashboard.

Asked in ReCasaOS/CasaOS#67.
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