# cdrom and cdrw problems - fixed

## grj

I had a cdrom working on my system. Then I decided to add a cdrw. The cdrom is the master on the 2nd ide and the cdrw is the slave on the 2nd ide. I compiled the following into the kernel:

Under ATA/IDE drive section

    scsi emulation

    ide cdrom support - removed

Under SCSI Support

    scsi support

    scsi cdrom support

    scsi generic support

    scsi probe all luns for each scsi device

Then to /boot/grub/menu.lst I modified the kernel line by adding

    hdd=ide-scsi to the end of the line

cdrecord -scanbus finds the cdrw only however I cannot mount it.

Is there anything else that I need to do to get both drives working?

How do I mount them?

Thanks,

----------

## pjp

 *grj wrote:*   

> How do I mount them?

 You aren't able to mount either of the two drives?  What is the error, and how are they configured in /etc/fstab?

----------

## sa

how bout..

scsi emulation

ide cdrom support - _not_ removed

Under SCSI Support

scsi support

scsi cdrom support

scsi generic support

your cd should be 

/dev/cdroms/cdrom0

your burner should show up as 

/dev/cdroms/cdrom1

which are really just symlinks to the actual devices.

your grub stuff is good.

in your /etc/fstab put:

```

/dev/cdroms/cdrom0  /mnt/cdrom  iso9660 noauto,ro,user      0 0

/dev/cdroms/cdrom1  /mnt/cdrom1 iso9660 noauto,ro,user      0 0

```

make sure you mkdir /mnt/cdrom1 && mkdir /mnt/cdrom

then you can issue `mount /mnt/cdrom` `mount /mnt/cdrom1` and umount to unmount them.

let us know how it works,

sa

----------

## grj

Here are my specs:

Grub:

default 0

timeout 8

splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title=Gentoo Linux

root (hd0,0)

kernel /boot/bzImage root=/dev/hda3 append="hdc=ide-scsi hdd=ide-sci"

Kernel

Under ATA/IDE drive section

scsi emulation

ide cdrom support

Under SCSI Support

scsi support

scsi cdrom support

scsi generic support 

fstab

/dev/hda1		/boot		ext2		noauto,noatime	1 2

/dev/hda3		/		xfs		noatime		0 1

/dev/hda2		none		swap		sw			0 0

/dev/cdroms/cdrom0	/mnt/cdrom	iso9660	noauto,ro		0 0

/dev/cdroms/cdrom1	/mnt/cdrw	iso9660	noauto,ro		0 0

#/dev/fd0		/mnt/floppy	ext2		noatime		0 1

proc			/proc		proc		defaults		0 0

before I compiled ide cdrom support back in I could mount the cdrom as root even though I set the group to be users and my regular user account is a member of this group. now when i do cdrecord -scanbus i get this message: cannot open /dev/pg* cannot open scsi driver. Also I never did see /dev/cdroms/cdrom1.

Any thougts on this? I may just take out the cdrom to see if that helps.

Thanks,

----------

## grj

I can now mount both cd drives as root. I have the group for drive set to audio and my regular user is a member of that group. Any thought on how to fix this? When I get this problem solved I will write what I did to solve all of my issues.

Thanks,

----------

## pjp

Try adding the users to the cdrom and cdrw groups.

----------

## grj

I added my user to the cdrom and cdrw groups which did not help. Then I changed the group for the cdrom to cdrom and cdrw to cdrw with no luck. Is it ok for the owner to be something other than root for /mnt/cdrom and /mnt/cdrw? As always any advice is greatly appreciated.

Thanks,

----------

## sa

if you want users to be able to mount cdroms put something like this in your cdrom options in /etc/fstab: noauto,ro,user

----------

## grj

Thanks for all the help. I finally have it working. If I get time I may write up what I did to get it all going so it will be in 1 place for others.

Thanks,

----------

## pjp

 *grj wrote:*   

> If I get time I may write up what I did to get it all going so it will be in 1 place for others.

 Glad you got it working.  Would be great if you could find the time.

----------

## grj

This is a How-to for getting a cdrw to work under Gentoo linux. 

It is written by a newbie so some information may be slightly inaccurate.

Any necessary edits are welcomed.

The author takes no responsibility for any damage to any thing in anyway (How is that for legal jargon).

I have 2 CD Drives in my machine a CDROM drive Make LG, Model CRD8400B and a CDRW Make HP Model 8200+. 

Below are the things I did to get them working with a regular user account.

It is assumed you have successfully installed the CDRW into the machine (See the gotchas section at the bottom).

Kernel Configuration:

Under ATA/IDE/MFM/RLL support ---> IDE, ATA and ATAPI Block Devices --->

Compile into the kernel the following modules:

SCSI emulation support

Remove modules:

IDE/ATAPI CDROM support -- note: Some people have been able to leave this module in. I was unable to do so.

