…and a Happy New Year / udev and Gentoo Linux

Recently I had problems with rather old programs which rely on the files /dev/dvd or /dev/cdrom to access the DVD drive. Apparently udev didn’t create these files, so only /dev/sr0 was present. Therefore I had to write an udev rule linking /dev/sr0 to /dev/cd and /dev/dvd. Rather unusual, but nevertheless…

1. Create /etc/udev/rules.d/80-cdrom.rules

SUBSYSTEM=="block", KERNEL=="sr0", SYMLINK+="cdrom", GROUP="cdrom"
SUBSYSTEM=="block", KERNEL=="sr0", SYMLINK+="dvd", GROUP="cdrom"
SUBSYSTEM=="block", KERNEL=="sr0", SYMLINK+="dvdrw", GROUP="cdrom"
SUBSYSTEM=="block", KERNEL=="sr0", SYMLINK+="cdrw", GROUP="cdrom"

2. Test it with udevadm:

/sbin/udevadm test /sys/block/sr0/

This way the rules get loaded and one receives a lot of output to check if all went well.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s