Bug 133651 - ide-cd not loaded
Summary: ide-cd not loaded
Status: RESOLVED FIXED
: 130186 145376 (view as bug list)
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: Hotplug (show other bugs)
Version: Final
Hardware: i386 Other
: P5 - None : Normal
Target Milestone: ---
Assignee: Kay Sievers
QA Contact: Klaus Kämpf
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-14 10:42 UTC by Raúl Moratalla Guillén
Modified: 2006-02-08 19:17 UTC (History)
4 users (show)

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
/var/log/boot.msg (21.07 KB, text/plain)
2005-11-14 19:43 UTC, Raúl Moratalla Guillén
Details
/etc/fstab (2.39 KB, text/plain)
2005-11-14 19:43 UTC, Raúl Moratalla Guillén
Details
y2log (72.39 KB, text/plain)
2005-11-14 21:01 UTC, Raúl Moratalla Guillén
Details
lshal (96.52 KB, text/plain)
2005-11-15 07:35 UTC, Raúl Moratalla Guillén
Details
lsmod (3.70 KB, text/plain)
2005-11-17 18:27 UTC, Raúl Moratalla Guillén
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Raúl Moratalla Guillén 2005-11-14 10:42:40 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)
Comment 1 Michael Gross 2005-11-14 15:31:09 UTC
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.
Comment 2 Raúl Moratalla Guillén 2005-11-14 19:43:12 UTC
Created attachment 57298 [details]
/var/log/boot.msg
Comment 3 Raúl Moratalla Guillén 2005-11-14 19:43:51 UTC
Created attachment 57299 [details]
/etc/fstab
Comment 4 Raúl Moratalla Guillén 2005-11-14 19:49:50 UTC
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?
Comment 5 Michael Gross 2005-11-14 20:03:33 UTC
The YaST logfile is still missing, please attach it.
Comment 6 Raúl Moratalla Guillén 2005-11-14 21:01:38 UTC
Created attachment 57306 [details]
y2log

This is the log generated by Yast when I enter in Cd drives. I wish this can help.
Comment 7 Danny Al-Gaaf 2005-11-14 23:15:52 UTC
Forget this logs! Could you attach output of lshal with not mounted DVD in the device?
Comment 8 Raúl Moratalla Guillén 2005-11-15 07:35:41 UTC
Created attachment 57334 [details]
lshal

This is the output of lshal with no mounted dvd
Comment 9 Danny Al-Gaaf 2005-11-15 09:40:44 UTC
Is there a /dev/cdrom ?
Comment 10 Raúl Moratalla Guillén 2005-11-15 13:01:43 UTC
No there isn't. If I run 'hwinfo --cd' these files are created: /dev/cdrom and /dev/cdrecorder.
Comment 11 Danny Al-Gaaf 2005-11-15 15:07:54 UTC
and if you now insert a CD/DVD? are they mounted automatically?
Comment 12 Raúl Moratalla Guillén 2005-11-15 15:48:22 UTC
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.
Comment 13 Danny Al-Gaaf 2005-11-15 16:16:59 UTC
In this case it is a YaST or a udev problem and not a automount bug.
Comment 14 Raúl Moratalla Guillén 2005-11-15 16:34:26 UTC
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?
Comment 15 Ladislav Slezák 2005-11-16 08:45:07 UTC
Thomas and Arvin, please look at it.
Comment 16 Arvin Schnell 2005-11-17 10:29:38 UTC
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.
Comment 17 Kay Sievers 2005-11-17 14:26:15 UTC
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?
Comment 18 Raúl Moratalla Guillén 2005-11-17 18:27:50 UTC
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.
Comment 19 Kay Sievers 2005-11-17 18:35:55 UTC
Ah ok. If you do:
  /sbin/modprobe ide-cd
after reboot, does your device appear?
Comment 20 Raúl Moratalla Guillén 2005-11-17 19:34:09 UTC
Yes, if I do it both devices appear and the configuration in yast is still wrong.
Comment 21 Kay Sievers 2005-11-17 19:52:56 UTC
Reassigning to Yast.
Who is responsible for loading ide-cd?
Seems to work fine for almost all other users.
Comment 22 Kay Sievers 2005-11-17 20:28:55 UTC
*** Bug 130186 has been marked as a duplicate of this bug. ***
Comment 23 Raúl Moratalla Guillén 2005-11-17 21:19:03 UTC
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 24 Klaus Kämpf 2005-11-18 09:14:30 UTC
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.
Comment 25 Hannes Reinecke 2005-11-18 09:18:27 UTC
There is no driver 'ide-cdrom'. It's 'ide-cd'.
Steffen, looks you need to update hwinfo ...
Comment 26 Steffen Winterfeldt 2005-11-18 10:05:03 UTC
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.
Comment 27 Kay Sievers 2005-11-18 13:56:11 UTC
Christian, do you know, what is expected to load the ide-cd module at boot?
Comment 28 Christian Zoz 2005-11-18 15:24:57 UTC
No, i have no clue.
Comment 29 Steffen Winterfeldt 2005-11-18 15:36:27 UTC
Isn't it loaded the first time the device is accessed?
Comment 30 Kay Sievers 2005-11-18 15:44:13 UTC
Can you test if putting:
  MODULES_LOADED_ON_BOOT="ide-cd"
in:
  /etc/sysconfig/kernel
Comment 31 Raúl Moratalla Guillén 2005-11-18 18:51:55 UTC
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.
Comment 32 Kay Sievers 2005-11-18 19:47:56 UTC
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.
Comment 33 Raúl Moratalla Guillén 2005-11-18 20:15:55 UTC
Ok I will try the latest alpha. It's strange because with Suse 9.x my cd drives work fine.
Comment 34 Kay Sievers 2005-11-18 20:29:45 UTC
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.
Comment 35 Ulrich Derenthal 2005-11-19 17:30:08 UTC
I reported Bug 130186.

For me, MODULES_LOADED_ON_BOOT="ide-cd" fixed the problem.
Comment 36 mark kiddy 2005-12-01 13:31:32 UTC
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

Comment 37 Kay Sievers 2005-12-01 14:07:27 UTC
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
Comment 38 John Andrea 2005-12-01 16:51:40 UTC
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.
Comment 39 Forgotten User bwNirt9brK 2005-12-04 09:10:56 UTC
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
Comment 40 Forgotten User bwNirt9brK 2005-12-04 09:14:53 UTC
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.
Comment 41 Andreas Gruenbacher 2006-01-26 18:48:36 UTC
*** Bug 145376 has been marked as a duplicate of this bug. ***
Comment 42 Jason Mack 2006-01-31 18:19:05 UTC
I've done some SLES 10 Beta 2 installs, and I've not seen this problem recur.
Comment 43 Kay Sievers 2006-02-08 19:17:31 UTC
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.