shundhammer/qdirstat

Can't identify mount points on BSD systems

mizhka opened this issue · 8 comments

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.

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.

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.

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

Please check out and test the latest Git master.

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

3 weeks and no reply.

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

5 weeks and no reply.

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

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