# Udev can't mount CD-Rom

## vojta.d

Hello,

why this rule for udev can't mount a cdrom?

Rule:

```

ACTION=="add", KERNEL=="hd?", GROUP="cdrom"

ACTION=="add", KERNEL=="hd?", RUN+="/bin/mount /dev/%k", OPTIONS="last_rule"

```

and in /etc/fstab is:

```

/dev/hdc                /media/cdrom-hdc        auto        ro        0 0

```

Thank you

P.S. And sorry for my bad English  :Wink: 

----------

## interested1

This is what I have in my /etc/udev/rules.d/50-udev.rules

```
BUS=="ide",     KERNEL=="hd[a-z]", ACTION=="add", IMPORT="cdrom_id --export $tempnode"
```

And my /etc/fstab:

```
/dev/hdc        /mnt/cdrom      iso9660         noauto,user,ro  0 0
```

But you should not need to change around your default udev setup... at least I have never had to alter what is in 50-udev.rules.  Most of the documents on udev suggest that you make rules that will trump the 50-udev.rules rather than editing the file directly.  What you may need to do is check that the user who is trying to use the CD has the proper group permissions.  That is: are both in the group "cdrom" and that the group "cdrom" has the proper permissions on the device?

What kind of CD are you trying to mount? If it is a data CD do you have the appropriate filesystem support compiled in your kernel?  If it is an audio CD you do not need to mount it, rather, use an audio application to read the contents of the CD.

Check out the man page for mount too.  Whenever I have to deal with udev I make sure that the command line mounting is working first, then I try to troubleshoot the udev.

Hope this helps.

----------

## vojta.d

It mounts fine by running `mount /dev/hdc', but udev doesn't even try. Tried RUN+="/bin/touch /tmp/try", but it didn't created that file. Weird is this: same rule works for USB flashdisk.... by the way, we talkin about DataCD. And udev mounts it by running `udevstart' and I have permissions.

----------

