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

Bug: df cannot read table of mounted file systems on macos #1356

Open
bjornbm opened this issue Jan 21, 2025 · 3 comments
Open

Bug: df cannot read table of mounted file systems on macos #1356

bjornbm opened this issue Jan 21, 2025 · 3 comments
Labels
contributions welcome We'll commit to review and maintenance if the people who need it write the changes. medium severity Used to report medium severity bugs (e.g. Malfunctioning Features but still useable)

Comments

@bjornbm
Copy link

bjornbm commented Jan 21, 2025

Contact Details

[email protected]

What happened?

Using cosmos df:

~ $ uname -a
Darwin Narcissus.local 24.1.0 Cosmopolitan 4.0.1 MODE=aarch64; Darwin Kernel Version 24.1.0: Thu Oct 10 21:03:15 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6000 arm64 GNU/Linux
~ $ df
df: cannot read table of mounted file systems: No such file or directory

Expected (using system df):

~ $ /bin/df
Filesystem     512-blocks      Used Available Capacity iused     ifree %iused  Mounted on
/dev/disk3s1s1  965595304  20981648 151801776    13%  408310 759008880    0%   /
devfs                 402       402         0   100%     696         0  100%   /dev
/dev/disk3s6    965595304   8391592 151801776     6%       4 759008880    0%   /System/Volumes/VM
/dev/disk3s2    965595304  12693752 151801776     8%    1098 759008880    0%   /System/Volumes/Preboot
/dev/disk3s4    965595304      6872 151801776     1%      50 759008880    0%   /System/Volumes/Update
/dev/disk1s2      1024000     12328    984904     2%       1   4924520    0%   /System/Volumes/xarts
/dev/disk1s1      1024000     11016    984904     2%      29   4924520    0%   /System/Volumes/iSCPreboot
/dev/disk1s3      1024000      6032    984904     1%      75   4924520    0%   /System/Volumes/Hardware
/dev/disk3s5    965595304 769499056 151801776    84% 1764505 759008880    0%   /System/Volumes/Data
map auto_home           0         0         0   100%       0         0     -   /System/Volumes/Data/home

Version

df (GNU coreutils) 9.4
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Torbjörn Granlund, David MacKenzie, and Paul Eggert.

Downloaded 2025-01-21 from https://cosmo.zip/pub/cosmos/bin/

What operating system are you seeing the problem on?

Mac

Relevant log output

@bjornbm bjornbm added the medium severity Used to report medium severity bugs (e.g. Malfunctioning Features but still useable) label Jan 21, 2025
@954681
Copy link

954681 commented Jan 21, 2025 via email

@jart jart added the contributions welcome We'll commit to review and maintenance if the people who need it write the changes. label Jan 25, 2025
@jart
Copy link
Owner

jart commented Jan 25, 2025

We would most likely need to emulate the /proc filesystem to implement this feature. It wouldn't be trivial. An easier solution I would propose is that we simply write our own df command, and then have our program plug into all the relevant platform-specific APIs, since obviously this kind of thing isn't standardized by POSIX. We do however have a nice statfs() implementation, that works on all platforms. If you crawl the file system maybe 2-3 layers deep, breadth first, then you might be able to create something similar to df without getting into the platform-specific hairiness. Contributions welcome.

@bjornbm
Copy link
Author

bjornbm commented Jan 25, 2025

Thanks. Sorry but I don't see myself making this contribution (time/skill limitations).

To provide context: I don't “need” df to work. What I've done is put everything from https://cosmo.zip/pub/cosmos/bin/ on my $PATH, mostly as an experiment. Sometimes I notice things don't work (#1340 is another example) and report it because I assume you would want to know. In the meantime I fall back to using the system df.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributions welcome We'll commit to review and maintenance if the people who need it write the changes. medium severity Used to report medium severity bugs (e.g. Malfunctioning Features but still useable)
Projects
None yet
Development

No branches or pull requests

3 participants