4

I have a problem with an udev-rule. i simply want to mount a usb stick when it is plugged in. the rule correctly executes a script which mkdir the mount point and then calls mount. everything seems to work, but the stick is never mounted. if I execute the script manually everything works and i can access the stick

/etc/udev/rules.d/usbmount.rules:

KERNEL=="sd?1", SUBSYSTEMS=="usb", ACTION=="add", SYMLINK+="adminStick", RUN+="/usr/bin/logger Start mounting", RUN+="/usr/local/bin/mountAdmin"

/usr/local/bin/mountAdmin:

#!/bin/bash

/usr/bin/logger Creating /media/adminStick 
mkdir -p /media/adminStick

/usr/bin/logger Trying to mount adminStick
mount /dev/adminStick /media/adminStick

journal -f:

Feb 28 19:27:25 alarmpi logger[3691]: Start mounting
Feb 28 19:27:25 alarmpi logger[3693]: Creating /media/adminStick
Feb 28 19:27:25 alarmpi logger[3695]: Trying to mount adminStick
Feb 28 19:27:25 alarmpi kernel: EXT4-fs (sdd1): mounted filesystem with ordered data mode. Opts: (null)

System: Arch for Raspberry Pi ARMv6

  • did u solve this problem? – GeneCode Aug 13 '18 at 2:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.