# request for working cdrw config files/command outputs

## carboxylman

I've been having strange problems with my ide cd burner.  I've searched the forums and tried many different peoples' advice, and permutations of options.  It doesn't work.

SO, can those who have gotten their ide burners working do the following:

1. post the relevant portions of your /etc/devfsd.conf

2. post the output of 'cdrecord -scanbus'

3. post the output of 'lsmod'

4. whatever I missed

Thanks very much to all those who post.  This seems to be a common question, and maybe others can benefit from seeing a full working configuration.

david

----------

## carboxylman

Well, as soon as I posted, I played with insmod some more, and somehow got it working.

Let me finalize my settings, and I'll post in some detail how I got this to work.[/i]

----------

## rommel

try recompiling your kernel with scsi emulation scsi cdrom and hard disk and general scsi support all compiled into the kernel...not as modules...as for devfs all i did was uncomment the section that pertained to cdrw and added /dev/sr0  /mnt/cdrw  iso9660 noauto,user,exec,async 0 0 to fstab.....of corse you must create the /cdrw in the /mnt directory....add hdx=scsi to the kernel line in grub....i have done this four times on 4 different machines this week...it works everytime...so i hardly thinkits mysterious...not if i can do it..lol

----------

## carboxylman

Well, what I did first was recompile the kernel with the following:

ATA/IDE/MFM/RLL support    Y

ATA/IDE/ATAPI Block Devices (submenu)

       -> IDE/ATAPI CDROM support     M

       -> SCSI Emulation Support     M

SCSI support     M

SCSI disk support    M

SCSI CD-ROM support     M

SCSI generic support     M

Hopefully I didn't miss any.

Then I edited the relevant parts of /etc/devfsd.conf:

#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

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

# (change 'sr0' to suite your setup)

LOOKUP          ^cdrw$          CFUNCTION GLOBAL mksymlink sg0 cdrw

REGISTER        ^sg0$           CFUNCTION GLOBAL mksymlink $devname cdrw

UNREGISTER      ^sg0$           CFUNCTION GLOBAL unlink cdrw

Then I added my user to the cdrw group in /etc/group.

Reboot.

Then I had to do some weird stuff:

> rmmod ide-scsi

> rmmod sg

> insmod sg

> insmod ide-scsi

But then cdrecord -scanbus worked, and so did gtoaster.

Hope this helps somebody.

david

----------

## fghellar

Very well done, carboxylman!! You solved your problem and came back to share the info with others! This is an example to follow!   :Wink: 

----------

## Mr. Pointy

I was working on the same thing today.  I was trying to get my links to appear as I thought they should.  I didn't have a cdrw link until I did a: killall -HUP devfsd.  Also, the permissions for the cdrw were root only(root and cdrw, but i was a bit slow to catch on).  I also have  a dvd drive.

What worked, from devfsd.conf:

```

# 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        ^cdrw$       PERMISSIONS root.users 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/cdrom1 cdrom

REGISTER    ^cdroms/cdrom1$   CFUNCTION GLOBAL mksymlink $devname cdrom

UNREGISTER  ^cdroms/cdrom1$   CFUNCTION GLOBAL unlink cdrom

# Create /dev/dvd for the second cdrom drive

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

LOOKUP      ^dvd$           CFUNCTION GLOBAL mksymlink cdroms/cdrom0 dvd

REGISTER    ^cdroms/cdrom0$  CFUNCTION GLOBAL mksymlink $devname dvd

UNREGISTER  ^cdroms/cdrom0$  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

```

I still had to build the various scsi modules into the kernel to get the cdrw link.  When they were modules I could load them and a second cdrom would appear in /dev/cdroms (which still worked for burning) but no cdrw link.

     Strangely, I had to change the lines ^cdrom/cdrom0$ and ^cdrom/cdrom1$.  I had to add an s (^cdroms/cdrom... ).

     Also, carboxylman, It looks like you chose sg0 over sr0.  I just noticed I have both.  Are they the same?

     Finally, I was wondering if instead of using the cdrw group, just giving group users permissiong to the cdrw, as I have, is a bad idea.

