PDA

View Full Version : cdrom & 2.6 kernel



CrashedAgain
09-24-2004, 03:36 PM
I can access cdroms & audio cd's when using the 2.4 kernel but not with the 2.6 kernel. Knoppix 3.4 HD installed, it's not a system problem, it happens on both my desktop & my laptop.
Clicking on the cd icon gives /dev/cdrom does not exist error (meaning autofs has not mounted the cd & created /mnt/auto/cdrom). Attempting to mount manually mount /dev/cdrom gives 'dev/cdrom does not exist' error.
Any ideas? Anyone else having this problem?

kuser123
09-24-2004, 07:50 PM
I had the same problem. It seems to be a not cleanly solved issue on the Knoppix distribution. The developers seem to assume when you boot with a certain kernel you will always use this kernel.
The problem is:
With kernel 2.4.x cdrom devices use an SCSI-emulation layer for writing CDs. They are mapped as /dev/scd0, /dev/scd1, etc. With the newer kernel 2.6.x this emulation layer is not necessary any more. So IDE cdrom devices are accessed through /dev/hda, /dev/hdb, etc. So when you have the necessity to boot sometimes 2.4.x and sometimes 2.6.x, then you should install my boot script solution. When you want to use only 2.6.x in future you should just change the symbolic links in /dev.

First the manual way (only boot 2.6.x in future):
Got to /dev and change all links which point to an scd-device (dvd, cdrom, etc.) to point to an hdx-device. It may be that some (KDE-)programs have also saved some links to scd-devices in their configuration.

Now the automated way:
Save the following script in /etc/init.d to the file update-dvd-links and make it executable. Then create a symbolic link in /etc/rcS.d with "ln -s ../init.d/update-dvd-links S30update-dvd-links". The script asks for the major kernel version at boot time and updates the links at every boot sequence.
IMPORTANT: Change this script for YOUR needs! Otherwise your cdrom devices will NOT work!

#!/bin/sh

rm /dev/NEC_dvd
rm /dev/LITEON_dvd
rm /dev/dvd
KERNVER=$(uname -r)
if [ "${KERNVER:0:3}" == "2.4" ]; then
ln -s /dev/scd0 /dev/NEC_dvd
ln -s /dev/scd1 /dev/LITEON_dvd
ln -s /dev/scd1 /dev/dvd
else
ln -s /dev/hda /dev/NEC_dvd
ln -s /dev/hdb /dev/LITEON_dvd
ln -s /dev/hdb /dev/dvd
fi
chgrp cdrom /dev/hda
chgrp cdrom /dev/hdb

rrfish72
09-24-2004, 10:51 PM
This is how I fixed mine:

ln -sf /dev/scd0 /dev/cdrom

ln -sf /dev/scd1 /dev/cdaudio

or whatever the corresponding scd# is.

Deleted the icons and made new ones.

Can check to see if it works with a data cd in. Will not mount an audio cd. Must open audio cd with a player.

shah
09-25-2004, 04:31 AM
I think the problem is auto fstab with knoppix-autoconfig. I would append nofstab to lilo or grub if I had the problem, and edit my fstab.
For the autofs to work, I will check /etc/automaster,automisc and automnt.
In /etc/rc5.d, I will check for existence of autofs script.

:D :D

CrashedAgain
10-01-2004, 05:26 AM
Update:
Did a bunch of research on this, it appears the 2.6 kernel cdrom acces may not be properly implemented in Knoppix. With the 2.6 kernel, cdrom drive connected to the ide are supposed to be set up the same as HDD's, ie my cdrom should be /dev/hdb or /dev/hdc or similar. However, it is still being detected as /dev/scd0, same as with the 2.4 kernel but the link /dev/cdrom was not being created with the 2.6 kernel.

No matter, I tried the suggestions above, couldn't implement kdeuser123's scripts as I couldn't figure out what my equivalent for /dev/NEC_dvd et al would be.
'ln -s /dev/scd0 /cdrom' worked but then automounter wouldn't go.
'ln -s /dev/scd0 /dev/cdrom' (which duplicated the 2.4 kernel setup) worked OK, even the desktop icon worked but the link /dev/cdrom would be erased with each boot. I had to modify /etc/init.d/knoppix-autoconfig to get it to stay permanent. (I am using knoppix style HDinstall which autodetects each boot as I want to remaster from it).

So, for reference for others:

1) If /dev/cdrom does not exist, create it with 'ln -s /dev/scd0 /dev/dcrom'
2) Remove '/dev/cdrom' from the following line in /etc/init.d/knoppix-autoconfig so that it doesn't get erased. This is about line 500:



# Delete obsolete links and files before starting autoconfig
if ! checkbootparam "nohwsetup"; then
rm -f /dev/cdrom* /dev/cdwriter* /dev/mouse* /dev/modem* /dev/scanner* \
/etc/sysconfig/i18n /etc/sysconfig/keyboard /etc/sysconfig/knoppix \
2>/dev/null
fi


Hope this helps somebody else.

CrashedAgain
10-16-2004, 05:57 PM
Just an update in case anyone else is having this problem...I think it has been fixed with Knoppix 3.6 & up.

This solution above work but will end up creating an additional /dev/cdrom each time it boots until there is a big collection of them.

So: Leave /dev/cdrom in the list of old links to remove but re-create it again right away with 'ln -sf /dev/scd0 /dev/cdrom'.



# Delete obsolete links and files before starting autoconfig
if ! checkbootparam "nohwsetup"; then
rm -f /dev/cdrom* /dev/cdwriter* /dev/mouse* /dev/modem* /dev/scanner* \
/etc/sysconfig/i18n /etc/sysconfig/keyboard /etc/sysconfig/knoppix \
2>/dev/null
ln -sf /dev/scd0 /dev/cdrom
fi