If you are not using a desktop environment like Gnome, KDE or XFCE, where all this comes for free, you can still get automount for your removable devices. The utility you need to install is called udiskie. If you run Slackware it’s available as a slackbuild package. udiskie is a simple daemon that uses udisks to automatically mount removable storage devices.
Before you get it working there are a few steps we need to go through first.
Make sure your user is part of the plugdev group, if it’s not you can add with the following command
# usermod -a -G plugdev username
Now, we need to change the policykit according to udiskie documentation. Here we are slightly adapting for Slackware. Make sure if you have the directory structure /etc/polkit-1/localauthority/50-local.d/ and in case not you can create it with the command below
# mkdir -p /etc/polkit-1/localauthority/50-local.d/
Now, let’s create the file udiskie.pkla inside the directory
# nano /etc/polkit-1/localauthority/50-local.d/10-udiskie.pkla
and add the following content
[udiskie] Identity=unix-group:plugdev Action=org.freedesktop.udisks.filesystem-mount;org.freedesktop.udisks.luks-unlock;org.freedesktop.udisks.drive-eject;org.freedesktop.udisks.drive-detach ResultAny=yes
The last thing remaining is to set udiskie daemon to run at startup.
exec --no-startup-id udiskie -a -n
I like to use the flags -a -n that specifies automount and send a notification, respectively. You can also add the command to your .xinitrc file (or your window manager configuration file, e.g., i3 config)
# echo 'exec udiskie -a -n' >> /home/user/.xinitrc
Leave a Reply