Under SCSI support --->

Compile into the kernel the following modules:

SCSI support

SCSI CD-ROM support

SCSI generic support

Build the new kernel and copy it to /boot (see the Gentoo installation guide for help with this).

Grub Configuration:

mount /boot

edit /boot/grub/menu.lst -- note: that is the letter l(ell) not the number one in menu.lst

Change the following line:

kernel /boot/bzImage root=/dev/hda3

to

kernel /boot/bzImage root=/dev/hda3 append="hdc=ide-scsi hdd=ide-scsi"

Notes on the above change:

You may have additional kernel parameters. Kernel parameters are the information after bzImage in the above lines.

Your value for the root parameter may be different. It depends on your installation (see the Gentoo installation guide for help with this).

The same applies for the append parameter we need to add for this How-to. 

The hdc and hdd are the values for my cd drives (see the Gentoo installation guide for help with this).

Save the changes.

fstab Configuration:

edit /etc/fstab

Add a line or modify the existing line for the CDROM as below

/dev/cdroms/cdrom0	/mnt/cdrom	iso9660		noauto,ro,user		0 0

Add a line for the CDRW as below

/dev/cdroms/cdrom1	/mnt/cdrw	iso9660		noauto,ro,user		0 0

Notes on the above changes:

If you already had a cd drive in your machine the /mnt/cdrom value may be different. The original value is fine.

If you change the original value to /mnt/cdrom you will have to make the new directory using mkdir /mnt/cdrom.

You will also have to make the new directory for the cdrw using mdir /mnt/cdrw.

Some gotchas I was plagued by:

If you are installing the cdrw as the second drive on a controller make certain the first drives 

jumpers are set to master and the cdrw is set to slave. My first drive was set to cable select. 

The computer would recognize it sometimes but not all the time. So if you notice the cdrw detection 

for the bios is acting funny check this.

If you had a pre-existing line in fstab for another cd drive make certain it is correct. 

Somehow mine was changed without my knowledge of it. It took me 2 days to figure out how to get a regular 

user permission to use the cd drives due to this (even though helpful people tried to show the error to me I assumed 

it was ok because it worked before).

----------

## pjp

Thanks for the update.

----------

## dioxmat

 *grj wrote:*   

> 
> 
> kernel /boot/bzImage root=/dev/hda3 append="hdc=scsi-ide hdd=scsi-ide"
> 
> 

 

you meant ide-scsi right ?

----------

## zeroseen

dont forget to chown your mounting directorys to your user

----------

## grj

To the best of my knowledge I did not chown any directories. I did an

ls -l /mnt and everything is owned by root. Is this what you are talking about or am I confused a usual?

Thanks,

----------

## thorne

 *grj wrote:*   

> This is a How-to for getting a cdrw to work under Gentoo linux. 
> 
> It is written by a newbie so some information may be slightly inaccurate.
> 
> Any necessary edits are welcomed.
> ...

 

What does your /etc/devfsd.conf look like?

----------

## grj

 *thorne wrote:*   

> What does your /etc/devfsd.conf look like?

 

# Sample /etc/devfsd.conf configuration file.

# Richard Gooch  <rgooch@atnf.csiro.au>		3-JUL-2000

#

# The Gentoo Linux Team - http://www.gentoo.org/

#     - Many fixes, etc

#

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/devfsd.conf,v 1.10 2002/09/07 21:52:35 azarah Exp $

# Enable full compatibility mode for old device names. You may comment these

# out if you don't use the old device names. Make sure you know what you're

# doing!

REGISTER        .*           MKOLDCOMPAT

UNREGISTER      .*           RMOLDCOMPAT

# You may comment out the above and uncomment the following if you've

# configured your system to use the original "new" devfs names or the really

# new names

#REGISTER       vc/.*        MKOLDCOMPAT

#UNREGISTER     vc/.*        RMOLDCOMPAT

#REGISTER       pty/.*       MKOLDCOMPAT

#UNREGISTER     pty/.*       RMOLDCOMPAT

#REGISTER       misc         MKOLDCOMPAT

#UNREGISTER     misc         RMOLDCOMPAT

# You may comment these out if you don't use the original "new" names

REGISTER        .*           MKNEWCOMPAT

UNREGISTER      .*           RMNEWCOMPAT

# Enable module autoloading. You may comment this out if you don't use

# autoloading

LOOKUP          .*           MODLOAD

# Uncomment the following if you want to set the group to "tty" for the

# pseudo-tty devices. This is necessary so that mesg(1) can later be used to

# enable/disable talk requests and wall(1) messages.

REGISTER        ^pty/s.*     PERMISSIONS -1.tty  0600

REGISTER        ^pts/.*      PERMISSIONS -1.tty  0600

# Uncomment this if you want permissions to be saved and restored

# NB: Do NOT change the following!

