A quick overview on how to automount partitions on headless linux systems.
systemd
The easiest possible setup is using systemd - there's an Arch wiki reference with
details on this setup. In a one-liner, add this line to /etc/fstab :
/dev/disk/by-label/DISK_LABEL /media/DISK_LABEL ext4 defaults,noauto,x-systemd.automount,x-systemd.device-timeout=10ms 0 2
where DISK_LABEL is the label of your disk partition. You may set ext4
partitions' label with
$ sudo e2label /dev/sdXY NEW_DISK_NAME
where sdXY is the partition's identifier, as reported by lsblk. Note that
this will also work with FAT partitions, using fatlabel from the dosfstools
package under Arch Linux.
udev-media-automount
In Arch linux you may also automount removable disks with the
udev-media-automount package from the AUR. To have it served by a systemd
user service, it needs permissions from Polkit (see the Arch wiki article on
udisks2 for details) :
/etc/polkit-1/rules.d/50-udisks2.rules
;
Autofs
The Arch wiki also describes Autofs that looks pretty complete ; I haven't tested it though.
Udisks2
As mentioned earlier, there is the udisks package. I find it too heavy and invasive
for this task. I like the simplicity of the first two solutions.