Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm on Fedora 18. In /etc/udev/rules.d, I've added new rule (70-stm32.rules) with following content:

SUBSYSTEM=="block", ENV{ID_MODEL}=="STM32_STLink", OPTIONS=="ignore_device"

Then restarted udev:

systemctl restart systemd-udevd.service

But device still seem to be recognized and mounted as USB drive.

Where is my mistake?

I want to ignore following device

udevadm info /dev/sdb
P: /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0/host8/target8:0:0/8:0:0:0/block/sdb
N: sdb
S: disk/by-id/usb-STM32_STM32_STLink-0:0
S: disk/by-path/pci-0000:00:14.0-usb-0:3:1.0-scsi-0:0:0:0
S: disk/by-uuid/A8D9-2F05
E: DEVLINKS=/dev/disk/by-id/usb-STM32_STM32_STLink-0:0 /dev/disk/by-path/pci-0000:00:14.0-usb-0:3:1.0-scsi-0:0:0:0 /dev/disk/by-uuid/A8D9-2F05
E: DEVNAME=/dev/sdb
E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0/host8/target8:0:0/8:0:0:0/block/sdb
E: DEVTYPE=disk
E: ID_BUS=usb
E: ID_FS_TYPE=vfat
E: ID_FS_USAGE=filesystem
E: ID_FS_UUID=A8D9-2F05
E: ID_FS_UUID_ENC=A8D9-2F05
E: ID_FS_VERSION=FAT16
E: ID_INSTANCE=0:0
E: ID_MODEL=STM32_STLink
E: ID_MODEL_ENC=STM32\x20STLink
E: ID_MODEL_ID=3744
E: ID_PATH=pci-0000:00:14.0-usb-0:3:1.0-scsi-0:0:0:0
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_3_1_0-scsi-0_0_0_0
E: ID_REVISION=0100
E: ID_SERIAL=STM32_STM32_STLink-0:0
E: ID_TYPE=disk
E: ID_USB_DRIVER=usb-storage
E: ID_USB_INTERFACES=:080650:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=STM32
E: ID_VENDOR_ENC=STM32\x20\x20\x20
E: ID_VENDOR_ID=0483
E: MAJOR=8
E: MINOR=16
E: MPATH_SBIN_PATH=/sbin
E: SUBSYSTEM=block
E: TAGS=:systemd:
E: USEC_INITIALIZED=33484404
share|improve this question
up vote 2 down vote accepted

First, you are using a match key operator, i.e. == instead of an assign key operator: =.
Second, it's not an OPTION but an ENVIRONMENT variable: ENV{UDISKS_IGNORE}. Also, I'd use a higher number like 98-stm32.rules so as to prevent other rules overriding it.
That being said, the following rule should work (it does on my system):

ENV{ID_SERIAL}=="STM32_STM32_STLink-0:0", ENV{UDISKS_IGNORE}="1"

run:

udevadm control --reload

to reload rules.

share|improve this answer
1  
works like a charm, thanks a lot – mrtworo Jun 23 '13 at 19:36
  • ignore_device was removed with udev release 148. See release note or changelog

    If you noticed, all topics suggesting the use of it are old (~ 2009).

    A quick alternative is to use: ENV{UDISKS_PRESENTATION_HIDE}="1" for distribution with udisks, ENV{UDISKS_IGNORE}="1" for distributions which include udisks2.

    Reference: Archlinux Wiki: Udisks

  • Other possible solutions are using SYSFS. Either device/authorized , device/remove or driver/unbind.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .