Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No reasonable way to establish the relationship between root directory and volume on macOS. #841

Closed
tobz opened this issue Sep 19, 2022 · 3 comments · Fixed by #855
Closed
Labels

Comments

@tobz
Copy link

tobz commented Sep 19, 2022

I'm trying to use sysinfo as a means to enumerate the mountpoints of a system and figure out if a given filepath is tied to a volume/mountpoint with sufficient available capacity.

When running my code on macOS, I noticed that the root mountpoint is not enumerated by sysinfo, which seems like it stems from the change here: #714

I can understand the remarks made in the PR and the changed code, but it's not actually clear to me how one could actually resolve the magical link between, say, the /System/Volumes/Data partition that is obviously the backing for /. All attempts to do this even on the command line, with readlink and stat and mount, paint an incomplete picture.

On the flipside, simply removing the "is this a rootfs mount?" logic adds the / mountpoint to the disk output from sysinfo (and adds no other disks, in my case) which allows me to achieve my intended goal.

I guess my question would be: could the "is this a root filesystem?" logic be changed to be configurable? I'm still trying to figure out if there's a reasonable cross-platform way to go from /some/arbitrary/path and get the "true" mountpoint (i.e. /) but save for that, having sysinfo return the / mountpoint feels more inline with what my intuition as a user would be.

Additionally, in terms of supporting evidence: mount on macOS returns both the /System/Volumes-prefixed mounts and the root (/) mount, and looking at Storage under the System Report shows the root mount and the data volume mount. So the fact that sysinfo doesn't show the root mount is more divergent than not, IMO.

@GuillaumeGomez
Copy link
Owner

This is a fair argument. What do you think @complexspaces?

@complexspaces
Copy link
Contributor

That seems reasonable to me. In general, I'm fine with experimenting a bunch here. I have some changes that should help with this in progress locally, so I'll try and put a PR with them soon 👍.

@GuillaumeGomez
Copy link
Owner

Sounds good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants