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

Can't identify mount points on BSD systems #195

Closed
mizhka opened this issue May 29, 2022 · 8 comments
Closed

Can't identify mount points on BSD systems #195

mizhka opened this issue May 29, 2022 · 8 comments

Comments

@mizhka
Copy link

mizhka commented May 29, 2022

Thank you for your project!

QDirStat tries to read /proc/mount and /etc/mtab files to fetch mount points. All mentioned files are Linux-specific. As results, "Cross Filesystems" option causes crash on BSD systems.

On FreeBSD there is "/sbin/mount" routine to fetch mount points in same format as fstab:

/sbin/mount -p

The output of this command is sufficient. I'm not QT/C++ developer and can't provide patch to solve issue.
Dirty hack is to read pre-populated file by mount command and it works fine for me.

Please feel free to ask questions.

@shundhammer
Copy link
Owner

This is the first I ever heard of this on any BSD variant. I recall /etc/mtab being present even in old SunOS (even before the Solaris days!) systems which was also a BSD derivative.

A quick Google search also gave me a man page for FreeBSD, but that appears to be for a very old version (2.9.1):

https://www.freebsd.org/cgi/man.cgi?query=mtab&sektion=5&apropos=0&manpath=2.9.1+BSD

...which begs the question: Was /etc/mtab there in the past, and was it removed in the meantime? (And if yes, why?)

I am very reluctant to invoke an external binary for even this trivial purpose. That introduces a host of problems: The Linux mount command does not know a -p option. And, worse, minimalistic variants of standard commands like those from BusyBox tend to have even less command line options, and some users / some distributions make heavy use of such minimalistic tools.

Also, some Linux distributions (e.g. openSUSE, IIRC also Fedora) are migrating away from the /sbin paths, moving all system commands into the /usr tree, i.e. it would be /usr/sbin/mount on those.

In short, this opens a ton of problems.

@shundhammer
Copy link
Owner

Please check if that -p option to the mount command is really needed. In all Unix-like systems that I ever used (since 1988!), a plain mount without any options already dumped the mounts to stdout.

If there really is a difference, please attach the output of both a plain mount and of mount -p to this issue.

@shundhammer
Copy link
Owner

https://doc.qt.io/qt-5/qstorageinfo.html#mountedVolumes might be a workaround, even if it returns less detailed information.

shundhammer added a commit that referenced this issue May 30, 2022
@shundhammer
Copy link
Owner

shundhammer commented May 30, 2022

Please check out and test the latest Git master.

@shundhammer
Copy link
Owner

Please test. I don't have a BSD installation readily available.

@shundhammer
Copy link
Owner

3 weeks and no reply.

Why do I even bother with exotic scenarios like this if not even the bug reporter gives a damn?

@shundhammer
Copy link
Owner

5 weeks and no reply.

Why do I even bother with exotic scenarios like this if not even the bug reporter gives a damn?

@mizhka
Copy link
Author

mizhka commented Sep 26, 2022

Honestly sorry for no reply for long time. The fix is tested. All works except one segfault with trivial patch:
#204

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

No branches or pull requests

2 participants