weird problem with mount/cdrom/symlink
I've two drives in my machine, a cdrom (hdc) and a dvd (hdd) which weren't properly detected at installation, so I created the relevant mount points (mount/cdrom, mount/dvd), created the sym-links with 'ln -s /dev/hdc /dev/cdrom' and 'ln -s /dev/hdd /dev/dvd', then edited the fstab so it looks as follows:
Quote:
So, I went looking for a possible explanation and found that, in /dev, the link to the cdrom (which should be hdc) is actually to hdd - the dvdrom. So, I deleted the existing link to hdc and created a new one, all as root. That did the trick - until I rebooted today and found that the same link to hdc I had created yesterday now links to hdd! Can anyone explain where I'm going wrong, as this has me a bit baffled. Thanks. |
I'd suspect udev to create those links. Do you use udev?
|
Yes, I think so - how can I check for sure?
I'm actually running Zenwalk 2.2 at the moment which is based on Slackware (I've posted here rather than the Zenwalk site because a) their server is down and b) I've always found the people on this forum to be very helpful). I had a look at the udev website and, to my amusement, it says: Quote:
Do you have any suggestions as to how I can stop this happening? I'm assuming I need to somehow make udev accept a fixed symlink to hdc, but how do I achieve that? Thanks |
To check if you use udev, on Slackware you'd check if /etc/rc.d/rc.udev is executable:
Code:
pu@slackw:/$ v /etc/rc.d/rc.udev Code:
pu@slackw:/$ ps -ef | grep udev |
And this is what I get:
Quote:
|
The script that controls these symlinks in udev can be found at /etc/udev/scripts/make_extra_nodes.sh
I had a similar problem, in that I have two DVD drives, one DVD and one DVDRW which are located at /dev/hda and /dev/hdb, respectively. On boot up (because of the way the script works) it links /dev/cdrom and /dev/dvd to /dev/hdb, rendering hda pretty useless. I haxx0red the script a little to make links like /dev/cdrom0 and /dev/cdrom1 and then removed the section where it links to /dev/dvd, for clarity. My version reads (trimmed for readability): Code:
# If we can, add a default /dev/cdrom and /dev/dvd link: Hope that helps, - Piete. |
Whoa! Not sure I understood much of that!
I had a look in /etc/udev for the script you mentioned but there's no sign of it. What I did find was a file called 'udev.rules', which contained the following: Quote:
I'm not averse to having a go at hacking a script - but I've never really done much of this stuff so I'm anxious to get things absolutely clear before I dive in. I'm guessing here - but that bit at the end about '/lib/udev/cdrom-symlinks.sh' looks like it might be involved somehow? That script looks like this: Quote:
|
I would've come the same conclusion. Basically that udev rule says: "if you find some optical devices, run the script". My udev-rule-knowledge is, frankly, pants, so you'd be best checking some of the awesome tutorials on that if you wanna be certain.
The script says (if I read this right), find out how many devices exist, and symlink each optical device to /dev/cdromX where X is some value that it counts up. So, in theory, you should already have individual links in /dev/ like, /dev/cdrom, /dev/cdrom0, /dev/cdrom1, /dev/dvd, /dev/dvd0, /dev/dvd1 .. if I read the script correctly, you should have *all* of those links ... if you don't, then you need to start asking if that script is running. It's just a bash script, so, it's easy to hack. Use # at the start of a line to comment out that line, and use things like: echo "We made it here!" That'll print out to the terminal to show you what's running where ... so, whack some echos in the script and, as root, run: /etc/rc.d/rc.udev restart If that doesn't work you'll have to kill udev and start it up again from /etc/rc.d/rc.udev . Let us know how it goes and what you discover! I'm sorry I'm not running the same version of Slack as you to be able to help more! - Piete. |
All times are GMT -5. The time now is 04:30 AM. |