kota.nz notes vids pics code about
udisks is a lovely tool for removable drive mounting on linux. The UNIX model
is much older than flashdrives and sd cards. As a result, the procress of
creating a “mount point” and manually mounting your drives feels pretty jank.
udisks tool (or now
udisks2) can be used to allow your normal
user account to automatically create a mount point, mount your flashdrive, and
set the correct permissions when you plug in your flashdrive. It relies on d-bus
– so the daemon will be started and stopped when needed. You probably don’t
need to enable it manually. If you’re having issues you might need to add your
user to a storage group. You can
cat /etc/group to see a list of available
groups on your system.
udisks doesn’t “automatically mount” your drives. Instead, you run
a command to mount a new flashdrive and later one to unmount it. Personally, I
prefer this as I often want to format flashdrives rather than mounting them.
It’s also a good idea to leave it off to prevent security
exploits that take
advantage of automount. However, if you would like automount – like most of the
graphical distributions have by default, just install a
udisks wrapper such as
udevil, or a desktop environment like
includes a wrapper.
These are the commands to mount and unmount.
udisksctl mount -b udisksctl unmount -b
I created an
umnt alias for them.
I accidentally wrote
/etc/passwd as the file with a list of available
secondary groups, I meant to write
/etc/group. For reference
contains a list of users, including their primary group and login shell.
/etc/shadow is the location with your user’s hashed passwords and is normally
read/write only by root and sometimes the shadow group. Henry pointed this out.