Which way to go for automounting removable media in KDE5?

So the FreeBSD Handbook and KDE Community Wiki still tell that hald is required for KDE5 to handle automounting of removable media, although there are other solutions like autofs mentioned in the handbook, automount or dsbmd. Then there are references to kf5-solid with bsdisks as well.

Since I'm not sure which information still applies or is outdated, what is the current preference for getting this to work in a fresh FreeBSD 12.1 installation with KDE5?
 
I build from ports, so with knobs set right, I've got no hald. Also, I missed procfs notice, so ran KDE without it as well.
 
I build from ports, so with knobs set right, I've got no hald. Also, I missed procfs notice, so ran KDE without it as well.
Can you recall which knobs set right?

I have no intention to build all the KDE Plasma 5 stuff from ports if there is no good reason for it (and as long as I don't have access to a dedicated poudriere build host).

The problem right now is the scattered and most often outdated information concerning the right way to install KDE on FreeBSD to have it all working without any cruft and deprecated pieces of software.
 
I use KDE Plasma on FreeBSD and indeed I can tell you don't need hald nor procfs. I use dsbmc (which uses dsbmd underneath) for mounting removable media and stuff, and it works great!
 
When I used KDE, bsdisks was able to mount removable media using KDE native tools.
I installed bsdisks from packages but am no sure about enabling it. Is this done in rc.conf and what is the exact instruction to enable? I type bsdisks as root and it does register all my drives.
 
Can you recall which knobs set right?
To get KDE mounting, you need to rebuild kf5-solid with bsdisks. If you want completely remove hal, don't enable it after ports install and check what ports depends on it and change options until pkg autoremove removes it.
I installed bsdisks from packages but am no sure about enabling it. Is this done in rc.conf and what is the exact instruction to enable? I type bsdisks as root and it does register all my drives.
kf5-solid uses it to automatically mount removable media under kde plasma if built with bsdisks support instead of hal
 
To get KDE mounting, you need to rebuild kf5-solid with bsdisks. If you want completely remove hal, don't enable it after ports install and check what ports depends on it and change options until pkg autoremove removes it.

kf5-solid uses it to automatically mount removable media under kde plasma if built with bsdisks support instead of hal
When compiling the port I get:

Installing py37-setuptools-41.4.0_1...
pkg-static: py37-setuptools-41.4.0_1 conflicts with py36-setuptools-41.2.0 (installs files into the same place). Problematic file: /usr/local/bin/easy_install
*** Error code 70

Is there any way to get around this? Do I have to build everything, kde5 etc, from source? I would find that to be too time consuming. I also read that you shouldn't mix ports and packages anyway.
 
Compile it on target system after KDE install. It will use packages already available. Make sure you track latest package repository. Default one is quarterly.
 
Compile it on target system after KDE install. It will use packages already available. Make sure you track latest package repository. Default one is quarterly.
I'm using the latest repo and selected for bsdisks to be used instead of hal to mount disks. If I disable hal and then reboot nothing mounts. Is there something that needs to be done with polkit?
 
Is automounting enabled in KDE settings?
I have it enabled but still get the same results. Is it possible that something needs to be done in /usr/local/etc/polkit-1/rules.d? There are some references on the Internet about UDisks2 that show some files must be placed there.

For example:

// See the polkit(8) man page for more information
// about configuring polkit.

// Allow udisks2 to mount devices without authentication
// for users in the "wheel" group.
polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.udisks2.filesystem-mount-system" ||
action.id == "org.freedesktop.udisks2.filesystem-mount") &&
subject.isInGroup("wheel")) {
return polkit.Result.YES;
}
});

Do you have anything like this in your configuration?
 
I can't speak for KDE because I use fluxbox, but sysutils/automount works perfectly for me. Instead of using the package though, I go to Vermaden's github site and grab the latest version from there: Automount

Easy to set up via his instructions and it just works.

Side note: do you have vfs.usermount=1 in /etc/sysctl.conf ?
 
I can't speak for KDE because I use fluxbox, but sysutils/automount works perfectly for me. Instead of using the package though, I go to Vermaden's github site and grab the latest version from there: Automount

Easy to set up via his instructions and it just works.

Side note: do you have vfs.usermount=1 in /etc/sysctl.conf ?
I do have vfs.usermount=1 in /etc/sysctl.conf.

I followed the instructions in the README file. After,

/etc/rc.d/devd restart

I get:

Starting devd.
devd: Can't open devctl device /dev/devctl: Device busy
/etc/rc.d/devd: WARNING: failed to start devd
 
My apologies, the specific issues with devd are beyond my ability - I have never had an issue starting or re-starting devd. A quick Google search of the errors did not reveal anything meaningful, at least to me.
 
I noticed that a recent update to devel/kf5-solid now enables support for sysutils/bsdisks by default, so I wanted to give it another try, installed sysutils/bsdisks from ports and rebooted the system. Process list confirms that bsdisks is running and now when I open dolphin file manager, I see a couple entries listed by their GPT ID in dolphin's devices section, which seem to belong to my Windows harddisk partitions (System is set up dual boot). I confirmed that automounting of removable media is enabled in KDE settings. When I insert a DVD media, nothing shows up in KDE's device notifier and nothing gets mounted. Inserting a USB flash drive (FreeBSD install) however automatically mounts the EFI and data partitions from the drive which appear in dolphin's devices section as 'Hard Disk':
Code:
/dev/da0s1                   780K    388K    392K    50%    /media/_
/dev/da0s2a                  924M    864M    -14M   102%    /media/_1
Yet KDE's device notifier shows 'No devices available'. Using dolphin I can unmount both partitions by right clicking and choosing 'unmount' but that still leaves the question whether it's safe to remove the USB drive afterwards, so I powered it down manually using usbconfig -u 0 -a 2 power_off just to be sure, but that is hardly a solution for desktop use.

Unfortunately I couldn't find any kind of documentation regarding sysutils/bsdisks to check if there are any configurable options available (for example I'd rather not have it access my windows hard disk partitions in any way). Also without an option to eject/safely remove a removable drive/media this is only half of the cake. Has anyone gotten better results? Are there things that need to be configured?
 
I have tried autofs and it works, but if I remember well, there is no way for a non-privileged user to unmount disks. autofs unmounts them automatically after some idle time, which is problematic if you want to remove a USB stick and insert another one right after, for instance. I'm a beginner with FreeBSD though, so if there is some configuration option to address this point, I would be happy to learn about it. :)
 
AUTOFS

This is THE native FreeBSD solution based on DEVD, it doesn't depend on any desktop
So... it can works in console mode as in ANY desktop

From my experience the term automounting can refer to a number of different things. As for autofs and a number of similar solutions, those were designed to mount a (networked) volume upon accessing a directory and unmounting when no files on the volume have been accessed in a certain amount of time. This however is exactly not what you would want for removable media/devices such as CD/DVD/USB flash- and harddrives in a desktop scenario, where you want to mount such a device/media upon attach/insertion and unmount upon user request (which may include pressing the eject button on the drive). Also for removable devices unounting those may involve additional steps like powering down the device so that it can safely be removed from the system.
 
Back
Top