Showing posts with label arch linux arm mount automount udev rules. Show all posts
Showing posts with label arch linux arm mount automount udev rules. Show all posts

Wednesday, 17 April 2013

run a script when a device is mounted

  1. Make sure udev-automount is installed
    pacman -Sy udev-automount
  2. Work out udev rules with udevadm (see Arch Wiki - udev)
    udevadm info -a -n /dev/sdc
  3. Create a udev rule file based on step 2, e.g. /etc/udev/rules.d/81-sdcard-sync.rules, with contents like this:
    KERNEL=="sd?1", ATTRS{idVendor}=="0781", ATTRS{idProduct}=="a7a8", ATTRS{serial}=="6333011111B1", RUN+="/usr/bin/sd-card-sync-start.py"