|
From: Mr. Usenet on 9 Jan 2008 13:46 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.
From: toshiro on 10 Jan 2008 09:42 On Jan 9, 1:46 pm, "Mr. Usenet" <spamthe...(a)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.
From: Mr. Usenet on 10 Jan 2008 13:47 toshiro wrote: > On Jan 9, 1:46 pm, "Mr. Usenet" <spamthe...(a)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.
From: jayjwa on 10 Jan 2008 20:15 "Mr. Usenet" <spamtheftc(a)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/security/news/2007/08/wiretap http://www.hermes-press.com/police_state.htm
From: Robby Workman on 11 Jan 2008 00:20
On 2008-01-10, toshiro <manimotomushi(a)hotmail.com> wrote: > On Jan 9, 1:46 pm, "Mr. Usenet" <spamthe...(a)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 |