Now the links cdrw and cdrom point to the cdrw.  I can burn and play VCDs as a normal user.  The link dvd points to the dvd (just checked, i can't play dvd as a normal user. oops) Otherwise everything works.

Added:

```
# 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        ^cdrw$       PERMISSIONS root.users 660

REGISTER        ^dvd$       PERMISSIONS root.users 660
```

Hopefully that's ok too.  DVD now works as normal user

ok, i changed it again.  I couldn't really burn as a normal user.  now it works I ,uh, think.Last edited by Mr. Pointy on Sat Jul 06, 2002 8:06 am; edited 1 time in total

----------

## carboxylman

Mr. Pointy:

You had to change /dev/cdrom/cdrom0 to /dev/cdroms/cdrom0 because that seems to be how gentoo (or devfs, not sure) sets up the cdrom devices.

sg0 is the first generic scsi device, and sr0 is the first scsi cdrom.

I tried sg0 in /etc/devfsd.conf because cdrecord/gtoaster were complaining about not being able to find /dev/sg0; they didn't mention /dev/sr0.

Thanks for posting.

david

----------

## rommel

i uncommented the dvd section and changed it to point to cdrom0 so taht the dvd acts as the cdrom and the dvd

# 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)

LOOKUP          ^dvd$           CFUNCTION GLOBAL mksymlink cdroms/cdrom0 dvd

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

UNREGISTER      ^cdrom/cdrom0$  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

and i just uncommented adn did what i posted above to get the cdrw to work....i use kde in gentoo and xcdroast as the gui for burning....it has an option now to setup non root automatically

----------

## thorne

Here's what I have that currently works (burning a cd as I type this.)  Thanks to rac for helping me get this up and running (see the rest of the thread.)

Kernel:

```
ATA/IDE/MFM/RLL support Y

ATA/IDE/ATAPI Block Devices (submenu)

-> IDE/ATAPI CDROM support <N>  (that's NO)

-> SCSI Emulation Support <*>

SCSI support <*>

SCSI disk support <*>

SCSI CD-ROM support <*>

SCSI generic support <*>
```

file: menu.lst

```
default 0

timeout 30

splashimage=(hd2,0)/boot/grub/spash.xpm.gz

title=GenToo

root(hd2,0)

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

title=Windows XP Professional

root=(hd0,0)

chainloader +1

```

file: /etc/devfsd.conf

```
# Create /dev/cdrom for the first cdrom drive

# NOTE: Uncommented so DVD Drive will also function as regular CD-ROM

LOOKUP          ^cdrom$          CFUNCTION GLOBAL mksymlink cdroms/cdrom1 cdrom

REGISTER        ^cdroms/cdrom1$   CFUNCTION GLOBAL mksymlink $devname cdrom

UNREGISTER      ^cdroms/cdrom1$   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        ^cdroms/cdrom1$  CFUNCTION GLOBAL mksymlink ${devpath} dvd

UNREGISTER      ^cdroms/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

```

file: /etc/fstab

```

/dev/hdf1       /boot           ext2            noauto,noatime          1 1

/dev/hdf3       /               xfs             noatime                 0 0

/dev/hdf2       none            swap            sw                      0 0

/dev/hdf4       /mnt/storage    vfat            noatime,umask=0         0 0

# NOTE: I have no reference to the DVD/CDRW in fstab

proc            /proc           proc            defaults                0 0

```

dmesg | grep hdc finds:

```

Kernel command line: root=/dev/hdf3 append="hdc=ide-scsi hdd=ide-scsi"

    ide1: BM-DMA at 0xd808-0xd80f, BIOS settings: hdc:DMA, hdd:DMA

hdc: QPS CRD-BP1700P, ATAPI CD/DVD-ROM drive

hdc: ATAPI 40X CD-ROM CD-R/RW drive, 4096kB Cache, UDMA(33)

```

dmesg | grep hdd finds:

```
Kernel command line: root=/dev/hdf3 append="hdc=ide-scsi hdd=ide-scsi"

    ide1: BM-DMA at 0xd808-0xd80f, BIOS settings: hdc:DMA, hdd:DMA

hdd: Pioneer DVD-ROM ATAPIModel DVD-113 0108, ATAPI CD/DVD-ROM drive

hdd: ATAPI DVD-ROM drive, 512kB Cache, UDMA(33)

```

Thanks for any advice, comments, suggestion.

~thorne

----------

## rac

Does turning off ATAPI CD support improve matters?

----------

## thorne

I have not tried that yet.  I was under the impression that I needed that in order for my ATAPI DVD drive to work.  <edit>I will try recompiling without the support now.  Will let you know in 20 minutes or so if it makes a difference.</edit>

----------

## rac

 *thorne wrote:*   

> I have not tried that yet.  I was under the impression that I needed that in order for my ATAPI DVD drive to work.  Am I wrong?

 

I can't say for sure, because I don't have one, but I have heard lots of reports that having IDE CD support compiled in can conflict with SCSI emulation.  cdrom and cdrw problems is one such thread that comes up in a search for "ide and scsi and emulation".  Could you give it a try?  Maybe there's a way to access your DVD via the SCSI emulation interface as well.

----------

## thorne

OK, removed ATAPI CD/DVD from the kernel, and still not working. =(

No more weird errors though...  I also added hdd=ide-scsi in hopes that maybe the dvd drive will work.

```
dmesg | grep hdc

Kernel command line: root=/dev/hdf3 append="hdc=ide-scsi hdd=ide-scsi"

    ide1: BM-DMA at 0xd808-0xd80f, BIOS settings: hdc:DMA, hdd:DMA

hdc: QPS CRD-BP1700P, ATAPI CD/DVD-ROM drive

hdc: ATAPI 40X CD-ROM CD-R/RW drive, 4096kB Cache, UDMA(33)

dmesg | grep hdd

Kernel command line: root=/dev/hdf3 append="hdc=ide-scsi hdd=ide-scsi"

    ide1: BM-DMA at 0xd808-0xd80f, BIOS settings: hdc:DMA, hdd:DMA

hdd: Pioneer DVD-ROM ATAPIModel DVD-113 0108, ATAPI CD/DVD-ROM drive

hdd: ATAPI DVD-ROM drive, 512kB Cache, UDMA(33)

```

cdrecord -scanbus:

```
cdrecord -scanbus

Cdrecord 1.11a30 (i686-pc-linux-gnu) Copyright (C) 1995-2002 Jörg Schilling

cdrecord: No such file or directory. Cannot open '/dev/pg*'. Cannot open SCSI driver.

cdrecord: For possible targets try 'cdrecord -scanbus'. Make sure you are root.
```

Yes, ran as su.

<edit> Note that although I removed support for ATAPI CD/DVD drives in the kernel, I am still able to watch DVDs. </edit>

----------

## rac

Rats.  Do you have a "hdd=ide-scsi" line in your kernel command line?

----------

## thorne

<edit> I edited my original post in this thread to reflect my current setup.  See above.</edit>

The prior attempt involved having ATAPI CD/DVD support compiled into the kernel.  Also, my fstab file pointed /dev/sr0 to /mnt/cdrw, instead of /dev/cdroms/cdrom0 to /mnt/cdrw.

----------

## rac

```
$ ls -l /dev/sg*
```

 :Question: 

----------

## thorne

```
ls -l /dev/sg*

ls: /dev/sg*: No such file or directory
```

 :Sad: 

----------

## rac

 *thorne wrote:*   

> 
> 
> ```
> ls -l /dev/sg*
> 
> ...

 

Not really  :Sad: , because I would be  :Crying or Very sad:  if they did exist.  I'm assuming you draw a blank with 

```
$ find /dev/scsi/ -name 'generic'
```

...also?  I know you said you enabled SCSI generic support in the kernel, but is it possible that it somehow didn't take?

----------

## thorne

```
find /dev/scsi -name 'generic'
```

 returned nothing.

I also checked again, and generic scsi support is <*>'d.  How can I make sure it "took?"

----------

## rac

 *thorne wrote:*   

> How can I make sure it "took?"

 

Almost ashamed to bring it up, but failing to mount /boot when copying the kernel over, that sort of thing.  Can you try 

```
$ cat /proc/scsi/sg/version
```

...I have: 

```
30124   Version: 3.1.24 (20020505)
```

----------

## thorne

:blush:

well, it is close to 2am here... forgot that one step!  updated, rebooted, and now, I have sg0 (cdrw), and sg1 (dvd), and X-CD-ROAST properly displays the drives.  Also, I tried running rtoaster as root to make sure it was working, and it is.  Next, I will make the changes so that any user can use the cdrw.

cdrecord -scanbus now properly returns:

```
cdrecord -scanbus

Cdrecord 1.11a30 (i686-pc-linux-gnu) Copyright (C) 1995-2002 Jörg Schilling

Linux sg driver version: 3.1.23

Using libscg version 'schily-0.6'

scsibus0:

        0,0,0     0) 'QPS     ' 'CRD-BP1700P     ' '1.00' Removable CD-ROM

cdrecord: Warning: controller returns wrong size for CD capabilities page.

        0,1,0     1) 'PIONEER ' 'DVD-ROM DVD-113 ' '1.08' Removable CD-ROM

        0,2,0     2) *

        0,3,0     3) *

        0,4,0     4) *

        0,5,0     5) *

        0,6,0     6) *

        0,7,0     7) *

```

oh, and cat /proc/scsi/sg/version now returns:

```
30123   Version: 3.1.23 (20020318)
```

Thanks a bunch rac!

----------

## thorne

I noticed that there is one "error" at boot time, right before KDE starts up.

```
* Starting Local.....

/dev/hdf:

setting using_dma to 1 (on)

using_dma = 1

/dev/dvd not supported by hdparm

* Failed to start local                           [!!]

```

Any thoughts?

----------

## corrs_fan

 *thorne wrote:*   

> I noticed that there is one "error" at boot time, right before KDE starts up.
> 
> ```
> * Starting Local.....
> 
> ...

 

im getting this too, but i have other cd related problems such as the cdrom dev missing/not there, but i havent done any of the above & this is a fresh install of the 1.4rc1 cd.

----------

