LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 10-29-2005, 06:04 AM   #1
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 635

Rep: Reputation: 35
udev trouble - can't auto-symlink


I have a Sony DVD-RW which used to show up as /dev/s[rg]? (ie /dev/sr0 and /dev/sg0). I don't use it all that often anymore, and haven't noticed that in one of my -current upgrades towards 10.2 it has most likely become broken.

My /etc/udev/rules.d/10-local.rules is as follows:
Code:
BUS="scsi", KERNEL="s[grt][0-9]*", SYSFS{manufacturer}="Sony", SYSFS{serial}="DRX-510ULK_CED032849", NAME="%k", GROUP="cdrom", MODE="0666", SYMLINK="cdrom"

KERNEL="ttyUSB[0-9]*",  NAME="tts/USB%n", SYSFS{product}="Palm Handheld", GROUP="tty", MODE="0666", SYMLINK="pilot"

KERNEL="sd*", SYSFS{idVendor}=="0c76", NAME="%k", MODE="0666" SYMLINK="memstick"
This works great for the Memory Stick and Palm Treo, but for the DVD-rom it doesn't create the symlink. I've read the "udev howto" and used the varios udev tools to get the SYSFS information used above, but I still have two problems:

1. I would like the alias (/dev/cdrom->/dev/s[rg]?) to be created, and the fact that it isn't is a symptom that something else is wrong

2. k3b no longer recognizes/finds any DVD players, even though I've used it to burn multiple CDs and DVDs before (although that's a couple of months ago)

I have also tried to run this as root, without any further additional success.

The permissions on the devices are as follows:
Code:
crw-rw-rw-  1 root cdrom 21, 0 2005-10-28 15:09 sg0
brw-rw-rw-  1 root cdrom 11, 1 2005-10-28 15:09 sr1
lsusb -v gives:

Code:
Bus 001 Device 008: ID 054c:014f Sony Corp.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x054c Sony Corp.
  idProduct          0x014f
  bcdDevice            1.00
  iManufacturer           1 Sony
  iProduct                2 DRX-510UL
  iSerial                 3 DRX-510ULK_CED032849
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xc0
      Self Powered
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      2 SFF-8020i, MMC-2 (ATAPI)
      bInterfaceProtocol     80
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  bytes 512 once
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  bytes 512 once
        bInterval               0
Thanks for any insight!

-Y1
 
Old 10-29-2005, 08:16 AM   #2
MMYoung
Member
 
Registered: Apr 2004
Location: Arkansas
Distribution: Ubuntu 8.10
Posts: 365

Rep: Reputation: 30
I had a similar problem, ie my own udev rule for my DVD-R and DVD-ROM, and neither was created by udev. My solution was to comment out my custom udev rules and just let the make_extra_nodes.sh script create them for me. In the past this script never created the proper symlinks, which is the reason for my own udev rules, but now it seems to work perfectly.

lrwxrwxrwx 1 root root 3 2005-10-28 12:38 /dev/cdrom -> hdc
lrwxrwxrwx 1 root root 3 2005-10-28 12:38 /dev/cdrom0 -> hdc
lrwxrwxrwx 1 root root 3 2005-10-28 12:38 /dev/cdrom1 -> hdd
lrwxrwxrwx 1 root root 3 2005-10-28 12:38 /dev/dvd -> hdc
lrwxrwxrwx 1 root root 3 2005-10-28 12:38 /dev/dvd0 -> hdc
lrwxrwxrwx 1 root root 3 2005-10-28 12:38 /dev/dvd1 -> hdd

brw-rw---- 1 root cdrom 22, 0 2005-10-28 12:38 /dev/hdc
brw-rw---- 1 root cdrom 22, 64 2005-10-28 12:38 /dev/hdd

Later,
MMYoung
 
Old 10-29-2005, 10:22 AM   #3
mrcheeks
Senior Member
 
Registered: Mar 2004
Location: far enough
Distribution: OS X 10.6.7
Posts: 1,690

Rep: Reputation: 50
I had the problem with zenwalk, the link to the cd writer/dvd was not added. For the first time, /dev/hdc didn't exist!
- I appended udev option to the kernel boot options.
- I edited /etc/fstab and changed /dev/cdrom to /dev/hdd and added a reference to my cd writer /dev/hdc.
- I rebooted, the links are created, hdc was now in the /dev directory and the symlinks to dvd and cdrom were there.

I didn't mess a lot with udev configuration and the extra nodes script. It wasn't working for me anyway. sg0 means you are using scsi emulation i think and it is not required for kernel 2.6.X.
 
Old 10-30-2005, 03:47 AM   #4
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 635

Original Poster
Rep: Reputation: 35
Thanks for the answers guys!

How do you make the "make_extra_nodes.sh" script run in 10.2 ?

As for the SCSI driver, my DVD-RW is a SCSI-system with a USB interface, and thus it will not function without SCSI support. It is the same thing under Windows XP, and according to Sony (who make the most horrible, awful software interfaces on this planet!), there's no way around SCSI on this one.

It would be interesting to find out the exact source of my problem though, as my custom udev rule is clearly being used - it sets the correct group and permissions, but for some reason does NOT create the symlink...

