Bugzilla – Bug 133651
ide-cd not loaded
Last modified: 2006-02-08 19:17:31 UTC
I have installed in my system a cd reader and a dvd recorder. When I insert one cd or dvd submount doesn't mount it. The only way detected that submount works is opening the hardware configuration for Cd drives in Yast. When I open it, submount works without any problem but I see two entries for each cd drive and they doesn't show the information where the devices should be mounted (/media/dvdram or /media/cdrom)
Please attach the output of `hwinfo --cd' and the YaST logfile after you tried to configure your drives. Please attach the resulting /etc/fstab as well as /var/log/boot.msg. Thanks.
Created attachment 57298 [details] /var/log/boot.msg
Created attachment 57299 [details] /etc/fstab
This is the output of `hwinfo --cd': 19: IDE 06.0: 10602 CD-ROM (DVD-RAM) [Created at block.192] Unique ID: _jAI.w3avFA3OSa9 Parent ID: _+Pw.h0shTC21fo2 SysFS ID: /block/hdg SysFS BusID: 3.0 SysFS Device Link: /devices/pci0000:00/0000:00:0f.0/ide3/3.0 Hardware Class: cdrom Model: "HL-DT-ST DVDRAM GSA-4040B" Vendor: "HL-DT-ST" Device: "DVDRAM GSA-4040B" Revision: "A301" Serial ID: "K163ASD4851" Driver: "VIA_IDE", "ide-cdrom", "ide-cdrom" Device File: /dev/hdg Device Files: /dev/hdg, /dev/disk/by-id/ata-HL-DT-ST_DVDRAM_GSA-4040B_K163ASD4851, /dev/disk/by-path/pci-0000:00:0f.0-ide-1:0, /dev/dvdram, /dev/dvd, /dev/cdrecorder Device Number: block 34:0 Features: CD-R, CD-RW, DVD, DVD-R, DVDRAM Size: 0 sectors a 512 bytes Drive status: no medium Config Status: cfg=no, avail=yes, need=no, active=unknown Attached to: #8 (IDE interface) Drive Speed: 32 20: IDE 07.0: 10602 CD-ROM [Created at block.192] Unique ID: RvQM.Nr0UDI0+y65 Parent ID: _+Pw.h0shTC21fo2 SysFS ID: /block/hdh SysFS BusID: 3.1 SysFS Device Link: /devices/pci0000:00/0000:00:0f.0/ide3/3.1 Hardware Class: cdrom Model: "LG CD-ROM CRD-8522B" Vendor: "LG" Device: "CD-ROM CRD-8522B" Revision: "2.01" Serial ID: "" Driver: "VIA_IDE", "ide-cdrom", "ide-cdrom" Device File: /dev/hdh Device Files: /dev/hdh, /dev/disk/by-path/pci-0000:00:0f.0-ide-1:1, /dev/cdrom Device Number: block 34:64 Size: 0 sectors a 512 bytes Drive status: no medium Config Status: cfg=no, avail=yes, need=no, active=unknown Attached to: #8 (IDE interface) Drive Speed: 52 After running this command submount works fine and if I insert any cd/dvd it is mounted automatically (the same issue that when I open Hardware->cd drives in Yast and I don't do any changes) Should I provide more information?
The YaST logfile is still missing, please attach it.
Created attachment 57306 [details] y2log This is the log generated by Yast when I enter in Cd drives. I wish this can help.
Forget this logs! Could you attach output of lshal with not mounted DVD in the device?
Created attachment 57334 [details] lshal This is the output of lshal with no mounted dvd
Is there a /dev/cdrom ?
No there isn't. If I run 'hwinfo --cd' these files are created: /dev/cdrom and /dev/cdrecorder.
and if you now insert a CD/DVD? are they mounted automatically?
Yes. I read un the suse english mailing list that some people has the same problem. Now if I reboot the system the files dissapear and I should run 'hwinfo --cd' to get aumount working for my units. I copy and paste the description of the problem provided by another person, as my english is not very good: "I have installed SUSE 10 on a machine with a DVD-RW device. SUSE do not seem to set up the automount of the DVD device up correctly. The device is in the fstab file: --<snip>-- /dev/dvdrecorder /media/dvdrecorder subfs noauto,fs=cdfss,ro,procuid,nosuid,nodev,exec,iocharset=utf8 0 0 --<snip>-- But, If I go into YaST to Hardware ->CD-ROM devices, then it shows two unconfigured devices which are exactly the same: --<snip>-- Name | Device | Link | Mount Point | ----------------------------------------------------------------------------------------------------------- DVD DUAL GO-W040 | /dev/hdb | | | DVD DUAL GO-W040 | /dev/hdb | | | --<snip>-- I can add one or both of them and it will show link and Mount Point for each: link = /dev/cdrecorder Mount Point = /media/cdrecorder link = /dev/cdrecorder2 Mount Point = /media/cdrecorder2 And an entry for /dev/cdrecorder2 is added to /etc/fstab. But a DVD or CD is still not mounted when I insert it in the device. I also noticed that if I set up one of the entries in YaST and save it, both entries are still empty when I open the YaST CD-ROM tool again." "I installed SuSE 9.3 on the machine. Mounting CD's and DVD's works both as it should. You pop in a disk and after a while it pops up on the desktop. Then I upgraded to SUSE 10 and the problem is back. I disconnected the DVD drive from the system and boot up again. This time yast's cdrom tool shows one DVD device, but the system has none. So, somwhere a file or something has an extra entry. Does anybody know how YaST's CDROM tool determine what CD-ROMS are availble on the system? I am sure the problem is there. Any help would be appreciated, please. PS: dmesg and hwiinfo do not show the /dev/hdc (DVD-ROM) device after I disconnected it. PPS: I just checked my laptop and it also show two DVD devices, so this is a problem on SUSE 10. But my laptop do not have problems automounting a DVD disk. Any idea why the machine would only automount a CD and not a DVD?" As I have two cd drives I have 4 empty entries. I did a clean installation of Suse 10.0 In resume: - Automount of cd/dvd's in my system only works after running 'hwinfo --cd' because are missing files in /dev/ - Yast shows 4 empty entries for my Cd Drives. It should show 2 entries and they must be filled with the information of the mount point.
In this case it is a YaST or a udev problem and not a automount bug.
Yes, you are right, this seems to be a problem during the configuration of cd drives in the installation process. Is there any chance to solve it now?
Thomas and Arvin, please look at it.
From comment #9 to #12 (first word) I see the problem as follows: udev does not create the links right away. Somehow calling hwinfo triggers udev to generate them.
Sounds a bit like ide-cd isn't loaded automatically. After reboot, when it's not working, do you see "ide-cd" in the list, if you type /sbin/lsmod?
Created attachment 57676 [details] lsmod No I don't see "ide-cd" in the output of /sbin/lsmod. You can take a look at the log.
Ah ok. If you do: /sbin/modprobe ide-cd after reboot, does your device appear?
Yes, if I do it both devices appear and the configuration in yast is still wrong.
Reassigning to Yast. Who is responsible for loading ide-cd? Seems to work fine for almost all other users.
*** Bug 130186 has been marked as a duplicate of this bug. ***
I added MODULES_LOADED_ON_BOOT="ide-cd" to /etc/sysconfig/kernel and after reboot both devices work fine. The only problem still are the entries at Yast, but now works fine.
comment #21 Drivers are loaded by YaST based on hwinfo information. Comment #4 only shows "ide-cdrom" but not "ide-cd" as a required driver. So either hwinfo must be adapted in this case or ide-cdrom should require ide-cd as a module dependency.
There is no driver 'ide-cdrom'. It's 'ide-cd'. Steffen, looks you need to update hwinfo ...
Nothing to do with hwinfo. The module is ide-cd but the driver calls itself ide-cdrom. That's a general kernel problem that you can't find out the module name for a driver. Only very few have 'module' links in sysfs so far. BTW, the module naming hasn't changed since 2.6 is out and it worked fine in previous SL releases (and obviously in sl 10.0 for most people). In any case hwinfo reports that only _after_ the driver got loaded, so it apparently can't be the cause of ide-cd not loaded. IIRC device-type specific modules have never been loaded explicitly via MODULES_LOADED_ON_BOOT or even INITRD_MODULES. I suspect a hotplug/udev problem.
Christian, do you know, what is expected to load the ide-cd module at boot?
No, i have no clue.
Isn't it loaded the first time the device is accessed?
Can you test if putting: MODULES_LOADED_ON_BOOT="ide-cd" in: /etc/sysconfig/kernel
Yes, I did it as you can see in comment#23. I added MODULES_LOADED_ON_BOOT="ide-cd" to /etc/sysconfig/kernel and after reboot both devices work fine. The only problem still are the entries at Yast, but now works fine.
Great, that it works. Sorry, we have no idea why it works for almost everybody except the two reports we got. For SUSE10.1 all hardware initialization after bootup is completely replaced by a kernel driven solution, which is more straightforward and robust. Issues like this will hopefully be solved properly then. Thanks for testing.
Ok I will try the latest alpha. It's strange because with Suse 9.x my cd drives work fine.
We are still working on it. The base work is done, but for IDE devices we may need to adapt the module-loading script, or maybe we can fix the kernel to export the needed information in sysfs, which would be the best solution. But both versions, should work more reliably, compared to the old coldplug scripts or the initramfs event replay we did in older releases. It's a pretty tough problem to mange bootup and device initialization. We experimented a lot in the past and seems we now found a nice solution now with a udev/kernel event combination. This seems to become the default on all major distributions, which will hopefully shake out all these nasty things we got in the past.
I reported Bug 130186. For me, MODULES_LOADED_ON_BOOT="ide-cd" fixed the problem.
error is in udev.load_ide_modules.sh drivers are loaded correctly only for hda to hdf but not for eg. hdg, hdh etc. here is the full solution which works for me (replacing some in udev.load_ide_modules.sh): #!/bin/sh # # load-ide-modules.sh # # Load IDE modules corresponding to the setting in /proc/ide/.../media # PATH=/bin:/sbin:/usr/bin if [ -z "$DEVPATH" ]; then DEVPATH=$1 fi if [ -z "$DEVPATH" ]; then exit 1 fi path=${DEVPATH#*/ide?/} hostnum=${path%.?} drive=${path#?.} # difference - converting to ascii not to hex - in hex conversion all drivers after 'hdf' can't be loaded because they will be called hd10, hd11 and so on.. drive=$(printf "%s%2x" "\x" $(($drive + ($hostnum * 2) + 97)) ) drive=$(printf "%b" $drive ) #end proc="/proc/ide/ide$hostnum/hd$drive/media" if [ -r "$proc" ]; then module="ide-cd" read media < $proc if [ "$media" = "cdrom" ]; then module="ide-cd" else module="ide-$media" fi /sbin/modprobe $module else exit 1 fi
Thanks, the current /lib/udev/ide.sh looks like this, which is similar: #!/bin/sh -e # calculate device name from bus and drive number device=${DEVPATH#/devices/*/ide?/} drive=${device#?.} bus=${device%.?} unitnum=$((96 + 1 + $drive + $bus * 2)) name=$(printf "hd\\$(printf '%o' $unitnum)") procfile="/proc/ide/$name/media" # wait for /proc file to appear loop=30 while ! test -e $procfile; do sleep 0.1; test "$loop" -gt 0 || break loop=$(($loop - 1)) done read media < $procfile case "$media" in cdrom) /sbin/modprobe ide-cd ;; disk) /sbin/modprobe ide-disk ;; floppy) /sbin/modprobe ide-floppy ;; tape) /sbin/modprobe ide-tape ;; *) /sbin/modprobe ide-generic ;; esac
I have similar issues with 10.1 alpha 3. There is an entry for /dev/cdrom in /etc/fstab, but no /dev/cdr*. `lsmod` does show ide_cd (thats with an underscore not a dash). However when I insert a drive it gets mounted as /media/<LABEL OF DISK>. Entries show up in /etc/mtab, but `df -k` shows no cdrom mount. Further multiple attempts of `mount /media/cdrom` produce no errors and no changes except that another entry appears in /etc/mtab. `umount /media/cdrom` produces no errors and does remove one entry from /etc/mtab, and can be continued until there are no more associated entries in /etc/mtab at which point it does provide the expected 'not mounted' error. Trying `hwinfo --cd` did not create a /dev/cdrom.
For me, adding MODULES_LOADED_ON_BOOT="ide-cd" to /etc/sysconfig/kernel worked insofar as: 1. it automounted the DVD on system start and ls /media/dvdram listed its contents 2. when I inserted a CD into the CD-ROM drive it opened a "KDE Daemon - new medium detected, what to do?" as well as "SUSE Hardware detection" window but 1. when I ejected the DVD drive and reinserted the same disc, it had lost contact and I had to use sudo mount /dev/dvdram after which it works as before 2. I am unable to eject the CD-ROM drive. The weird thing is, I have installed SUSE 10 quite a few times on this system, but only on this install did this happen. My fstab entries are: /dev/dvdram /media/dvdram subfs fs=cdfss,ro,procuid,nosuid,nodev,exec,iocharset=utf8 0 0 /dev/cdrom /media/cdrom subfs fs=cdfss,ro,procuid,nosuid,nodev,exec,iocharset=utf8 0 0
Sorry for the spam, but I forgot to mention that the CD-R loaded into the CD-ROM drive as mentioned above is visible under system:/media/ and media:/ whereas the DVD-R loaded into the DVD-RAM drive is not.
*** Bug 145376 has been marked as a duplicate of this bug. ***
I've done some SLES 10 Beta 2 installs, and I've not seen this problem recur.
Btw: The IDE module loading logic for 10.1 is based on native kernel MODALIAS now, so this should not happen anymore in the future. Thanks, closing the bug.