Skip to content

Commit

Permalink
Merge pull request Ferk#19 from LukeShortCloud/more_devices
Browse files Browse the repository at this point in the history
Support more devices
  • Loading branch information
Ferk authored Nov 25, 2023
2 parents f92f8d3 + 66e0dc6 commit c9859b7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions media-automount.rules
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,18 @@
# mounting has to be done as a separate "service"

# mount the device when added
# Physical SATA, SCSI, and USB
KERNEL=="sd[a-z]*", ACTION=="add", RUN+="/usr/bin/systemctl --no-block restart media-automount@%k.service"
# Virtual SATA, SCSI, and USB
KERNEL=="vd[a-z]*", ACTION=="add", RUN+="/usr/bin/systemctl --no-block restart media-automount@%k.service"
# eMMC and SD cards
KERNEL=="mmcblk[0-9]p[0-9]", ACTION=="add", RUN+="/usr/bin/systemctl --no-block restart media-automount@%k.service"
# NVMe
KERNEL=="nvme[0-9]n[0-9]p[0-9]", ACTION=="add", RUN+="/usr/bin/systemctl --no-block restart media-automount@%k.service"

# clean up after device removal
KERNEL=="sd[a-z]*", ACTION=="remove", RUN+="/usr/bin/systemctl --no-block restart media-automount@%k.service"
KERNEL=="vd[a-z]*", ACTION=="remove", RUN+="/usr/bin/systemctl --no-block restart media-automount@%k.service"
KERNEL=="mmcblk[0-9]p[0-9]", ACTION=="remove", RUN+="/usr/bin/systemctl --no-block restart media-automount@%k.service"
KERNEL=="nvme[0-9]n[0-9]p[0-9]", ACTION=="remove", RUN+="/usr/bin/systemctl --no-block restart media-automount@%k.service"

0 comments on commit c9859b7

Please sign in to comment.