execute script after (auto)mounting external device

Patrick Drechsler patrick at pdrechsler.de
Mon Dec 7 19:08:27 UTC 2009


Hi,

Currently I'm stuck with

=====================================
## /etc/udev/rules/70-myrules.rules
##
# $ udevadm info -a -p $(udevadm info -q path -n /dev/mapper/truecrypt1)
#
# Udevadm info starts with the device specified by the devpath and then
# walks up the chain of parent devices. It prints for every device
# found, all possible attributes in the udev rules key format.
# A rule to match, can be composed by the attributes of the device
# and the attributes from one single parent device.
#
#   looking at device '/devices/virtual/block/dm-0':
#     KERNEL=="dm-0"
#     SUBSYSTEM=="block"
#     DRIVER==""
#     ATTR{range}=="1"
#     ATTR{ext_range}=="1"
#     ATTR{removable}=="0"
#     ATTR{ro}=="0"
#     ATTR{size}=="6290944"
#     ATTR{alignment_offset}=="0"
#     ATTR{capability}=="10"
#     ATTR{stat}=="    6521        0     7172     5870        1        0 
        1        0        0       70     5870"
#
ACTION=="add", KERNEL=="dm-[0-9]*", SUBSYSTEM=="block", 
ATTR{size}=="6290944", \
RUN+="/usr/bin/touch /home/patrick/test_$(bin/date +%F-%H%M%S).txt"
=====================================

This rule does nothing when I mount the truecrypt partition :-(

Any ideas?

Patrick





More information about the ubuntu-users mailing list