Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to disable udev from generating /dev/sr0 device (my cdrom) and Im trying to write udev rules.

I added a file 10-cd-trial.rules in /etc/udev/rules.d and /lib/udev/rules.d, the contents are:

KERNEL=="sr0",SUBSYSTEM=="block",ENV{UDISKS_IGNORE}="1"

and ran

udevadm control --reload-rules

/dev/sr0 hasnt been disable as yet. Am i missing something? Is it necessary I include additional rules for the device, or is my file name incorrect?

I use Ubuntu 12.10. Thanks in advance.

share|improve this question
    
Why exactly do you need to do this? –  grawity Dec 26 '13 at 6:14

1 Answer 1

udev has no option to stop a device node in /dev from being created. In fact, latest udev versions don't even do that anymore; /dev is nowadays a devtmpfs where everything is created by the kernel, and udev only changes file modes, adds symlinks, etc.

Besides, the UDISKS_IGNORE variable is for udisks2, not udev. udisks does not manage /dev contents, but is only an interface for unprivileged programs to mount disks and manage partitions.


If you want to stop users from accessing the CD drive through file managers, try setting ENV{UDISKS_SYSTEM}="1", ENV{UDISKS_AUTO}="0", ENV{UDISKS_SYSTEM_INTERNAL}="1", and ENV{UDISKS_AUTOMOUNT_HINT}="never" (the former two for udisks2, the latter two for udisks1).

share|improve this answer
    
I replaced UDISKS_IGNORE with OPTIONS=="ignore_device", but to no avail. So since, the kernel creates the node itself, my only option is to use the options u specified. –  Vigneshwaren Dec 26 '13 at 6:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.