I know it sounds like I'd like to eat the cake and still have it, but one of the reasons why I run Slackware is because I like to know exactly what happens on my system and why.

Thanks again!
 
Old 10-30-2005, 04:59 AM   #5
MMYoung
Member
 
Registered: Apr 2004
Location: Arkansas
Distribution: Ubuntu 8.10
Posts: 365

Rep: Reputation: 30
Quote:
Originally posted by Yalla-One
Thanks for the answers guys!

How do you make the "make_extra_nodes.sh" script run in 10.2 ?
Nothing, it runs automatically. If you have a rule that "conflicts" with the "rules" set up in it, there can be problems. "Theoretcially" udev should take your local rules and apply them first, if you put your rules in a file named 10-local.rules in /etc/udev/rules.d, and should ignore rules that apply to that device. The make_extra_nodes.sh, however, has a section that applies to CD/DVD drives and I it "conflicted" with my local rules.
Quote:
Originally posted by Yalla-One
As for the SCSI driver, my DVD-RW is a SCSI-system with a USB interface, and thus it will not function without SCSI support. It is the same thing under Windows XP, and according to Sony (who make the most horrible, awful software interfaces on this planet!), there's no way around SCSI on this one.
USB drives should ALWAYS be set up as SCSI devices, that's how it is supposed to work. Unless you have that horrid UB *thing* set up in the kernel and then they probably wouldn't work at all. They would be recognized as ubx rather than sdx.
Quote:
Originally posted by Yalla-One
It would be interesting to find out the exact source of my problem though, as my custom udev rule is clearly being used - it sets the correct group and permissions, but for some reason does NOT create the symlink...
The make_extra_nodes.sh script also sets group and permissions the same as what your local rule sets them. That's why I suggested you comment out your local rules to see what happens.
Quote:
Originally posted by Yalla-One
I know it sounds like I'd like to eat the cake and still have it, but one of the reasons why I run Slackware is because I like to know exactly what happens on my system and why.

Thanks again!
Nope, sounds like to me you're the typical "Slacker" . Take a look at the /etc/udev/scripts/make_extra_nodes.sh script and you can get a better understanding of what it is doing in regards to not only you CD devices but LOTS of other stuff too.

Later,
MMYoung
 
Old 11-02-2005, 03:15 PM   #6
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 635

Original Poster
Rep: Reputation: 35
Thanks again for your insight.

I have removed my own rule from 10-local.rules, and when I run udevstart manually, it creates the /dev/cdrom -> /dev/sg0 and /dev/cdrom0 -> /dev/sg0 symlinks. However, when I reboot, these symlinks are not created and thus it does not work..

I find this weird to say the least, as according to /etc/rc.d/rc.udev, udevstart is exactly what's run when the system boots. Is this perhaps caused by some kind of race condition, or is it (more likely) yet a configuration error on my part?

-Y1
 
Old 11-02-2005, 06:38 PM   #7
MMYoung
Member
 
Registered: Apr 2004
Location: Arkansas
Distribution: Ubuntu 8.10
Posts: 365

Rep: Reputation: 30
Quote:
Originally posted by Yalla-One
I have removed my own rule from 10-local.rules, and when I run udevstart manually, it creates the /dev/cdrom -> /dev/sg0 and /dev/cdrom0 -> /dev/sg0 symlinks. However, when I reboot, these symlinks are not created and thus it does not work..
Is /etc/rc.d/rc.udev executable? If it isn't then it won't start when you reboot. Check the file settings by using ls:

mmyoung@darkstar:~$ ls -l /etc/rc.d/rc.udev
-rwxr-xr-x 1 root root 1396 2005-07-30 13:14 /etc/rc.d/rc.udev*

Make sure that the -rwxr-xr-x is EXACTLY as it is above. If the output is different, then use the chmod command to set the rc.udev script to execute at startup. You do this from a terminal, or from the command line, logged in as root:

chmod +x /etc/rc.d/rc.udev

Now when you reboot udev will run and all should be "right with the world" again.

Later,
MMYoung
 
Old 11-03-2005, 02:08 AM   #8
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 635

Original Poster
Rep: Reputation: 35
Hi,

rc.udev is executable - if not I wouldn't have had the other devices either, and it wouldn't have been running my custom 10-local.rules.

So while rc.udev is starting just fine, the make_extra_nodes.sh is either not running, or not _functioning_ when I boot. I have no trouble accessing the CD through /dev/sr0, but it's annoying that it won't auto-create the cdrom alias...

Thanks
 
Old 11-03-2005, 06:04 AM   #9
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,433

Rep: Reputation: 93
Try add a rule like this :
Code:
KERNEL="sr0", SYMLINK="cdrom"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Udev & devices trouble Macky Slackware 1 12-01-2005 02:11 PM
opensuse 10.0 pccard network udev ? trouble leonardo-vittorio Suse/Novell 1 11-04-2005 02:38 AM
udev takes long time to create /dev/usbhd symlink Yalla-One Slackware 4 04-04-2005 03:27 AM
trouble creating symlink for java/mozilla MightyKC Linux - Software 1 03-03-2005 11:40 PM
The trouble with fstab/auto/user/s Rudibot Mandriva 1 11-26-2004 07:02 AM


All times are GMT -5. The time now is 04:17 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration