Personally, I have never cared about mounting removable disks via CLI since it is something I do not do frequently. Additionally, allowing regular users to mount file systems will make our system less secure as we will be opening the door to certain types of attacks by users. If the PC is going to be shared with non-technical users, not being able to mount external disks is a problem. In these cases, tools like dsbmc are interesting since they allow us to mount and unmount units graphically.
The user who is going to use dsbmc must be in the operator group:
This tool uses QT libraries. To configure the icons to be displayed, we will use qt5ct:
We install dsbmc:
We add the service to the startup:
We install support for other file systems using FUSE:
We make sure to load FUSE at startup:
fuse_load=YES
We allow regular users to mount file systems:
vfs.usermount=1
As a regular user, we must export the QT_QPA_PLATFORMTHEME environment variable so that the configuration of this tool is read:
vi .bashrc
export QT_QPA_PLATFORMTHEME=qt5ct
We start the tool to define which icons we want to use:
We must start dsbmc-cli and dsbmc, I do it from my .xinitrc:
# DSB AUTOMOUNTER
dsbmc-cli -a &
dsbmc -i &
From here on, we will always manage removable devices from the applet that appears in the notification menu of the WM we use. For example, when we insert a USB, it will appear automatically, and if we double-click it, it will open the disk.
To prevent system devices or internal disks from appearing, we must ignore them by adding them to the list of ignored devices:
When we finish using the disk, it is as simple as right-clicking and selecting Eject.
NOTE: Remember not to use file explorer tools to mount/unmount devices. All management of these devices will always be done from the applet.