Skip to content

Instantly share code, notes, and snippets.

View wtt604's full-sized avatar

John wtt604

  • Canada, wet coast
  • 17:51 (UTC -07:00)
View GitHub Profile
@wtt604
wtt604 / autoumount_udev_systemd.org
Created September 1, 2022 16:02 — forked from RafaelPalomar/autoumount_udev_systemd.org
Automount USB external drives with udev rules and systemd workaround #udev #automount #usb #systemd #gentoo

Automount USB external drives with udev rules and systemd workarounds

Generate /etc/udev/rules.d/11-media-by-label-auto-mount.rules with the following content

KERNEL!="sd[a-z][0-9]", GOTO="media_by_label_auto_mount_end"  
# Import FS infos  
IMPORT{program}="/sbin/blkid -o udev -p %N"  
# Get a label if present, otherwise specify one  
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"