# Annoying udev problem with 2 DVD-ROM drives [SOLVED]

## evoweiss

Hi all,

For some time udev has been messed up with respect to handling two dvd rom drives. Usually it's ok, but sometimes it misassigns names so that the dvd drive that was assigned 0 is now assigned 1 and vice versa. I know that the original device names (hdc and hdd) are ok and still correspond to the correct drives, but when the devices are made via udev, it can be screwed up sometime. Also, I just managed to temporarily fix the problem by typing in udevstart from root.

Anybody have an idea of how to permanently fix this annoyance?

Best,

AlexLast edited by evoweiss on Sun Feb 04, 2007 8:43 pm; edited 3 times in total

----------

## NeddySeagoon

evoweiss,

Use /dev/hdc and /dev/hdd in /etc/fstab or follow this guide to write some udev rules to fix the names based on the serial numbers or something unique to each drive.

----------

## evoweiss

Hey NeddySeagoon,

Adding the following lines to /etc/udev/rules.d/50-udev.rules did the trick:

```
BUS=="ide",     KERNEL=="hdc",  SYMLINK+="cdrom",       GROUP="cdrom"

BUS=="ide",     KERNEL=="hdd",  SYMLINK+="cdrom1",      GROUP="cdrom"

```

Best,

Alex

----------

## NeddySeagoon

evoweiss,

Don't do that, etc-update will want to replace that file every time udev is updated.

Make a new file that starts with a number less than 50, otherwise any name you like. Rules files are run in order, starting with 00 and you want your rules to be applied before the defualt 50-udev.rules.

Put your CDROM rules in your new file, then you won't be disappointed when you run etc-update.

----------

## evoweiss

Hi again NeddySeagoon,

Done!

Alex

----------

## evoweiss

Hi again all,

Unfortunately, that didn't solve the problem as a reboot caused the drives to be misassigned again! However, I found out that typing in udevstart fixes the problem. So, in short, what the hell am I doing wrong? To fix this annoying problem with the HDDs time being out of sync I hadded a file .critical to the /etc/runlevels/boot/ directory. It contains the following:

```
clock checkroot modules checkfs localmount bootmisc
```

Anyway, if anybody knows how to get things working on a permanent basis, I'd appreciate it.

Best,

Alex

----------

## chewbar

Hi.

I have exactly the same situation with two dvd drives. My new rules work fine when if I run udevstart but I want the devices to be created at boot time.

Does anyone know whether this is the correct behaviour or not? Surely udev should be started at boot..

Thanks.

----------

## gary

Same problem here. 

I have a SCSI cdrw and an IDE cdrom.

UDEV now wants to link cdrom, cdrom1, cdrw, and cdrw1 all to sr0, which is my cdrw. It works like a champ, but my cdrom is not accessible. 

Running udevstart reassigns cdrom and cdrom1 to hdb, which is correct. It also creates cdrom3, cdrw2 and cdrw3, which did not previously exist. 

Strange.

Perhaps we do not have UDEV starting when or how it should at boot? How could we check?

----------

## PaulBredbury

I'd just add custom rules to 10-local.rules, to force udev to use the right names the first time.

----------

## evoweiss

 *PaulBredbury wrote:*   

> I'd just add custom rules to 10-local.rules, to force udev to use the right names the first time.

 

Already tried that, though used a different file name. I just changed that file name to 10-local.rules and it's still not working. Again, running udevstart fixes the problem, suggesting that my udev rules are in order, but udev is not being run at boot up. How can we figure out what's going on, and, more importantly, how to fix it?

Best,

Alex

----------

## PaulBredbury

man udev mentions debug in /etc/udev/udev.conf

----------

## holycow

I use 80-local.rules to tell udev to set the proper symlinks.  This lets you override udev rules.

----------

## evoweiss

 *PaulBredbury wrote:*   

> man udev mentions debug in /etc/udev/udev.conf

 

Ok, I turned on logging in that. Unfortunately, I can't seem to find a log file.

Alex

----------

## PaulBredbury

 *evoweiss wrote:*   

> Unfortunately, I can't seem to find a log file.

 

The normal default is /var/log/messages - you actually have to be running a logger  :Wink:    emerge syslog-ng

----------

## evoweiss

Hi,

I've got a logger and here's what I see in my everything log file.

```
Jan 10 22:53:37 [udevd] add_to_rules: invalid KERNEL operation

Jan 10 22:53:37 [udevd] add_to_rules: invalid rule '/etc/udev/rules.d/30-svgalib.rules:1'
```

Not overly helpful. Looking at 30-svgalib.rules reveals...

```
KERNEL="svga*", NAME="%k", MODE="0660", GROUP="video"
```

Alex

----------

## PaulBredbury

 *evoweiss wrote:*   

> KERNEL="svga*"

 

That should be "==", not a single equals sign. It's a comparison.

----------

## evoweiss

Bump...

----------

## evoweiss

Re-bump...

----------

## branchcut

I'm having issues in this area as well. I have a DVD-ROM drive for hdc and a DVD Writer for hdd. Unfortunately, the symlinks look like this:

cdrom -> hdd

cdrom1 -> hdd

Any ideas?

Desmond

----------

## evoweiss

Hi all,

Upgrading to udev-104-r8 fixed it for me. If it seems to work for everybody else, let's mark this as solved.

Best,

Alex

----------

