View Full Version : Bug creating /dev/cdrom softlink?
dedded
2006-04-04, 08:01 PM CDT
My machine has two optical devices: a cd/dvd reader and a cd/dvd burner.
In previous versions of Fedora, the /dev/cdrom symlink pointed to /dev/hdc (the reader) and the /dev/cdwriter symlink (might have been /dev/cdrecorder in FC3) pointed to /dev/hdd (the burner).
After installing FC5, both /dev/cdrom and /dev/cdwriter point to /dev/hdd (the burner). Is this wrong? It feels wrong. If wrong, should I file a bug?
I re-created /dev/cdrom as a symlink to /dev/hdc, would there be any problem with this?
/Dan
LocutusOfBorg
2006-04-05, 12:31 AM CDT
Between the two FC versions is changed the syntax of the UDEV rules. I had a similar problem with my optical drives and I fixed it editing my custom udev rules.
dedded
2006-04-05, 04:43 AM CDT
LocutosOfBorg,
I don't understand your reply. I'm not having a problem with my optical drives (though I haven't attempted burning yet). I have a symlink (/dev/cdrom) that I believe was set up incorrectly during installation. I got this:
/dev/cdrom --> /dev/hdd
/dev/cdwriter --> /dev/hdd
and believe that I should have gotten this:
/dev/cdrom --> /dev/hdc
/dev/cdwriter --> /dev/hdd
Is this a bug in the installer?
/Dan
PS: What are udev rules? Where does one set custom ones? Can you point me to some reading on this?
LocutusOfBorg
2006-04-05, 05:49 AM CDT
UDEV is responsible for creating the device nodes in /dev at startup. Id doesn't only create the regular nodes, but even some symlinks. If your cd-reader is hda, it creates /dev/hda and probably /dev/cdrom and /dev/dvd pointing to it, depending on what UDEV thinks your device is.
In you case, udev create the cdrom and cdwriter links pointing to the same device but you'd rather have the symlinks in a different way.
Being udev behaviour guided by the *.rules files in the /etc/udev/rules.d directory, you can modify how udev acts writing a custom set of rules in which you tell udev how you want your devices be named. Rules files are readed sequentially, and the default one is 50-udev.rules - so name yours as, say, 20-custom.rules.
In my file there is something like
KERNEL=="hda", SYMLINK=+"cdrom dvd dvdram", OPTIONS="last_rule"
KERNEL=="hdb", SYMLINK=+"cdrecorder cdwriter", OPTIONS="last_rule"
I'm not sure about the syntax, because it changed between FC4 and FC5 and I don't have the file handy at this time.
A useful think is
http://reactivated.net/writing_udev_rules.html
but it is a little outdated.
Try even
http://gentoo-wiki.com/UDEV
http://www.gentoo.org/doc/en/udev-guide.xml
dedded
2006-04-08, 09:00 PM CDT
Thanks, LocutosOfBorg. I've created a udev rule which seems successful at pointing /dev/cdrom to the readonly drive. So my system is set up the way I want it in this regard. And I learned a bit.
However, looking at the default rules, it appears that either the cd rom or the cd burner could have received this designation. And it seems to me that since a machine with one cd/dvd rom and with an additional burner is a very common configuration, that you would want /dev/cdrom to point to the rom drive (and /dev/cdwriter to the burner). It certainly worked that way for me in RH9, FC2, FC3, and FC4. Whether or not that was by design or by happy circumstance I don't know.
So, though my personal problem appears solved, I still ask if this is a bug. Should the rules be written so that /dev/cdrom points to the rom drive in a system with one rom drive and one burner?
Thanks,
Dan
vBulletin® v3.7.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.