# devfs and my ide cdrw

## Jesse

This is my first time using devfs so I dont know what, if anything, im doing wrong and the one faq that I've skimmed over doesnt seem to help.

Using the old/real  /dev i had no problem getting my cdrw to play nicely as a scsi generic/emulated device.  This time however i chose to use devfs AND compile the neccessary SCSI support into the kernel, they were modules before...

My question is should the /dev/scsi directory be filled out automatically as a result ??  If so, why isnt mine  :Smile: 

Right now my cdrw is read as /dev/cdrom/cdrom1 which means, of course, that cdrecord -scanbus doesn't like me too much ...

----------

## friedmud

Are you sure you compiled all the right stuff into your kernel?

I too have an IDE CDRW and it works just like it did in slack (with no devfs).

cdrecord -scanbus gives:

0,0,0     0) 'ATAPI   ' 'CD-R/RW 10X8X32 ' '8.FZ' Removable CD-ROM

Here are the kernel options I have found necessary for this to work:

#In ATA/IDE/MFM/RLL

< >   Include IDE/ATAPI CDROM support

<*>   SCSI emulation support

#In SCSI support

<*>   SCSI disk support

<*>   SCSI CD-ROM support

<*>   SCSI generic support

[*]   Enable extra checks in new queueing code

[*]   Probe all LUNs on each SCSI device

[*]   Verbose SCSI error reporting (kernel size +=12K)

Some of those might or might not be necessary - but it works for me.  Also note that the IDE/ATAPI CDROM support is UNCHECKED - if you have this marked it will recognize your cdrom drive as an IDE device first and you wont get the scsi device.

Derek[/b]

----------

## Jesse

My scsi section has the relevant ones compiled in as does yours, however, my Include IDE/ATAPI CDROM support is checked as I thought i needed this for my first cdrom which is not scsi at all.

I looked at my slack partition and the kernel there was also configured with these same options, only scsi as modules instead of builtin. (If i do a cat /proc/ksyms i can see scsi  :Wink: ) but no scsi in the /dev/scsi directory. But alas, I think my SCSI low-level drivers are wrong ... :-/  For slack I have all the Adaptec drivers checked while for gentoo i only have one of them checked.  This still beats the heck outa me.  My cdrom plugs right into the motherboard and bypasses my Promise ata66 adapter card all together.  So do Adaptec drivers 'just happen to work' with emulated cdrws ?? or am I still missing an option somewhere

----------

## kipper

Did you append GRUB/LILLO with hdb=ide-scsi  where hdb is your cdrw?

----------

## snutte

This is how i made my ide burner work.

Enable all things in the kernel to get ide-scsi to work.

DISABLE IDE/ATAPI cdrom support

then insert append="hd*=ide-scsi" in your grub.lst this is how mine looks:

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

This little trick made it work for me.  :Smile: 

----------

## Guest

Hey I had the *exact* same problem as you (moving from slackware and everything).

Sorry if the following seems an incoherent rant, but I'm pretty sure it will help you  :Smile: 

My ide-cdrw would be detected as /dev/scsi/host0/bus0/target0/lun0/cd but all the help I could find on google told me that that device was a block device (for mounting) and that cdrecord wanted a character device (for burning to)-- which wuold be /dev/scsi/host0/bus0/target0/lun0/generic.  Unfortunately devfs didn't make/find /dev/scsi/host0/bus0/target0/lun0/generic and making it with the /dev/MAKEDEV script didn't work.

I always used to check "use low level scsi drivers" out of habit because that's what the "Maximum Linux" article said to do (first reference I followed that ever got my burner working for me).

I recompiled my kernel without that option and it worked, whereas before it would say "can't open /dev/pg*" when I'd do a "cdrecord -scanbus"

I tried it many different ways, one change at a time, so that I could narrow it down.  Changing ide-scsi and scsi generic support from being compiled in to just being compiled as modules did nothing.

The one thing that I changed that made cdrecord work for me under devfs was to uncheck the use low level scsi drivers option. My scsi related options for my kernel config look like this:

CONFIG_CHR_DEV_SG=m

CONFIG_BLK_DEV_IDESCSI=y

CONFIG_SCSI=y

This is on a box without any scsi devices, just my cdrom and my cdrw.

Also, you don't need append= in grub.  My menu.lst kernel line looks like this:

kernel /boot/bzImage root=/dev/hda5 hdc=ide-scsi

----------

## jay

I post this here just for completeness, if someone stumbles by with similiar problems:

For compiling the kernel with support for an CD-Recorder on the IDE bus it is enough to check the SCSI emulation support. There is noo need to uncheck the IDE-ATAPI-cdrom support, because this will just disable any other IDE devices (DVD-ROM etc..) on your system.

First I crated the dir /mnt/burner as a mountpoint.

I compiled with these options:

```

#In ATA/IDE/MFM/RLL

<*> Include IDE/ATAPI CDROM support

<*> SCSI emulation support

#In SCSI support

< > SCSI disk support

< > SCSI CD-ROM support

<*> SCSI generic support

[ ] Enable extra checks in new queueing code

[ ] Probe all LUNs on each SCSI device

[ ] Verbose SCSI error reporting (kernel size +=12K) 

```

And I set up my etc/fstab this way:

```

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

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

/dev/hdb3               /               ext3            noatime                0 0

/dev/hdb2               none            swap            sw                     0 0

/dev/cdrom              /mnt/cdrom      iso9660         users,noauto,ro        0 0

/dev/cdrw               /mnt/burner     iso9660         users,noauto,ro                0 0

proc                    /proc           proc            defaults               0 0

```

And my 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

# 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    ^cdroms/cdrom0$   CFUNCTION GLOBAL mksymlink $devname cdrom

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

REGISTER    ^sg0$           CFUNCTION GLOBAL mksymlink $devname cdrw

UNREGISTER  ^sg0$           CFUNCTION GLOBAL unlink cdrw

```

As you can see from above, I creaded two symlinks to the same device /dev/cdrom and /dev/dvd point to the same device (it's actually a DVD-ROM) - this will make your life much easier when you use mplayer or xmms.

----------

## Jean

I finally got xcdroast to recognise my cd rw after following jay's instructions.  However in xcdroast there is  primary and secondary read devices. If I wanted to copy a cd I would put it in the DVD-rom, but it isn't being recognized. Would I have to add that as a scsi device in order for it to be able to choose it as secondary ?

----------

## Curious

 *Jean wrote:*   

> Would I have to add that as a scsi device in order for it to be able to choose it as secondary ?

 

 Yup, Roast will only talk to SCSI devices.

Bryn.

----------

