This is a discussion on Problems with udev within the Linux Operating System forums, part of the Unix Operating Systems category; --> Hi I'm running Slackware 12.0, kernel 2.6.21.5. I have a dvd and a cd drive. My problem is that ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi I'm running Slackware 12.0, kernel 2.6.21.5. I have a dvd and a cd drive. My problem is that the link /dev/cdrom intermittently points to /dev/hdd, i.e.: %~$ ls -l /dev/cdrom lrwxrwxrwx 1 root root 3 2008-01-08 07:13 /dev/cdrom -> hdd rather than /dev/hdc. This is after I created the file: /etc/udev/rules.d/10-local.rules which contains: KERNEL=="hdc", SYMLINK="cdrom" Before I created this file, it constantly pointed to /dev/hdd. Now, it seems to alternate daily between hdc and hdd. When I do: udevtest /sys/block/hdd I get: ..... update_link: found '/block/hdc' for 'cdrom' update_link: compare priority of '/block/hdc' 0 > 0 update_link: found '/block/hdd' for 'cdrom' update_link: compare (our own) priority of '/block/hdd' 0 >= 0 update_link: 'cdrom' with target 'hdd' has the highest priority 0, create it ..... which seems to say that there is still some file trying to push /dev/ hdd as the link from /dev/cdrom. One other confusing thing is that the timestamp in: lrwxrwxrwx 1 root root 3 2008-01-08 07:13 /dev/cdrom -> hdd for the created link is 07:13, and the computer was not on at this time. So can anyone tell me how to make the link with /dev/hdc permanent? Thanks. |
| |||
| On Jan 9, 1:46 pm, "Mr. Usenet" <spamthe...@yahoo.com> wrote: > .... > So can anyone tell me how to make the link with /dev/hdc permanent? > Thanks. If you *always* want your cdrom to point to /dev/hdc AND you do not need dynamic assignment of you cdrom device... then there is no need to use udev for this so remove *your* changes from /etc/udev/rules.d, and instead do the following: Make sure user.group of /dev/hdc is root.cdrom (ls -l /dev/hdc = brw-rw---- 1 root cdrom 22, 64 2008-01-09 05:58 /dev/ hdc) Make a symlink /dev/cdrom -> /dev/hdc (ls -l /dev/cdrom = lrwxrwxrwx 1 root root 3 2008-01-09 05:58 /dev/ cdrom -> hdc) In fstab uncomment the line (or add the line): /dev/cdrom /mnt/cdrom iso9660 noauto,user,ro 0 0 This should do what you need. |
| |||
| toshiro wrote: > On Jan 9, 1:46 pm, "Mr. Usenet" <spamthe...@yahoo.com> wrote: > > > ... > > So can anyone tell me how to make the link with /dev/hdc permanent? > > Thanks. > > If you *always* want your cdrom to point to /dev/hdc AND you do not > need dynamic assignment of you cdrom device... then there is no need > to use udev for this > so remove *your* changes from /etc/udev/rules.d, and instead do the > following: > > Make sure user.group of /dev/hdc is root.cdrom > (ls -l /dev/hdc = brw-rw---- 1 root cdrom 22, 64 2008-01-09 05:58 /dev/ > hdc) > > Make a symlink /dev/cdrom -> /dev/hdc > (ls -l /dev/cdrom = lrwxrwxrwx 1 root root 3 2008-01-09 05:58 /dev/ > cdrom -> hdc) > > In fstab uncomment the line (or add the line): > /dev/cdrom /mnt/cdrom iso9660 noauto,user,ro 0 0 > > This should do what you need. Thanks for the reply. I'm wondering though, if the above will work since the system was already set similar to what you have said. fstab has the lines you mention, and I get the following when I do: $ ls -l /dev/hdc brw-rw-rw- 1 root cdrom 22, 0 2008-01-10 01:08 /dev/hdc $ ls -l /dev/cdrom lrwxrwxrwx 1 root root 3 2008-01-10 01:08 /dev/cdrom -> hdc The only difference is the permissions on my /dev/hdc which is "brw-rw- rw-" rather than "brw-rw----". And if I remove rw from o, i.e. chmod o-rw /dev/hdc I'm worried I won't be able to use the cdrom writer. I can remove the rules I added to make things almost exactly like before, but I think it will just mean that /dev/cdrom will permanently point to /dev/hdd which was my initial problem. |
| |||
| "Mr. Usenet" <spamtheftc@yahoo.com> writes: > So can anyone tell me how to make the link with /dev/hdc permanent? > Thanks. IMO, dump udev. How many times does one really add devices to their system? udev takes something trivial, adds a bunch of config files, makes it more complex, and then fails to work. Progression, backwards. -- [** America, the police state **] Whoooose! What's that noise? Why, it's US citizen's rights, going down the toilet with Bush flushing. http://www.wired.com/politics/securi...007/08/wiretap http://www.hermes-press.com/police_state.htm |
| |||
| On 2008-01-10, toshiro <manimotomushi@hotmail.com> wrote: > On Jan 9, 1:46 pm, "Mr. Usenet" <spamthe...@yahoo.com> wrote: >> > ... >> So can anyone tell me how to make the link with /dev/hdc permanent? >> Thanks. > > If you *always* want your cdrom to point to /dev/hdc AND you do not > need dynamic assignment of you cdrom device... then there is no need > to use udev for this > so remove *your* changes from /etc/udev/rules.d, and instead do the > following: > > Make sure user.group of /dev/hdc is root.cdrom > (ls -l /dev/hdc = brw-rw---- 1 root cdrom 22, 64 2008-01-09 05:58 /dev/ > hdc) > > Make a symlink /dev/cdrom -> /dev/hdc > (ls -l /dev/cdrom = lrwxrwxrwx 1 root root 3 2008-01-09 05:58 /dev/ > cdrom -> hdc) > > In fstab uncomment the line (or add the line): > /dev/cdrom /mnt/cdrom iso9660 noauto,user,ro 0 0 > > This should do what you need. That's great until the OP reboots - it's not going to persist. The proper way is to handle it with udev. I'll post that in just a moment to the original post. -RW |
| |||
| ["Followup-To:" header set to alt.os.linux.slackware.] On 2008-01-09, Mr. Usenet <spamtheftc@yahoo.com> wrote: > Hi > > I'm running Slackware 12.0, kernel 2.6.21.5. I have a dvd and a cd > drive. My problem is that the link /dev/cdrom intermittently points > to /dev/hdd, i.e.: > > %~$ ls -l /dev/cdrom > lrwxrwxrwx 1 root root 3 2008-01-08 07:13 /dev/cdrom -> hdd > > rather than /dev/hdc. > > This is after I created the file: > > /etc/udev/rules.d/10-local.rules > > which contains: > > KERNEL=="hdc", SYMLINK="cdrom" > > Before I created this file, it constantly pointed to /dev/hdd. Now, > it > seems to alternate daily between hdc and hdd. When I do: > > udevtest /sys/block/hdd > > I get: > > .... > > update_link: found '/block/hdc' for 'cdrom' > update_link: compare priority of '/block/hdc' 0 > 0 > update_link: found '/block/hdd' for 'cdrom' > update_link: compare (our own) priority of '/block/hdd' 0 >= 0 > update_link: 'cdrom' with target 'hdd' has the highest priority 0, > create it > .... > > which seems to say that there is still some file trying to push /dev/ > hdd as > the link from /dev/cdrom. One other confusing thing is that the > timestamp > in: > > lrwxrwxrwx 1 root root 3 2008-01-08 07:13 /dev/cdrom -> hdd > > for the created link is 07:13, and the computer was not on at this > time. > > So can anyone tell me how to make the link with /dev/hdc permanent? > Thanks. See /etc/udev/rules.d/75-optical-devices.rules Edit the generated rules in there to make the links point where you want them to point. Also remove your custom rule - it's not needed. The conflict you were seeing is/was the result of your custom rule in conjunction with the generated rules. -RW |
| |||
| jayjwa <jayjwa@vdrl.ath.cx.invalid> wrote: > IMO, dump udev. How many times does one really add devices to their system? Every time you insert an USB stick? Every time you connect something else by USB? IMHO udev is a good replacement for the old hotplug. Also fixed devices like network cards are handled well. With udev it is easy to make sure that a card with a special mac address always gets named eth1. > udev takes something trivial, adds a bunch of config files, makes it > more complex, and then fails to work. Progression, backwards. For me it was rather easy to understand how to edit udev files. I have also been able to edit some hald files, but I think that the hald files are more messy. regards Henrik -- The address in the header is only to prevent spam. My real address is: hc1(at)poolhem.se Examples of addresses which go to spammers: root@localhost postmaster@localhost |
| |||
| On Jan 10, 1:47 pm, "Mr. Usenet" <spamthe...@yahoo.com> wrote: > toshiro wrote: > > On Jan 9, 1:46 pm, "Mr. Usenet" <spamthe...@yahoo.com> wrote: > > > ... > > > So can anyone tell me how to make the link with /dev/hdc permanent? > > > Thanks. > > > If you *always* want your cdrom to point to /dev/hdc AND you do not > > need dynamic assignment of you cdrom device... then there is no need > > to use udev for this > > so remove *your* changes from /etc/udev/rules.d, and instead do the > > following: > > > Make sure user.group of /dev/hdc is root.cdrom > > (ls -l /dev/hdc = brw-rw---- 1 root cdrom 22, 64 2008-01-09 05:58 /dev/ > > hdc) > > > Make a symlink /dev/cdrom -> /dev/hdc > > (ls -l /dev/cdrom = lrwxrwxrwx 1 root root 3 2008-01-09 05:58 /dev/ > > cdrom -> hdc) > > > In fstab uncomment the line (or add the line): > > /dev/cdrom /mnt/cdrom iso9660 noauto,user,ro 0 0 > > > This should do what you need. > > Thanks for the reply. I'm wondering though, if the above will work > since > the system was already set similar to what you have said. fstab has > the > lines you mention, and I get the following when I do: > > $ ls -l /dev/hdc > brw-rw-rw- 1 root cdrom 22, 0 2008-01-10 01:08 /dev/hdc > $ ls -l /dev/cdrom > lrwxrwxrwx 1 root root 3 2008-01-10 01:08 /dev/cdrom -> hdc > > The only difference is the permissions on my /dev/hdc which is "brw-rw- > rw-" > rather than "brw-rw----". And if I remove rw from o, i.e. > > chmod o-rw /dev/hdc > Hang on you may have misunderstood - your hdc perms are correct, they should be brw-rw-rw and the ownership should root:cdrom. As a normal user you should belong to the cdrom group by default. If not you can add yourself. > I'm worried I won't be able to use the cdrom writer. > I can remove the rules I added to make things almost exactly like > before, but I think it will just mean that /dev/cdrom will > permanently point to /dev/hdd which was my initial problem. You want the cdrom to point to /dev/hdc right? So make the symlink yourself as I stated earlier and udev will not change it. I had a similar problem when I first started using udev+hal+messagebus with Slack12. So I simply uncommented the cdrom line in fstab and made the following link /dev/cdrom -> /dev/hdc (in my case for CD/RW), and it just worked fine after that. Programs like kplayer, k3b, xmms, etc work fine, also KDE (which auto mounts to /media/cdrom/.... work OK) The advice of other people about editing udev rules is correct as well, but my CD devices are *screwed* into my desktop, laptop, whatever - I do not plug them in and out at all. So why should I use udev to manage them. Things like cameras & mem sticks are good candidates for udev but NOT an internal DVD. For me using fstab and /dev/cdrom->/dev/hdc works fine. It is your choice which way to go but try the fstab + symlink method, it is trivial and you can always rollback your changes in a minute. And let us know the results. Good luck. |
| |||
| Thanks again for everyone's reply. On Fri, 11 Jan 2008 07:39:56, toshiro wrote: >You want the cdrom to point to /dev/hdc right? >So make the symlink yourself as I stated earlier and udev will not >change it. I did make this link myself initially before I knew anything about udev, but it reverted on the next boot. But not after I learned about udev and made all the rules. So I just did this as root and will see how it works. >And let us know the results. Good luck. Thanks, although if the trick was to make the symlink after creating rules than before, then this isn't very intuitive. On Thu, 10 Jan 2008 20:15:33, jayjwa wrote: >IMO, dump udev. How many times does one really add devices to their system? >udev takes something trivial, adds a bunch of config files, makes it >more complex, and then fails to work. Progression, backwards. I admit this is the way I feel too. As a user of Slackware, many times these attempts to automate configuration usually leads to frustration for me, especially since I don't mind manually handling the mounting of hardware. I remember when setting up a printer first meant configuring "printcap", then they added "modules.conf", and now CUPS. Sound started with ISAPNP, then "sndconfig", then they added "modules.conf", and now it's "alsaconf". Each time, hours of hard fought knowledge went out the window as I struggled with the new system that often still had a lot of kinks. I'm an 10+ year user of Linux, and if I get exasperated by the changes, what will this mean to non-Unix newbies. But I guess the point of the changes were so that new users wouldn't have to struggle with configuration, and since every new version of a distribution will end up using the new utilities, I've decided just to go along. On Fri, 11 Jan 2008 05:22:37, Robby Workman wrote: >See /etc/udev/rules.d/75-optical-devices.rules >Edit the generated rules in there to make the links point where you >want them to point. Also remove your custom rule - it's not needed. >The conflict you were seeing is/was the result of your custom rule >in conjunction with the generated rules. I've taken a look but I couldn't figure out what to do except maybe comment out the line: ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-ide-1:1", SYMLINK+="cdrom" I tried tracing this to /lib/udev/cdrom-symlinks.sh, but I can't see anything about "hdd" or "hdc". My online reading of: http://reactivated.net/writing_udev_rules.html didn't help much either, since it seems they thought that my custom rules would have been enough. On Fri, 11 Jan 2008 08:27:35, Henrik Carlqvist wrote: >Every time you insert an USB stick? Every time you connect something else >by USB? IMHO udev is a good replacement for the old hotplug. Also fixed >devices like network cards are handled well. With udev it is easy to make >sure that a card with a special mac address always gets named eth1. I admit, my USB flash drive gets detected pretty easily. |
| ||||
| jayjwa wrote: > Henrik Carlqvist <Henrik.Carlqvist@deadspam.com> writes: > >>> IMO, dump udev. How many times does one really add devices to their system? >> Every time you insert an USB stick? Every time you connect something else >> by USB? IMHO udev is a good replacement for the old hotplug. Also fixed >> devices like network cards are handled well. With udev it is easy to make >> sure that a card with a special mac address always gets named eth1. > > OK, I should've said this better: how many times does one initially > add devices to their system? I don't have to re-make the device files > every time I plug/unplug, for example, my USB flash drive, ACM modem, > PSP/SanDisk. The device file is just a window to what's there (or > not). You point is that in your case, you have intentionally taken something that was inherently designed to be pluggable and want to make it static... and as mentioned, there are many things that can be keyed off of to create persistent names. > > Actually, if udev removes and re-creates device files each and every > time a device is pulled or plugged in, it's likely slower because the > act of deletion and creation along with any processing of the program > itself, takes time. Sure. Obviously, since the device is inherently non-static, there is a dynamic piece to it. And this CAN get in the way if the assumption is made that the device is always present. You may well have to thwart the system a bit and create a static device file (like the old days). However, there are a lot of variables... so even this might not work (floating buses). > > There seems to be two hotplugs floating around too. I see Linux > systems where the users talk about editing files; this would be the > script one. Then there's one with nothing to edit, which is the one I > have and like. ??? I don't edit any files and my device hotplugs and mounts at the same location everytime since the volume or device name is used for the mountpoint. Maybe you simply needs some kind of volume name set on the device (?). > >> For me it was rather easy to understand how to edit udev files. I have >> also been able to edit some hald files, but I think that the hald files >> are more messy. > > I'm sure it's possible, but with so many other config files and things > to wrestle with, why make something that's simple and already works > more differicult? > Uh... it didn't work. You "think" it worked because it happened to work in your particular case. While it is true that most people do define things only in the way that it relates to themselves, it's probably more useful to create a definition that everyone can use. |