# Do not do this for pseudo-terminal devices

REGISTER        ^pt[sy]/.*   IGNORE

CHANGE          ^pt[sy]/.*   IGNORE

CREATE          ^pt[sy]/.*   IGNORE

DELETE          ^pt[sy]      IGNORE

REGISTER        .*           COPY    /lib/dev-state/$devname $devpath

CHANGE          .*           COPY    $devpath /lib/dev-state/$devname

CREATE          .*           COPY    $devpath /lib/dev-state/$devname

DELETE          .*           CFUNCTION GLOBAL unlink /lib/dev-state/$devname

RESTORE         /lib/dev-state

# You can force default like this :

# PERMISSIONS owner_and_group access_mode

# Video4Linux devices

REGISTER       v4l/.*       PERMISSIONS root.video 660

# ALSA/OSS stuff

# Comment/change these if you want to change the permissions on

# the audio devices

LOOKUP          snd          MODLOAD ACTION snd

LOOKUP          dsp          MODLOAD

LOOKUP          mixer        MODLOAD

LOOKUP          midi         MODLOAD

REGISTER        sound/.*     PERMISSIONS root.audio 660

REGISTER        snd/.*       PERMISSIONS root.audio 660

# Uncomment this to let PAM manage devfs

#REGISTER        .*           CFUNCTION /lib/security/pam_console_apply_devfsd.so pam_console_apply_single $devpath

# Give the cdrw group write permissions to /dev/sg0

# This is done to have non root user use the burner (scan the scsi bus)

#REGISTER        ^sg0$       PERMISSIONS root.cdrw 660

# General note for the following auto creation of symlinks:

#

#    If you change the device that the symlink points to,

#    you should also remove the symlink before restarting

#    devfsd

# Create /dev/cdrom for the first cdrom drive

LOOKUP          ^cdrom$          CFUNCTION GLOBAL mksymlink cdroms/cdrom0 cdrom

REGISTER        ^cdrom/cdrom0$   CFUNCTION GLOBAL mksymlink $devname cdrom

UNREGISTER      ^cdrom/cdrom0$   CFUNCTION GLOBAL unlink cdrom

# Create /dev/dvd for the second cdrom drive

# (change 'cdroms/cdrom1' to suite your setup)

# NOTE: We add the fully qualified path here, else some apps

#       have problems to resolve the true device (drip comes to mind)

#LOOKUP          ^dvd$           CFUNCTION GLOBAL mksymlink ${mntpnt}/cdroms/cdrom1 dvd

#REGISTER        ^cdrom/cdrom1$  CFUNCTION GLOBAL mksymlink ${devpath} dvd

#UNREGISTER      ^cdrom/cdrom1$  CFUNCTION GLOBAL unlink dvd

# Create /dev/cdrw for the first cdrom on the scsi bus

# (change 'sr0' to suite your setup)

#LOOKUP          ^cdrw$          CFUNCTION GLOBAL mksymlink sr0 cdrw

#REGISTER        ^sr0$           CFUNCTION GLOBAL mksymlink $devname cdrw

#UNREGISTER      ^sr0$           CFUNCTION GLOBAL unlink cdrw

# Create /dev/mouse

LOOKUP          ^mouse$          CFUNCTION GLOBAL mksymlink misc/psaux mouse

REGISTER        ^misc/psaux$     CFUNCTION GLOBAL mksymlink $devname mouse

UNREGISTER      ^misc/psaux$     CFUNCTION GLOBAL unlink mouse

# Manage USB mouse

REGISTER        ^input/mouse0$   CFUNCTION GLOBAL mksymlink $devname usbmouse

UNREGISTER      ^input/mouse0$   CFUNCTION GLOBAL unlink usbmouse

REGISTER        ^input/mice$     CFUNCTION GLOBAL mksymlink $devname usbmouse

UNREGISTER      ^input/mice$     CFUNCTION GLOBAL unlink usbmouse

# devfsd.conf ends here

----------

## carlivar

 *grj wrote:*   

> 
> 
> Grub Configuration:
> 
> Change the following line:
> ...

 

I don't think this is right.  I think lilo uses the "append" format for kernel options, but grub does not.  Take out the "append=" and the quotes.

Carl

----------

## miffo.swe

I had the exact same problem as you had. I had to remove ide cdrom support from the kernel to get it to work. I know that it works if you makes them modules but i dont know why it dont work in the kernel. It may have something to do with one of them must be loaded before the other.

It works now and im happy!  :Very Happy: 

----------

## gzaector

this was a great howto, i have one question though

i do not want to use /dev/cdroms/cdrom0 and /dev/cdroms/cdrom1, what would i use, i will have scsi emulation on both cdroms,  i assume it would be /dev/hdc and /dev/hdd. but i dont know if that is right or not, is it?

thanks, and sorry for bringing back an old topic

-gz

----------

