# Kernel SCSI emulation for CD burning - the truth

## kerframil

30/12/2002 EDIT: Hooray! cdrtools-2.0 is out and guess what, is has ATAPI transport support. That could mean that we Linux users no longer have to use this SCSI emulation madness to burn CDs on IDE burners, as BSD users have been able to for some time with burncd!Type:

```
cdrecord dev=HELP
```

for more info after emerging the new version. No, I haven't tested it yet ...  :Smile: 

Hi,

I just wanted to dispel a few myths about enabling SCSI emulation for IDE devices, that is, setting up Linux so that you can use an IDE CD burner.

These myths are:You have to statically compile in certain SCSI-related kernel features and/or leave IDE CD-ROM support out completely.You have to specify a kernel option in your bootloader (e.g. hdc=scsi)In fact, neither of these statements is true. You can compile all of the related kernel features as modules (meaning you can go back to regular IDE support without recompiling your kernel) and there is no requirement to modify your bootloader. Here's how I did it (note that you are assumed to be root in all code examples except where an su command is shown):

First, compile your kernel with the relevant options (I compiled them as modules in all cases, except where noted):

IDE Options

Include IDE/ATAPI CD-ROM support

SCSI Emulation support

SCSI Options

SCSI Support

SCSI CD-ROM Support

Enable Vendor-Specific Extensions (this is a simple 'Yes' option, no module)

SCSI Generic Support

OK, now recompile and enable your kernel and modules in the usual fashion. Now here's the trick (you may as well do this before you reboot):

Add a line to your /etc/modules.conf as follows:

```
options ide-cd ignore='hdc hdd'
```

This simply tells the ide-cd module (which would otherwise drive your CD/CD-R devices) to ignore /dev/hdc and /dev/hdd, one of which is normally going to be your CD-R device. You can change the device name as necessary for exclusion. It's as simple as that. Upon rebooting, the sg device should be loaded for you (use lsmod to confirm). If it isn't loaded for you, then load it manually as thus:

```
su

modprobe sg

exit
```

or add it to /etc/modules.autoload

You'll probably want to change your /etc/devfsd.conf file so that non-root users can probe and use the CD-R device without jumping through hoops. Simply search for the following line in your devfsd.conf:

```
#REGISTER      ^scsi/host.*/bus.*/target.*/lun.*/generic    PERMISSIONS root.cdrw 660
```

and remove the # symbol from the beginning of the line so that it is no longer commented. Now send a SIGHUP signal to devfsd so that it reloads the configuration:

```
kill -s SIGHUP `ps -C devfsd -o pid=`
```

Ensure that your user account is a member of the "cdrw" group. Example:

```
usermod -g kerframil -G cdrw,users kerframil
```

Now all that is necessary for your CD-R device to be detectable is to load the ide-scsi module:

```
su

modprobe ide-scsi

exit

cdrecord -scanbus
```

and your CD-R device should show up to prove it's working. Notice how it was possible to probe the CD-R device without having to be a superuser, thanks to the magic of devfs. You'll probably want to add that module to your /etc/modules.autoload file so that it loads automatically. Of course, you don't have to run a regular CD-ROM (not CD-R) device with SCSI emulation if you don't want to, but I suspect it would be beneficial for on-the-fly CD duplication.

Not so fast though! I forgot to mention that modules.conf in Gentoo is dynamically generated, so you really don't want to edit the modules.conf file directly to add the exclusion line mentioned above, otherwise it'll get nuked at the next reboot. Instead, do this:

```
echo "options ide-cd ignore='hdc hdd'" > /etc/modules.d/cdr
```

That should ensure that that line is sourced into the modules.conf file every time the computer boots. You can call the file something other than "cdr", just so long as it's there.

By removing that file from /etc/modules.d, or by commenting the options line out, you should be able to go straight back to the regular IDE driver for your devices. In fact, it should be possible to switch between IDE and SCSI emulation mode live.

When you actually get round to recording any CDs  :Wink:  the chances are that you will be using cdrecord to do it, even if you're using a frontend such as gtoaster, xcdroast and the like. If you intend to burn CDs while logged in as an ordinary user then you should consider setting the SUID bit on the cdrecord binary so that it runs as root. This will enable it to issue a setpriority() interface call which in turn will better protect you from the dreaded buffer underrun problem ...

```
su

chmod +s /usr/bin/cdrecord
```

For the record, this method was tested with a gentoo-sources-r10 kernel, on an up-to-date gcc-3.2 based system, on three different machines so far.

EDIT revision 2: Well, I got round to trying this out on several more machines and I have found that the above technique has worked every time. You should uncomment the line to allocate permissions to non-root users in devfsd.conf, and should make sure ide-scsi module is loaded but that's it. Some of this wasn't made clear (I incorrectly implied that it wasn't necessary to load ide-scsi module to use a CDR device before) so I've edited the above to improve the tutorial. For those reading for the first time, scroll down to read about the background behind this but basically some people are saying that this technique doesn't work for them; they must (apparently) still specify a special boot-time option for the kernel, and disable IDE-CDROM support which is how most guides tell you to do it. I'm not trying to be contradictory but the fact is that I have still yet to find personal evidence to support this, that is, it works for me every time. If you do run into problems, then the above tutorial will still work - however, observe the following differences in approach:You won't need to create the cdr file in your /etc/modules.dYou'll need to add append="hdc=ide-scsi" to your kernel boot options. You can do that in /boot/grub/menu.lst. Change hdc according to the device that your IDE CD-R would normally have been assigned.Regardless as to the merits of either technique, I still maintain that it is a myth that you need to exclude IDE-CDROM support. Both techniques are working for me just fine on three different machines so far! The only thing I have not tested heavily is with primary/slave combinations of CD/CD-R/DVD devices on the same channel.Last edited by kerframil on Mon Dec 30, 2002 10:39 am; edited 12 times in total

----------

## BonezTheGoon

Wow, that is really valuable information for people who have both a CD-RW and DVD-ROM that are both E-IDE drives!  Now such people can have SCSI-Emulation for the CD-RW and none for the DVD-ROM!!

Previously I read the help information (which must be out of date now given your results and findings, but is still in my kernel sources) during 'make menuconfig' for the SCSI-Emulation and it indicates that you MUST NOT (cannot) have support for IDE CD-ROMs in order for SCSI-Emulation to work, which is really very restrictive.  I really appreciate you posting this information which has freed me from the oppression of ignorance about the facts which you posted!  Thanks so much!  A true Tip/Trick!!!!

Regards,

BonezTheGoon

----------

## helmers

Yeah, this guide is long needed  :Wink: 

However, from what I've found (and read) the following is not needed:

 *Quote:*   

> SCSI CD-ROM Support (maybe, see below)
> 
> Enable Vendor-Specific Extension

 

And if you don't need to change between recording / normal IDE-CD mode, you can compile everything kerframil said right into the kernel (except the one mentioned above) and just add "hdx=ide-scsi" to the kernel line in grub(where x= your cdr device).

UPDATE: Arkane has a point, you may need SCSI CD-ROM support. I've never needed it, but you may.  :Wink: 

--

Regards,

HelmersLast edited by helmers on Mon Oct 28, 2002 8:22 pm; edited 1 time in total

----------

## arkane

 *helmers wrote:*   

> Yeah, this guide is long needed 
> 
> However, from what I've found (and read) the following is not needed:
> 
>  *Quote:*   SCSI CD-ROM Support 
> ...

 

I ran into an issue once where I forgot to put in SCSI CD-ROM Support and it would only have the sg device, and no sr0 device.  Once I created the scsi cd-rom support module, everything was great.

So, in my experience, it is a necessary thing.

----------

## Oo.et.oO

hi all,

   thanks for finally posting this.  there is so much crud in here it must be hard for people to really know how to do this, and what is the "best" way for THEIR prefs and hardware.

nowthen, i have one cdrw drive and would like to use it as cdrom and cdrw (of course). 

i have a few questions, not sure if anyone can answer them.  all my stuff is and can be compiled as modules, please don't suggest i do otherwise.    :Razz: 

i have a feeling that reading from a cdrw (or cdrom or dvd) through ide-scsi emulation is a less than optimal solution.   I would love to get some stats on this when i have time... (maybe with dma turned on and off too...?)

I can of course modprobe ide-cdrom (or whatever it's called) and access /dev/hdc just fine.

I can also modprobe ide-scsi and access /dev/scsi/host0/bus0/target0/lun0/cd just fine for both reading and writing.

so, is it possible to read from /dev/cdrom (symlink to /dev/hdc) and use the ide-cdrom driver only.

while (not simultaneously) read/write to /dev/cdrw (symlink to /dev/scsi/host0/bus0/target0/lun0/cd with the ide-scsi interface?

i know i can do this with several rmmod/modprobe steps between.  I have written simple scripts to do this.  but have been looking (not very hard) for a more elegant solution.

i have also been thinking about devfs and how this plays in.  if the modules are not loaded (ide-scsi for instance) when devfs is mounted, what happens to devfsd.conf?  

what happens after i change devfsd.conf?  do i have to remount devfs?

oh, and here is a list (in order) of the modules needed to use a single cdrw (minimal complied in (none) ):

read:

Module                  Size  Used by    Not tainted

ide-scsi                8784   1 

sr_mod                 14232   2  (autoclean)

cdrom                  29184   0  (autoclean) [sr_mod]

scsi_mod               55844   3  (autoclean) [sg ide-scsi sr_mod]

isofs                  19332   1  (autoclean)

isofs is assuming the cd is an iso9660 fs.

write:

Module                  Size  Used by    Not tainted

ide-scsi                8784   0 

sg                     28076   0  (autoclean)

scsi_mod               55844   2  (autoclean) [ide-scsi sg]

oh, one more question, i swear...

why oh why does ide-scsi module not autoload when i need it (no modules.autoload is not an option) loading modules at boottime that you may never need is not what i'd call an elegant solution.

bye!

-eric

----------

## BonezTheGoon

I have not seen/felt any performance loss with using a CD-RW drive as SCSI-Emulation full time.  I don't think you should worry about it.  If someone has some drastic numbers and a very convincing case I could change my stance.  But, like I said before, I have no reason to be suspicious given my system feels like the same level of performance (same drive first I didn't use SCSI-Emulation because I didn't know I needed to -- but used the system for a while this way, then later figured out how to use SCSI-Emulation so that I could burn CD's) -- Maybe I am whacko though.  Anyone with any numbers to add into the mix here and possibly clear up some concerns?

Regards,

BonezTheGoon

----------

## kerframil

 *Quote:*   

> so, is it possible to read from /dev/cdrom (symlink to /dev/hdc) and use the ide-cdrom driver only.
> 
> while (not simultaneously) read/write to /dev/cdrw (symlink to /dev/scsi/host0/bus0/target0/lun0/cd with the ide-scsi interface?

 

Hmm, sounds problematic. As far as any OS kernel is concerned, one driver can have a "lock" on a hardware device or set of devices, but you can't really have more than one driver claiming that device belongs to it. I can empathise with your reasons for wanting to do this, but even if you can (I'm not sure how) it sounds dangerous. Maybe if you could somehow "wrap" your mount command, so that when you mount the device, it uses the ide-cdrom driver, but when it is not mounted it reverts to ide-scsi, because you don't want a mount when you're burning, right? That would maybe be clean and transparent enough. But for it to really be a proper solution (so that it works at API level), I suspect you'd have to patch the kernel. If you find some way with devfs or whatever, then please share it!

 *Quote:*   

> I have not seen/felt any performance loss with using a CD-RW drive as SCSI-Emulation full time. I don't think you should worry about it.

 

I've haven't conducted any benchmarks here, but I'm inclined to agree. By way of comparison, Windows uses an ASPI interface for burning and ripping even if you have an IDE device! And I've used ePSXe (an excellent PSX emu, also available for Linux - emerge epsxe) on Windows, and the ASPI CD-ROM driver actually works better (less stutter in MDEC movies and XA audio) than the W2K/W9x driver on my Winblows installation. OK, I know we're dealing with Linux here. Some DVD benchmarks would probably be useful, due to the higher bandwidth demands.

On that note, here is another tip I'd like to share which is very relevant - I have often seen complaints that you cannot run hdparm on an IDE device running with SCSI emulation. What many people don't seem to realise is that the /proc virtual filesystem in Linux is also has write options. By way of explanation, let's assume your CD-R device has been initialised with SCSI emulation. But you really want to turn the DMA option on ... here's how (as root):

```
echo "using_dma:1" > /proc/ide/hdc/settings
```

You can determine the actual settings with:

```
cat /proc/ide/hdc/settings
```

Of course, you can change "hdc" as necessary. You can change any of the usual settings/parameters by using this technique. There are also many useful proc files which you can cat that will help you determine configuration information, where things are on which buses and so forth.

EDIT: Here's a little list of pertinent settings and their equivalent hdparm switches:

```
io_32bit      -> "-c"

current_speed -> "-X"

unmask_irq    -> "-u"

using_dma     -> "-d"

keepsettings  -> ??? maybe setting this to 1 means it will remember config?
```

----------

## Oo.et.oO

 *kerframil wrote:*   

> 
> 
> Hmm, sounds problematic. As far as any OS kernel is concerned, one driver can have a "lock" on a hardware device or set of devices, but you can't really have more than one driver claiming that device belongs to it.

 

i know that the above is true.  i was wondering if there could be a way to load/unload modules on the fly.  or maybe similar to what you say have the drivers share ownership?

but i don't know if this is worth the trouble due to possibly negligable performance increases...  not to mention the overhead of swapping modules or negotiating for ownership...

 *Quote:*   

> If you find some way with devfs or whatever, then please share it!

 

i doubt i'll do this anytime soon as i can't even get devfs to give me the proper permissions unless i load the modules, then HUP devfsd (see below).

 *Quote:*   

> I've haven't conducted any benchmarks here, but I'm inclined to agree. ...
> 
> Some DVD benchmarks would probably be useful, due to the higher bandwidth demands.
> 
> 

 

i have to be inclined to agree myself, even though i brought it up.  I just think it feels wrong.  :Smile: 

so i would like to do some quick benchmarks.  

does anyone know how to get hdparm to work at all on a ide-scsi emulated cdrom?  i know you can set the params in /proc as above.  but how can i do:

```
hdparm -tv /dev/scsi/host0/bus0/target0/lun0/cd
```

?

i get: 

```
/dev/scsi/host0/bus0/target0/lun0/cd not supported 
```

by hdparm

what i planned to do was load the ide-cdrom module and do:

```
hdparm -tv /dev/hdc
```

which should work.  do i only get the /dev/hdc link when i have the ide-cdrom module loaded (prolly a silly question)?  

on a related note:

i've observed something funny (well, i think it's strange anyway) about devfsd and modules.

if i load a module after devfsd is running, say ide-scsi, i don't get the correct permissions on the device (root only).

i don't really want to load all these modules at boot time, because that is silly, although it's a simple solution.

so right now i have to su to root, load the sg and ide-scsi modules (and deps) then HUP devfsd

then i can use cdrw as normal user.  how is this handled when a USB device is inserted?  does devfsd only update every now and then?  on interupt?  it would be great if as a normal user i could just do:

```
cdrecord -scanbus
```

and the kernel would load sg (and deps) and update devfs or whatever it has to do, and away i go...  then after the timeout the cdrw modules are unloaded...

one thing that is interesting is that i can always mount a cdrom as long as the ide-scsi module is loaded, even if i don't HUP devfsd

anyone with insight?

sorry if we are OT

-eric

----------

## kerframil

 *Quote:*   

> what i planned to do was load the ide-cdrom module and do:
> 
> ```
> hdparm -tv /dev/hdc
> ```
> ...

 

Yup, hdparm is braindead and it's high time this behaviour was changed. The method you mention will work, but yes, it is ugly. As for the /dev/hdc link - no, I don't think you will get that link with the ide-cdrom module. But you should still be able to reference the device node directly.

 *Quote:*   

> if i load a module after devfsd is running, say ide-scsi, i don't get the correct permissions on the device (root only).
> 
> i don't really want to load all these modules at boot time, because that is silly, although it's a simple solution.
> 
> so right now i have to su to root, load the sg and ide-scsi modules (and deps) then HUP devfsd
> ...

 

It appears that a new sys-apps/baselayout ebuild has been made available (just emerged it now), which has a new devfsd.conf. Check out these new lines here:

```
# 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        ^scsi/host.*/bus.*/target.*/lun.*/generic    PERMISSIONS root.cdrw 660
```

Needless to say, I reckon you should emerge it, update your config files  in /etc, and make sure you're a member of the cdrw group  :Smile:   Looks like the relevant lines need to be uncommented though. Can't wait to test this myself ...

Yes the autoloading and unloading thing would be pure magic! Maybe the best thing to do is check the kernel docs for the maintainer and lobby them to provide this feature. I'm sure the symbiosis between devfsd and kernel modules is quite important and will certainly mature with time, but the best think we can do is to join the mailing lists for the relevant technologies and make our suggestions and feedback heard, what do you think?

----------

## Oo.et.oO

 *kerframil wrote:*   

> 
> 
> Yup, hdparm is braindead and it's high time this behaviour was changed. The method you mention will work, but yes, it is ugly. As for the /dev/hdc link - no, I don't think you will get that link with the ide-cdrom module. But you should still be able to reference the device node directly.
> 
> 

 

so, i still have to access the node directly...

what about the scsi emulated node?  that doesn't seem to work.  it doesn't do that much good to just time the reads from the ide-cd interface if i can't compare to scsi emu .

 *Quote:*   

> It appears that a new sys-apps/baselayout ebuild has been made available (just emerged it now), which has a new devfsd.conf. Check out these new lines here:
> 
> ```
> # Give the cdrw group write permissions to /dev/sg0
> 
> ...

 

this works!   :Very Happy: 

i just replaced my old cdrw line with this new one, which sets perms for all generic (as seen in the line).

i HUP'd devfsd and removed the sg module.

then went back to normal user, did cdrecord -scanbus and it loaded the modules and i got a bus scan!  yipeeee!

 *Quote:*   

> Yes the autoloading and unloading thing would be pure magic! Maybe the best thing to do is check the kernel docs for the maintainer and lobby them to provide this feature. I'm sure the symbiosis between devfsd and kernel modules is quite important and will certainly mature with time, but the best think we can do is to join the mailing lists for the relevant technologies and make our suggestions and feedback heard, what do you think?

 

it looks like a lot of my concern was alleviated by the updated devfsd.conf.  i'm just getting the hang of that thing as this is the first install i've had with a full devfs implementation.  i think before i lobby anyone for all that driver nuttiness we/i should get the benchmarks from the scsi device.  i'd love to just be able to use hdparm, but if not it's not too hard to just read data and time and clear the buffer.  i've done that before professionally...

now, where did that free time go that i need to do that?

 :Rolling Eyes: 

thanks for all the info kerframil!

good find on the baselayout update!

----------

## rac

 *kerframil wrote:*   

> and/or leave IDE CD-ROM support out completely.

 

Is it possible that this myth is true for some motherboards or chipsets?  Leaving off IDE CD-ROM support seemed to fix cdrecord -scanbus finds no devices. What now?.

----------

## kerframil

Acknowledged, thanks. I'll make an edit pointing out this possibility. It would be nice to get some more feedback.

This is probably a red herring but I notice that sheepdog said he changed his modules.conf. Those changes won't be persistent across a reboot but I think that's made clear enough.

Interestingly enough (and in a strange inversion), the stimulus for this thread was finding that the conventional approach did not actually work for me! That is, using the kernel option hdc=ide-scsi did not work on what was my first attempt to use a CD-R device under linux (although not my first attempt to use SCSI emulation)! That was on a i440BX/PIII-450 Dell system. I've set up another installation on an i810 board (not that much different I suppose), so that could be a candidate for testing. I'd really like to get to the bottom of this, I don't like grey areas ...  :Wink: 

To be honest if you pass that parameter for excluding a device it really should work unequivocally, and so with the kernel option too.

----------

## rac

H-Dragon's question has gone to Problems setting up CD burner.  Please don't post support questions to threads in Documentation, Tips and Tricks.

----------

## aardvark

I don't see how this is better/easier than the original method (kernel boot with hdx=ide-scsi , with both ide-cdrom and scsi emulation support compiled in)

When having ide cdrom support and scsi generic + scsi cdrom , my system defaults to ide cdrom support unless I add the hdx-ide-scsi to my kernel line in grub for a certain drive. For hdx it will then use the scsi support and the other (dvd) drive will be accessed as a normal ide cdrom.  If I for some reason (can't think of any, because the cdrw (as a 'scsi emuation' device acts just as it should.  :Smile:  ) want it to be a ide-drive again, I can just press 'e' in grub and remove the ide-scsi stuff for that boot. Maybe your method lets us change the way the drive is accessed without rebooting the system. But then again, I see no reason to change it (is there?)

Perhaps I'm not getting something here.

----------

## daemonb

thank you for that great guide.

Very useful

cya DaemonB

----------

## kerframil

 *Quote:*   

> If I for some reason (can't think of any, because the cdrw (as a 'scsi emuation' device acts just as it should. icon_smile.gif ) want it to be a ide-drive again, I can just press 'e' in grub and remove the ide-scsi stuff for that boot

 

Yup, you're right - Grub will let you do that. I hadn't thought of that.

 *Quote:*   

> But then again, I see no reason to change it (is there?)

 

I'm not necessarily suggesting that you should.   :Smile:  You can do it any which way works for you. I make it clear at the very beginning that I am simply clarifying something which appears to me to be incorrectly documented almost everywhere (not in the "it doesn't work" sense, rather in the "factual inconsistencies" sense). In fact, using the conventional approach did not, I repeat: did not work for me - I have no idea why. That's why I ended up doing it this way, and it struck me that if I was able to get CD burning working (a) without using a kernel parameter and (b) without having to exclude IDE-CD support then surely it was interesting information and worth reporting.

As I later said in response to rac: *Quote:*   

> Interestingly enough (and in a strange inversion), the stimulus for this thread was finding that the conventional approach did not actually work for me! That is, using the kernel option hdc=ide-scsi did not work on what was my first attempt to use a CD-R device under linux (although not my first attempt to use SCSI emulation)!

 

If none of that had been the case, then this topic would never have arisen.

----------

## ghetto

I compiled all the nessisary modules and modified /etc/devfsd.conf then added the cdr file to /etc/modules.d as per instructions.. however i have to manually insert the ide-scsi module or else it doesnt work.. so i just put it in my /etc/modules.autoload

Have i done something wrong or is this the way its suppost to be?

----------

## perry

Just installed Gentoo this past weekend, so I've been getting all my hardware working again...

I built ide-scsi as a module, and IDECDROM was built into the kernel.  I had pretty much followed the installation instructions.  cdrecord -scanbus didn't show anything, and there was nothing listed in /dev/scsi.  ide-scsi was also in modules.autoload.  So I added:

```

append="hdd=ide-scsi"

```

to my lilo.conf, ran lilo, and rebooted.  cdrecord -scanbus now shows my burner, and I now have stuff in /dev/scsi.

----------

## art

it's great to have who know what they are doing (kerfrmil)

saved me alot of time 

Thanks  :Very Happy: 

----------

## art

Thought I was all set but I get this error, kIIIb sees sony burner burns but there isn't anything on cd!

www root # cdrecord -scanbus

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

Linux sg driver version: 3.1.24

Using libscg version 'schily-0.7'

scsibus0:

	0,0,0	  0) 'SONY    ' 'CD-RW  CRX175A1 ' '5YS2' Removable CD-ROM

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

	0,1,0	  1) 'LG      ' 'CD-ROM CRD-8483B' '1.06' 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) *

Thanks in advance

----------

## eltech

for some reson i get no output from 'modprobe sg'

```
modprobe sg

modprobe: Can't locate module sg

```

hdc is my cdrw and hdd is my cdrw .. in my /etc/modules.d/cdr is the following 

```
options ide-cd ignore='hdc'

```

this is to ignore ide-cd for the cd burner ..

in my modules.conf i sthe following ..

```
modprobe ide-scsi
```

my dvdrom can no longer be identified by xine/mplayer ...

cdrecord -scanbus shows

```

cdrecord -scanbus

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

Linux sg driver version: 3.1.24

Using libscg version 'schily-0.7'

scsibus0:

        0,0,0     0) 'SONY    ' 'CD-RW  CRX195E1 ' 'ZYS5' Removable CD-ROM

        0,1,0     1) '        ' ' ATAPI DVD-ROM  ' '120C' 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) *

```

what i want is the ide-cd on the dvdrom(hdd) .. and the scsi emulation on the cdrw(hdc) ..

my kernel config looks like this ..

```
<M>   Include IDE/ATAPI CDROM support                                          &#9474; &#9474;

  &#9474; &#9474;             < >   Include IDE/ATAPI TAPE support                                           &#9474; &#9474;

  &#9474; &#9474;             < >   Include IDE/ATAPI FLOPPY support                                         &#9474; &#9474;

  &#9474; &#9474;             <M>   SCSI emulation support
```

also wondering .. what would the /etc/fstab look like ater these changes?

----------

## kerframil

 *art wrote:*   

> Thought I was all set but I get this error, kIIIb sees sony burner burns but there isn't anything on cd!
> 
> www root # cdrecord -scanbus
> 
> Cdrecord 1.11a39 (i686-pc-linux-gnu) Copyright (C) 1995-2002 Jörg Schilling
> ...

 

That's bad. I Googled this one and saw quite a few similar reports, but not so much in the way of useful replies. Maybe these two threads will be of some help though (the second URL is absurdly long so I've split it into multiple lines):

http://lists.suse.com/archive/suse-linux-e/2002-Apr/2921.html

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=

26Iy8.11521%24gd5.3618409%40typhoon.southeast.rr.com&rnum=1&prev=

/groups%3Fq%3DCRX175A1%2Bwrong%2Bsize%2Bcapabilities%26hl%3Den

%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3D26Iy8.11521%252

4gd5.3618409%2540typhoon.southeast.rr.com%26rnum%3D1

As for the report above from perry saying that  the kernel option was needed, well yes, things seem pretty inconsistent. I had that problem also on one machine, but not on the original machine (which worked exactly according to my original instructions above) so I guess you do have to have that in some situations. I can't put my finger on it but there must be some rationale behind it.

 *Quote:*   

> for some reson i get no output from 'modprobe sg' 

 

Hmm, well I guess you must have it because cdrecord is showing devices. Maybe you compiled that in statically rather than as a module?

 *Quote:*   

> in my modules.conf i sthe following ..
> 
> Code:
> 
> modprobe ide-scsi

 

I would just put ide-scsi in /etc/modules.autoload.

 *Quote:*   

> what i want is the ide-cd on the dvdrom(hdd) .. and the scsi emulation on the cdrw(hdc) ..

 

If it works, then I think there shouldn't be an "hdc". Instead, it should come in as sr0 or sr1 (is that right? I'm tired ...). If you follow the second link above I think someone mentions this. Anyway, it seems as though your CD-ROM drive is getting lumped in there with SCSI emulation support too which is what you're trying to avoid. Make sure all revelant components of modules if you haven't already.

----------

## kerframil

Hello all. Well I've tried the original technique (as reported by many HOWTOs) and my take on it (as originally posted) and they both work for me. I've now tested my approach on three different computers and cannot reproduce the issue reported where cdrecord -scanbus results in no device found. There were a couple of quirks in my original post (the big one being that you must load the ide-scsi module with modprobe/modules.autoload, which wasn't implied), so I've edited it to make it a bit clearer and added the tip about adjusting devfs too, which is nice for non-root usage. Does this make any difference?

----------

## qnx

Thx for this great guide!! Finally I got my Ricoh CDRW working! It feels great! Thank you!

----------

## art

This place is great  :Very Happy: 

I needed to wipe out the extra cd devices in fstab

recompile kernel without ide cdrom support 

works great now!!!  :Surprised: 

Thanks again

----------

## hook

 :Sad:  ...it doesn't work for me

i tried to do it your way, the only thing i changed was that my cd-rom dev is /dev/hda (don't ask!) ...and it doesn't work

sg is up and running, kernel should have been ok, but if i run cdrecord --scanbus i get:

```
Cdrecord 1.11a39 (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.

cdrecord: For possible transport specifiers try 'cdrecord dev=help'.

```

...any ideas?

----------

## kerframil

Using my technique, you must load the ide-scsi module, it will not be loaded for you unless you put it in /etc/modules.autoload. You can also insmod it after you've booted.

I've just tested the technique on a new fourth machine and it is still going strong. As I said, if you run into a dead end you can always do it the other way and add

```
append="hda=ide-scsi"
```

 on your kernel boot line in Grub. And if that still doesn't work then try omitting IDE CD-ROM support.

----------

## Terrible

Hi kerframil,

I should say that this guide was of tremendous help for me. But I have to notice that I haven't edited /etc/devfsd.conf and /etc/group to allow non-roots to burn CD's, but, surprisingly, I can do it (logged in as a regular user)!

Do you think I should be worried on the security of my system said this happening?

----------

## kerframil

 *Quote:*   

> But I have to notice that I haven't edited /etc/devfsd.conf and /etc/group to allow non-roots to burn CD's, but, surprisingly, I can do it (logged in as a regular user)! 
> 
> Do you think I should be worried on the security of my system said this happening?

 

Terrible, perhaps you followed my recommendation to suid the cdrecord binary? If so, then I believe you have nothing to worry about. If the suid bit is set on the cdrecord binary then as soon as any user invokes cdrecord, cdrecord will run with root priveleges (because root is the owner of that particular file) and have full access to the SCSI bus. Consequently any user should be able to record whether devfs has been modified or not.

Try running cdrecord -scanbus as a non-root user. If no CD-R device is detected then everything is normal. Modifying devfs changes the permissions on the SCSI bus. Having write permissions on the SCSI bus can enable users to send arbitrary data out to a device and cause corruption and damage, so that's why devfs doesn't allow it by default. But this restriction doesn't apply to a process running as root because root has full access permissions to every device under /dev.

If you only want to record CDs as root, then do not suid the cdrecord binary, and leave devfs as you have. That will give you the best security i.e. non-root users simply will not be able to record CDs. This command will strip the suid bit from the binary:

```
chmod -x /usr/bin/cdrecord
```

----------

## hook

it works for me now ...there was a forum i found (can't remember which one) that sloved my problem ...i only had to run ide-cdrom as module and scsi support as a built in  :Wink: 

----------

## kerframil

 *Quote:*   

> i only had to run ide-cdrom as module and scsi support as a built in

 Yes, you must run ide-cdrom support as a module or not at all. Surprised you had to do SCSI support as a built-in, but glad you got it working anyway   :Smile: 

----------

## st. anger

ok, not sure if i have everything right, here is my /etc/devfsd.conf:(the part that matters)

```

# Autoload the sg module if generic scsi driver compiled as module.

LOOKUP          ^sg$      MODLOAD ACTION sg

# 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        ^scsi/host.*/bus.*/target.*/lun.*/generic    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

```

i can run cdrecord -scanbus as a normal user and get desired output, but I cannot play audio cds as a normal user

when i do an "ls -al /dev/sr0" it shows ownership as root:root. shouldnt it be root:cdrw? same goes for /dev/cdrom, cdrw, etc.. weird thing though: when i do:

"ls -al /dev/scsi/host0/bus0/target1/lun0/cd"

it shows ownershp as xamn:cdrom (xamn is my username)

i have been fighting this for a while now, resorting to use root to play my cds

----------

## Vancouverite

Thanks for the great post kerframil. I set this up a few days ago and followed your instructions exactly. Everything works great for me... I've tested it thouroughly on my desktop pc (Athlon 1.4GHz, MSI-K7T-Turbo, 8x4x32 LG CDR and LG 16x DVDROM on the same IDE channel, lolo-sources). Supermount finally works good with my dvdrom using fluxbox/endeavour2 (supermount has been problematic for me with gnome2/nautilus at the best of times). I have no problems burning cd's and using my dvdrom to either watch movies or transfer files at the same time. Also no problems doing this when I max out everyting else (cpu, disk transfers and downloads)... xmms doesn't even  skip a note. The only kernel parameters I am using that are in any way related are ide0/1=autotune, I also enable interrupt unmasking on hda,b,c,d. I had one weirdo problem at first. My cdr mounted on my dvdrom mount point (/dvdrom) and dvdrom mounted on my cdr mount point (/cdrw). I don't know why this happened.. fstab was fine. I modified fstab to mount cdr to /dvdrom and dvdrom to /cdrw and this fixed it. If anyone knows why my mount points got reversed... please tell me.

----------

## kerframil

 *xamn wrote:*   

> when i do an "ls -al /dev/sr0" it shows ownership as root:root. shouldnt it be root:cdrw? same goes for /dev/cdrom, cdrw, etc.. weird thing though: when i do:
> 
> "ls -al /dev/scsi/host0/bus0/target1/lun0/cd"
> 
> it shows ownershp as xamn:cdrom (xamn is my username)

 

No I don't think so. Top-level /dev entries are only symlinks (for backward compatibility in devfs) and having root:root permissions is fine AFAIK. It's the devices that they point to where it counts. So the permissions "xamn:cdrom" are also fine, because devfs grants permissions to you (in context) and to the cdrom group which is right, isn't it? This behaviour can be changed in devfsd.conf.

Having said that, I can't suss out why you shouldn't be able to play audio CDs. Let's assume the permissions could be a problem, in which case have you tried pointing your CD player tool directly to the real device node?

----------

## kerframil

 *Vancouverite wrote:*   

> Thanks for the great post kerframil. I set this up a few days ago and followed your instructions exactly. Everything works great for me...

 You're welcome and great, respectively  :Smile: 

 *Vancouverite wrote:*   

> My cdr mounted on my dvdrom mount point (/dvdrom) and dvdrom mounted on my cdr mount point (/cdrw). I don't know why this happened.. fstab was fine. I modified fstab to mount cdr to /dvdrom and dvdrom to /cdrw and this fixed it. If anyone knows why my mount points got reversed... please tell me.

 

Perhaps devfs isn't too intelligent about determing whether a device is a CD or DVD. In fact, maybe it has no way to distinguish the difference. Have a look at devfsd.conf (the relevant section of which xamn has conveniently posted above, and look at the REGISTER lines and the "Change foo to suit your setup" comments. Maybe they need tweaking for your setup.

----------

## Terrible

kerframil,

 *kerframil wrote:*   

> 
> 
> Try running cdrecord -scanbus as a non-root user. If no CD-R device is detected then everything is normal. 
> 
> 

 

I did so and noticed that a non-root member of the wheel group can successfully run it as opposed to other non-root users.

----------

## kerframil

 *Quote:*   

> I did so and noticed that a non-root member of the wheel group can successfully run it as opposed to other non-root users.

 

That's most intriguing. That seems as though its in keeping with the nature of the wheel group, but I'm not sure what the mechanics behind the permissiveness granted to members of the wheel group in this case. I know that members of the wheel group are able to elevate to root priveleges, so maybe some programs are designed to allow that by implication (or to perform certain tasks that would only be allowed by root) at the program author's discretion (Portage is one such program in terms of it's searching and pretend options). Just a theory, anyway. But one thing's for sure, an untrusted user should never be in the wheel group.

----------

## Terrible

 *kerframil wrote:*   

> 
> 
> But one thing's for sure, an untrusted user should never be in the wheel group.
> 
> 

 

Yeah  :Smile: 

----------

## gzaector

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

coud i comment all of them out, since i dont use /dev/cdrom etc etc, i use /dev/hdc and what not

----------

## kerframil

Bump. Important announcement: good news, cdrtools-2.0 is out - see original post on this thread.

----------

## MrIch

How to setup k3b with an ide cd burner? I do not want to activate ide-scsi since  I use cdrtools 2.0

----------

## kerframil

I don't yet have k3b installed on my system so I can't precisely answer that now. But perhaps I could assist if you relate some of the configuration options to me in more detail?

----------

## ZammyBOI

Good evening everybody!

A couple of minutes ago I downloaded cdrtools 2.0 with the intention of making it work _without_ ide-scsi emulation. I haven't tried burning yet but thought that I could post what I've done this far.

```
bash-2.05a# cdrecord -scanbus                 

Cdrecord 2.0 (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.

cdrecord: For possible transport specifiers try 'cdrecord dev=help'.

```

So I read the output of 'cdrecord dev=help' and tried some other commands, among them this:

```
bash-2.05a# cdrecord -scanbus -dev=ATAPI:0,0,0

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

scsidev: 'ATAPI:0,0,0'

devname: 'ATAPI'

scsibus: 0 target: 0 lun: 0

Warning: Using ATA Packet interface.

Warning: The related libscg interface code is in pre alpha.

Warning: There may be fatal problems.

Using libscg version 'schily-0.7'

scsibus0:

   0,0,0     0) 'LITE-ON ' 'LTR-40125S      ' 'ZS0K' Removable CD-ROM

   0,1,0     1) 'SAMSUNG ' 'CD-ROM SCR-3230 ' 'S102' 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) *

```

Looks quite nice. I hope it will work when doing some laser exercises tomorrow.

*UPDATE* "cdrecord -scanbus -dev=ATAPI" is also working nicely. Don't forget to use CAPITAL letters. /*UPDATE*

----------

## pilla

Now that I've got used to all this scsi emulation....  :Cool: 

 *MrIch wrote:*   

> How to setup k3b with an ide cd burner? I do not want to activate ide-scsi since  I use cdrtools 2.0

 

----------

## ZammyBOI

 *Bloody Bastard wrote:*   

> Now that I've got used to all this scsi emulation.... 

 

Well, direct ATAPI is considered _extremely_ beta.

----------

## ZammyBOI

 *ZammyBOI wrote:*   

> Looks quite nice. I hope it will work when doing some laser exercises tomorrow.

 

The laser exercises was a success and I'm happy to be free of all ide-scsi emulation, forever I hope.

----------

## markusg

Is there a way to test the ATAPI interface with xcdroast, etc?  How did you do the testing?

----------

## zen_guerrilla

Latest xcdroast (not in portage currently) supports ATAPI with cdrtools-2.0. However I read on its home page faq that using atapi, dma doesn't get enabled, which practically means that u won't be able to write a cd-r on speed s >= 16x. 

So till atapi cd-rw support on linux becomes stable I' d suggest to stay on ide-scsi  :Smile: 

.:: zen ::.

----------

## jukka

 *zen_guerrilla wrote:*   

> So till atapi cd-rw support on linux becomes stable I' d suggest to stay on ide-scsi 

 

yes, or use another os for burning. atapi support with openbsd is great!

----------

## zen_guerrilla

 *jukka wrote:*   

>  *zen_guerrilla wrote:*   So till atapi cd-rw support on linux becomes stable I' d suggest to stay on ide-scsi  
> 
> yes, or use another os for burning. atapi support with openbsd is great!

 

I definitely don't want to start a linux vs. bsd flamewar, since I don't know that much about *bsd's, but at least windoze also use an "ide-scsi emulation" method for writing cd-r's IMHO. However ide-scsi works great so far so I guess it's ok  :Smile: 

.:: zen ::.

----------

## kerframil

 *zen_guerrilla wrote:*   

>  *jukka wrote:*    *zen_guerrilla wrote:*   So till atapi cd-rw support on linux becomes stable I' d suggest to stay on ide-scsi  
> 
> yes, or use another os for burning. atapi support with openbsd is great! 
> 
> I definitely don't want to start a linux vs. bsd flamewar, since I don't know that much about *bsd's, but at least windoze also use an "ide-scsi emulation" method for writing cd-r's IMHO. However ide-scsi works great so far so I guess it's ok 
> ...

 

Yes Windows uses ASPI, but I don't think Linux design choices should be based on Windows! And although you can end up with issues on Windows, generally you do not need to jump through hoops to get things working. IDE support on *bsd is great because of one program, burncd. Pity there's no Linux port. IDE-SCSI works fine but it's clearly fiddly and counter-intuitive to setup for most ordinary users. The fact that this thread seems to have attracted a lot of hits must surely be a testament to that. How would Joe Bloggs running RedHat or Mandrake expect to get around it? And Gentoo users are comparatively lucky, we get the advantages of devfs by default. Plus there's the issue of having to run cdrecord suid to ensure that it gets deterministic priority which is not ideal. Anyway, I welcome native support for IDE burners - I am sure the ATAPI/MMC protocol is relatively simple, and I look forward to the whole issue of CD burning becoming more transparent to the average Linux user.

----------

## markusg

Question - I've followed these instructions and cdrecord -scanbus finds my cdr.  However, I'm not able to run Arson as a non-root user without getting the error "-scanbus is not executable".  I did change the permissions as suggested and I'm a member of the cdrw group.  Any ideas?

----------

## bammbamm808

I, too had to disable ide-cd (changed it from in kernel to module, didn't load it), in order to get scsi emulation working. The Gentoo sources worked fine with ide-cd compiled into kernel, but vanilla 2.4.19/2.4.20 wouldn't work right. See my posts

https://forums.gentoo.org/viewtopic.php?t=29030

https://forums.gentoo.org/viewtopic.php?t=28577

What's weird is that all my kernels worked for scsi emulation until about a week ago, then they all refused to do it except Gentoo sources. Anyway, for some, apparrently ide-scsi DOES have to be disabled for scsi emulation to work.

----------

## iplayfast

I've followed the original post with great success. :/

cdrecord -scanbus gives back a healthy

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

Linux sg driver version: 3.1.24

Using libscg version 'schily-0.7'

scsibus0:

        0,0,0     0) 'DVDROM 8' 'X               ' '40  ' Removable CD-ROM

        0,1,0     1) 'HP      ' 'CD-Writer+ 8200a' '1.0g' 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) *
```

But what do I do with this?  :Confused: 

I've tried the ksCD and it seems to see the dvd (which is good), but when it plays there is no sound. I've got alsa and sound is working on this box. 

I don't know how this scsi stuff works. What does a typical fstab look like? 

 :Confused: 

(I didn't want to post in this documents section but I thought that the questions may help other newbies, and the original post is what I've set up).

----------

## kerframil

 *iplayfast wrote:*   

> I've followed the original post with great success. :/

 

Good! The reason behind why some need to disabled IDE-CDROM support is still something of a mystery it seems.

 *iplayfast wrote:*   

> I've tried the ksCD and it seems to see the dvd (which is good), but when it plays there is no sound. I've got alsa and sound is working on this box. 
> 
> I don't know how this scsi stuff works. What does a typical fstab look like?

 

This isn't something I've concentrated much on because my workstation which houses the burner I use isn't really multimedia enabled. A probable target for inspection is devfsd.conf if problems persist.

With fstab, really you should just need something like:

```
/dev/sr0  /mnt/cdrom  iso9660  noauto,ro  0 0
```

What I suspect could be a problem is that devfs may not be setting up the symlink /dev/cdrom to point to the proper device node. Remember also, that devfs can set up nodes on demand - they will appear when an attempt is made to use them, so the absence of something shouldn't necessarily be a factor. Try manually setting up a symlink from /dev/cdrom to /dev/sr0 and see what happens in ksCD.

EDIT: and /dev/dvd perhaps ...Last edited by kerframil on Wed Jan 08, 2003 4:48 pm; edited 1 time in total

----------

## iplayfast

 *kerframil wrote:*   

> 
> 
> With fstab, really you should just need something like:
> 
> ```
> ...

 

Well that made no difference at all. However I did have a realization. The ksCD has the location of the source set manually. It can see both the cd and the dvd (because there is different length songs on them and they light up as though playing.) So apparently the data can be read from the cd but it's not comming out the speakers... So I'll go back to browsing the forums. (as it looks like your method is working, for the data transfer itself).

Edit: 

I got it working. It was so simple. The players I was using apparently don't support alsa. I emerged alsaplayer and it worked. (hit self in forehead).   Thanks for the great post/thread. Last edited by iplayfast on Thu Jan 09, 2003 2:37 pm; edited 1 time in total

----------

## PARENA

Right, I now get this, after putting the line in grub:

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

Linux sg driver version: 3.1.24

Using libscg version 'schily-0.7'

scsibus0:

        0,0,0     0) 'IOMEGA  ' 'ZIP 100         ' '13.A' Removable Disk

        0,1,0     1) 'PLEXTOR ' 'CD-R   PX-W1210A' '1.09' Removable CD-ROM
```

So that's good... Now how do I go about putting my CD-RW in fstab? I have supermount enabled, but look:

```
$ mount /mnt/cdrom

$ ls /mnt/cdrom

ls: /mnt/cdrom: Input/output error
```

Any ideas anyone?

----------

## iplayfast

err, maybe look at the post about 4 messages up?

----------

## PARENA

I saw that /dev/sr0 thing, I was just testing you

/me runs like hell

Cool, now have my CDRW supermounted, weeeee! Thanks for all this great stuff, people. So far, most of my problems have been solved thanks to these forums.

----------

## kerframil

 *Bloody Bastard wrote:*   

> Don't you have a x button in your post?
> 
>  *kerframil wrote:*   Bah, my browser double-posted. If a passing admin should see this - please delete it! 

 

Strangely, no. Think it might be an alignment/wrapping issue with my (probably quite buggy) gtk2 enabled Gecko engine. I'll try with some different browser. Thanks.

----------

## uncle_meat

...Last edited by uncle_meat on Sat Jan 11, 2003 10:43 pm; edited 1 time in total

----------

## uncle_meat

Okay, I finally decided to try to burn the Gentoo ISO, but surprise surprise, cd burning doesn't work.   :Smile: 

I compiled everything as modules, I also had to add an append= line to my bootloader (yaboot) as alluded to in the first post.  I successfully got scanbus to work by modprobe'ing for ide-scsi.  But I can't burn anything.  Here's what happens:

```

# cdrecord -v speed=2 dev=0,0,0 livecd-ppc-281202.iso 

Cdrecord 1.11a39 (powerpc-unknown-linux-gnu) Copyright (C) 1995-2002 Jörg Schilling

TOC Type: 1 = CD-ROM

scsidev: '0,0,0'

scsibus: 0 target: 0 lun: 0

Linux sg driver version: 3.1.24

Using libscg version 'schily-0.7'

atapi: 1

Device type    : Removable CD-ROM

Version        : 0

Response Format: 2

Capabilities   : 

Vendor_info    : 'SONY    '

Identifikation : 'CD-RW  CRX170E  '

Revision       : '2.2d'

Device seems to be: Generic mmc CD-RW.

Using generic SCSI-3/mmc CD-R driver (mmc_cdr).

Driver flags   : MMC-3 SWABAUDIO BURNFREE 

Supported modes: TAO PACKET SAO SAO/R96R RAW/R96R

Drive buf size : 1821440 = 1778 KB

FIFO size      : 4194304 = 4096 KB

Track 01: data   167 MB        

Total size:      192 MB (19:02.42) = 85682 sectors

Lout start:      192 MB (19:04/32) = 85682 sectors

Current Secsize: 2048

ATIP info from disk:

  Indicated writing power: 5

  Reference speed: 2

  Is not unrestricted

  Is erasable

  ATIP start of lead in:  -11745 (97:25/30)

  ATIP start of lead out: 359849 (79:59/74)

  1T speed low:  0 (reserved val  0) 1T speed high:  4

  2T speed low:  8 2T speed high:  0 (reserved val 10)

  power mult factor: 4 6

  recommended erase/write power: 5

  A1 values: 02 4C D0

  A2 values: 4A D8 5A

Disk type:    Phase change

Manuf. index: 40

Manufacturer: INFODISC Technology Co., Ltd.

Trying to clear drive status.

cdrecord: Drive needs to reload the media to return to proper status.

Blocks total: 359849 Blocks current: 359849 Blocks remaining: 274167

Starting to write CD/DVD at speed 4 in real TAO mode for single session.

Last chance to quit, starting real write    0 seconds. Operation starts.

Waiting for reader process to fill input buffer ... input buffer ready.

BURN-Free is OFF.

Performing OPC...

cdrecord: Input/output error. read track info: scsi sendcmd: no error

CDB:  52 01 00 00 00 FF 00 00 1C 00

status: 0x2 (CHECK CONDITION)

Sense Bytes: 70 00 05 00 00 00 00 12 00 00 00 00 24 00 00 C0

Sense Key: 0x5 Illegal Request, Segment 0

Sense Code: 0x24 Qual 0x00 (invalid field in cdb) Fru 0x0

Sense flags: Blk 0 (not valid) error refers to command part, bit ptr 0 (not valid) field ptr 0

cmd finished after 0.008s timeout 240s

Writing  time:    6.562s

Average write speed 999.0x.

Fixating...

Fixating time:    0.001s

cdrecord: fifo had 64 puts and 0 gets.

cdrecord: fifo was 0 times empty and 0 times full, min fill was 100%.

```

The error occurs right after the "Performing OPC..." line.

Any advice?

----------

## uncle_meat

Gerk pointed out that the error looked like a media error.  I investigated a bit more, and found that I needed to "blank" the CDRW disc before writing onto it.  So I'm trying to do that, but cdrecord just sits there:

```

# cdrecord -v -eject dev=0,0,0 blank=disc

Cdrecord 1.11a39 (powerpc-unknown-linux-gnu) Copyright (C) 1995-2002 Jörg Schilling

TOC Type: 1 = CD-ROM

scsidev: '0,0,0'

scsibus: 0 target: 0 lun: 0

Linux sg driver version: 3.1.24

Using libscg version 'schily-0.7'

atapi: 1

Device type    : Removable CD-ROM

Version        : 0

Response Format: 2

Capabilities   : 

Vendor_info    : 'SONY    '

Identifikation : 'CD-RW  CRX170E  '

Revision       : '2.2d'

Device seems to be: Generic mmc CD-RW.

Using generic SCSI-3/mmc CD-R driver (mmc_cdr).

Driver flags   : MMC-3 SWABAUDIO BURNFREE 

Supported modes: TAO PACKET SAO SAO/R96R RAW/R96R

Drive buf size : 1821440 = 1778 KB

Current Secsize: 2048

ATIP info from disk:

  Indicated writing power: 5

  Reference speed: 2

  Is not unrestricted

  Is erasable

  ATIP start of lead in:  -11745 (97:25/30)

  ATIP start of lead out: 359849 (79:59/74)

  1T speed low:  0 (reserved val  0) 1T speed high:  4

  2T speed low:  8 2T speed high:  0 (reserved val 10)

  power mult factor: 4 6

  recommended erase/write power: 5

  A1 values: 02 4C D0

  A2 values: 4A D8 5A

Disk type:    Phase change

Manuf. index: 40

Manufacturer: INFODISC Technology Co., Ltd.

Blocks total: 359849 Blocks current: 359849 Blocks remaining: 359999

Starting to write CD/DVD at speed 4 in real BLANK mode for single session.

Last chance to quit, starting real write    0 seconds. Operation starts.

Performing OPC...

Blanking entire disk

```

Any advice?

----------

## uncle_meat

After several minutes of inactivity I got this:

```

cdrecord: Input/output error. blank unit: scsi sendcmd: no error

CDB:  A1 00 00 00 00 00 00 00 00 00 00 00

status: 0x2 (CHECK CONDITION)

Sense Bytes: F0 00 03 00 05 8C E7 12 00 00 00 00 51 00 00 00

Sense Key: 0x3 Medium Error, Segment 0

Sense Code: 0x51 Qual 0x00 (erase failure) Fru 0x0

Sense flags: Blk 363751 (valid) 

cmd finished after 1261.823s timeout 9600s

cdrecord: Cannot blank disk, aborting.

```

Help?

----------

## uncle_meat

Note that I CAN burn on a fresh CD-RW.  But I can't erase a CD-RW.  This is annoying.  I don't want to waste CD-RW's.

Anyone?  Anyone?

----------

## uncle_meat

 *Quote:*   

> maybe the cdrw is bad/corrupt. can you erase other cd-rw's?

 

I just burned two CD-RW's in a row, and I also have an older one which has an older copy of Gentoo on it.  I can't erase any of them.  So I don't think the media is at fault.

----------

## kerframil

 *Quote:*   

> I just burned two CD-RW's in a row, and I also have an older one which has an older copy of Gentoo on it.  I can't erase any of them.  So I don't think the media is at fault.

 

Perhaps your particular media and drive model just don't get on - perhaps. Anyway, have you tried this parameter?

```
-force

Force to continue on some errors. Be careful when

using this  option. Cdrecord implements  several

checks  that prevent you from doing unwanted things

like damaging CD-RW media by improper drives.  Many

of  the  sanity checks are disabled when the -force

option is used.
```

Note the talk of "improper drives". Sounds potentially risky, but I can't think of any better ideas.

----------

## sulu

Sorry to add to this somewhat lengthy but very interesting thread.

EDIT: Ups. This is not the correct thread for posting questions i assume.

Please mods feel free to move it to a better place.  :Embarassed: 

My problem:

Can't mount CD-R through ide-scsi.

> pts/0]  mount -t iso9660 /dev/cdrom /mnt/cdrom/

mount: block device /dev/cdrom is write-protected, mounting read-only

mount: Not a directory

?? What the heck does "not a directory" mean in this context ??

I want to mount the CD-R via ide-scsi because i think cdrecord and cdrdao need scsi-interface to work with (maybe somewhat relaxed for cdrecord 2) and my burner has lost its ability to read CD-Rom's so i need the CD-R.

I think my configuration is fairly straigth.

- append="hdd=ide-scsi hdc=ide-scsi" for kernel boot.

- Drives show up in the kernel-log:

```

andy-linux kernel: Attached scsi CD-ROM sr0 at scsi1, channel 0, id 0, lun 0

andy-linux kernel: Attached scsi CD-ROM sr1 at scsi1, channel 0, id 1, lun 0

andy-linux kernel: sr0: scsi3-mmc drive: 32x/48x cd/rw xa/form2 cdda tray

andy-linux kernel: Uniform CD-ROM driver Revision: 3.12

andy-linux kernel: sr1: scsi3-mmc drive: 40x/40x writer cd/rw xa/form2 cdda tray

```

- Enabled everything in /etc/devfsd.conf

- The "pseudo"-SCSI-bus looks great

cdrecord -scanbus

```

scsibus0:

        0,0,0     0) 'IBM     ' 'DCAS-34330W     ' 'S65A' Disk

        0,1,0     1) 'IBM     ' 'DCAS-34330W     ' 'S65A' Disk

        0,2,0     2) *

        0,3,0     3) *

        0,4,0     4) *

        0,5,0     5) 'IOMEGA  ' 'ZIP 100 PLUS    ' 'J.66' Removable Disk

        0,6,0     6) *

        0,7,0     7) *

scsibus1:

        1,0,0   100) 'SAMSUNG ' 'CD-ROM SC-148C  ' 'CI09' Removable CD-ROM

        1,1,0   101) 'PLEXTOR ' 'CD-R   PX-W1610A' '1.03' Removable CD-ROM

        1,2,0   102) *

        1,3,0   103) *

        1,4,0   104) *

        1,5,0   105) *

        1,6,0   106) *

        1,7,0   107) *

```

I linked /dev/sr0 to /dev/cdrom and

/dev/sr1 to /dev/cdrw.

I even succeeded in burning a audio cd via:

```

cdrdao copy --source-device 1,0,0 --source-driver generic-mmc --device 1,1,0 --buffers 64
```

Now, please note that the driver had to be specified explicitely for the CD-R. 

Otherwise i get:

```
ERROR: No driver found for 'SAMSUNG CD-ROM SC-148C', available drivers:

....

For all recent recorder models either the 'generic-mmc' or

the 'generic-mmc-raw' driver should work.

Use option '--driver' to force usage of a driver, e.g.: --driver generic-mmc

ERROR: Cannot setup source device 1,0,0.
```

So, i guess that i have also some driver issue with mounting the CD-R. 

Have i to tell the ide-scsi module to use the generic-mmc driver in order to get a successful mount ot the CD-R??

If yes but how to do it ?

Any ideas ?

Edit-2 15-01-2003:21:30:

It seems to be some driver/DMA issue.

andy-linux kernel: SCSI cdrom error : host 1 channel 0 id 0 lun 0 return code = 28000000

andy-linux kernel: Current sd0b:00: sense key Hardware Error

andy-linux kernel: Additional sense indicates Logical unit communication CRC error (Ultra-DMA/32)

andy-linux kernel:  I/O error: dev 0b:00, sector 64

andy-linux kernel: isofs_read_super: bread failed, dev=0b:00, iso_blknum=16, block=16

Solved it  temporarily by diabling DMA via

echo "using_dma:0" > /proc/ide/hdc/settings

Greetz

Sulu

----------

## kerframil

 *Quote:*   

> Solved it temporarily by diabling DMA via 
> 
> echo "using_dma:0" > /proc/ide/hdc/settings

 

I notice that Ultra DMA/33 mode is being used when DMA is enabled. Are you sure your burner supports that? That's hard drive territory, and probably isn't going to work with an ATAPI device.

Multi-word DMA/2 might be a more sensible choice. I can't remember what the mode number is for it offhand but once established you can echo it to the proc interface.

----------

## sulu

Hi kerframil.

I think you are referring to this part of the error message:

```

Additional sense indicates Logical unit communication CRC error (Ultra-DMA/32) 

```

This is what is reported in the kernel.log for the failed mount attempt.

I'm not sure if this error message is to be taken verbatim because i dont know how, where and what DMA-Mode is been set during startup for the CD-R. Please note that this is an issue with the CD-R not with the burner.

This are the settings right after boot:

```

 > pts/0] cat /proc/ide/hdc/settings

name                    value           min             max             mode

----                    -----           ---             ---             ----

bios_cyl                0               0               1023            rw

bios_head               0               0               255             rw

bios_sect               0               0               63              rw

current_speed           66              0               69              rw

ide_scsi                0               0               1               rw

init_speed              12              0               69              rw

io_32bit                1               0               3               rw

keepsettings            0               0               1               rw

log                     0               0               1               rw

nice1                   1               0               1               rw

number                  2               0               3               rw

pio_mode                write-only      0               255             w

slow                    0               0               1               rw

transform               1               0               3               rw

unmaskirq               1               0               1               rw

using_dma               1               0               1               rw

```

So it seems that those settings are not working for tat particular device.

I would like to try Multi-word DMA/2 but how to set this mode via echo "using_dma:??????" > /proc/ide/hdc/settings ?

Who is responsible for setting the DMA-Mode for SCSI-Emulation?

It's not the hdparm script in /etc/init.d because it only affects the harddisks.

Greetz

Sulu

----------

## kerframil

 *sulu wrote:*   

> Hi kerframil.
> 
> I think you are referring to this part of the error message:
> 
> Additional sense indicates Logical unit communication CRC error (Ultra-DMA/32)

 

Yes!

 *Quote:*   

> This is what is reported in the kernel.log for the failed mount attempt.
> 
> I'm not sure if this error message is to be taken verbatim because i dont know how, where and what DMA-Mode is been set during startup for the CD-R. Please note that this is an issue with the CD-R not with the burner.

 

The burner and the CD-R drive are the same thing I believe! If you mean that you think the issue is with the CD-R media ... I doubt it. Read on ...

 *Quote:*   

> This are the settings right after boot:
> 
> ```
> 
>  > pts/0] cat /proc/ide/hdc/settings
> ...

 

Ah. dev/hdc is your burner I presume. The answer is in that output (and also in a post of mine several posts on from the very beginning of this thread). See that current_speed is set to 66? Try something like this:

```
echo "current_speed:34" > /proc/ide/hdc/settings
```

I believe that will yield more desirable results! See http://linux-sxs.org/hdptune.html for some helpful information.

The kernel is responsible for choosing the settings, but may not always get it right. Put the echo line in your local.start file if you want to tweak settings upon boot. Include as many echo lines as you need. See the post I referred to for how hdparm switches correspond with the flags supported by the proc interface.

Also, don't run your burner using a 80-pin IDE cable, be sure to use a 40-pin one - AFAIK, no ATAPI device should use one of these "UDMA" cables which are often characterised by a blue connector on the mainboard side.

HTH.

----------

## Twink

well after stuffing up your instructions enuf to stop gentoo booting I decided to try using ATAPI with no scsi emulation, so doing a 

(note I had to upgrade to cdrecord 2.0 first)

```

cdrecord -scanbus dev=ATAPI

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

scsidev: 'ATAPI'

devname: 'ATAPI'

scsibus: -2 target: -2 lun: -2

Warning: Using ATA Packet interface.

Warning: The related libscg interface code is in pre alpha.

Warning: There may be fatal problems.

Using libscg version 'schily-0.7'

scsibus0:

        0,0,0     0) 'ATAPI   ' 'CD-R/RW 6X4X32  ' '6.HU' Removable CD-ROM

        0,1,0     1) * ....

```

then using "cdrecord speed=x dev=atapi:0,0,0 image.bin" it seems to work fine, now just to either get this working with other programs or figure out how to burn seperate files (do I need to make a image first or is there an option to burn normal files?)

----------

## sulu

kerframil:

Thanks for your reply.

```

echo "current_speed:34" > /proc/ide/hdc/settings

```

didnt solve the problem though.

 *Quote:*   

> 
> 
> an 19 06:47:34 andy-linux kernel: SCSI cdrom error : host 1 channel 0 id 0 lun 0 return code = 28000000
> 
> Jan 19 06:47:34 andy-linux kernel: Current sd0b:00: sense key Hardware Error
> ...

 

Ah, I allready guessed that it should be a kernel issue since i found some of the error message above in the kernel mailing lists.

Maybe this is part of the "broken ide layer" Alan Cox talks about.

 *Quote:*   

> 
> 
> Also, don't run your burner using a 80-pin IDE cable, be sure to use a 40-pin one - AFAIK, no ATAPI device should use one of these "UDMA" cables which are often characterised by a blue connector on the mainboard side.
> 
> 

 

Thanks for the hint but i do use one of this old fashioned 40-pin cables.

I'll have a look at http://linux-sxs.org/hdptune.html and see if something works. 

If it does not help , aaargh my baby son hits the keyboard so lets sit him on the floor ' :Rolling Eyes: ', i stick to the pio-mode and wait for better times.

Twink:

Do you think cdrecord 2.0 would matter in that context ?? 

It would ease the setup anyway but does it have an effect on the detection of the correct DMA-Mode ?

Greetz

Sulu

----------

## Twink

well it doesn't require scsi to be installed, so I guess it would detect at whatever the normal ide drivers used to for you.

----------

## kerframil

Sulu,

I only have two more suggestions - one (which is obvious, I'm sure) is to make sure the echo command is issued as root and to check the setting did get applied. The second, is to try a newer kernel (something based on 2.4.20 - vanilla, or the gentoo-sources-2.4.20-r1). The new gentoo sources are considered experimental but have worked flawlessly for me. You can emerge like so:

```
ACCEPT_KEYWORDS="~x86" emerge gentoo-sources
```

then make sure the /usr/src/linux symlink is pointing to the correct sources.

Apparently, Andre Hedrick is maintaining the IDE layer again so things should get quite a lot better soon I hope.

If you elect to stick with the native ATAPI features of cdrecord 2.0 then you can use hdparm as normal.

As for burning individual files, cdrecord expects to use an ISO image I think. You use mkisofs to populate an ISO image. You can mount ISO images something like this:

```
mount -t iso9660 -o loop /myimage.iso /mnt/iso
```

and modify things under /mnt/iso as if it is a regular filesystem.

The many GUI front-ends should make this quite a lot easier, such as gtoaster. Multi-session burns allow you to add files onto an already burned CD (you must be sure not to fixate the first burn/session which will make it impossible to modify the CD again), but haven't done this at command-line level yet. With the front-ends, you may need to fiddle a bit with some of the settings so it uses the correct parameters in light of the fact that you are using IDE burner - they will all assume traditional SCSI mode (for now).

----------

## sulu

Twink:

Thats definitely an option. AFAIK cdrecord 2.0 is considered to be quite "experimental" but i think i'll use it when it will beome available in the "stable" gentoo-tree.

Kerframil:

You are a profound source of information. 

Tanks !  :Very Happy: 

I'm using the vanilla-Kernel 2.4.20 and have bootable 2.145.19.r9 and 2.14.19.r10 gentoo-kernels.

But i definitely want too try the new gentoo-sources.

So let's copy n paste your hint for emergeing the new gentoo-kernel and bake another kernel.

Greetz

Sulu

PS: As fore the cdwriting programs/frontends. I like cdrecord, mkisofs and cdrdao. Just copy/paste from the shell history is the way i like to do it.

----------

## Empty_One

thanks, after re-reading the guide, and starting with a fresh kernel, I finally got cdrecord working.  Thank you

----------

## sulu

kerframil and Twink:

The new gentoo-sources (2.4.20-r1) solved the issue.

The CD-R now mounts without a hitch.

Thanks

Sulu

----------

## ckpt-martin

I just wanted to confirm that cdrecord works with ATAPI support without the need of SCSI emulation. Just burned a couple of CDs with xcdroast!!

If "cdrecord -scanbus" doesn't detect anything, try "cdrecord -scanbus dev=ATAPI". You should see something now.

BTW. xcdroast auto-detected my SONY ATAPI CDRW.

Chris

----------

## sulu

Hey ! Sounds great.  

Does this mean that you dont need the ide-scsi-emulation any more ??

----------

## kerframil

 *Quote:*   

> Does this mean that you dont need the ide-scsi-emulation any more ??

 

Yes, but as has already been discussed on this thread, the code is "extremely alpha". There is no guarantee it will work properly or safely, so if you already have SCSI emulation working I'd stick to it (for now) - unless you want to be on the bleeding edge ...

----------

## Bonkie

 *kerframil wrote:*   

> ... [cut]
> 
> Both techniques are working for me just fine on three different machines so far! The only thing I have not tested heavily is with primary/slave combinations of CD/CD-R/DVD devices on the same channel.

 

Well no support question, but I have an TEAC cdrom on hdc and a Plextor CDRW on hdd and i can't get my cdrw to work. Tried everything you suggested so now you know  :Smile:  Currently i'm recompiling the kernel with atapi cdrom support as a module ...

[Addendum Tuesday]

Just recompiled my kernel with ide-cdrom support as a module (and not autoloaded). Now it works ...

----------

## kerframil

 *Quote:*   

> Just recompiled my kernel with ide-cdrom support as a module (and not autoloaded). Now it works ...

 

Upon rebuilding my system recently, I ran into a similar issue. I found that unloading (rmmod) the ide-cdrom module, then loading the SCSI module with insmod ide-scsi solved the problem. What is interesting is that this worked without having to add the module definition to restrict the scope of the ide-cdrom module. In any case, upon adding this definition again, everything worked as it did before (no need for jiggery-pokery after booting my system).

----------

## torque2k

I'd like to add to the "Thank you"'s here; this helped me get my LG CDRW running fine!

One point of contention, though: If one is following through the steps and performing them as they read them (I know, read the info through FIRST), they will miss this:

 *Quote:*   

> Not so fast though! I forgot to mention that modules.conf in Gentoo is dynamically generated, so you really don't want to edit the modules.conf file directly to add the exclusion line mentioned above, otherwise it'll get nuked at the next reboot. Instead, do this:
> 
> ```
> echo "options ide-cd ignore='hdc hdd'" > /etc/modules.d/cdr
> ```
> ...

 

It needs to be moved up in the document...

----------

## dufeu

What's recommended for setting up a cd-rom and a cd-r/w (/dev/hdg and /dev/hdh respectively) when going up to the 2.5.65 kernel?

Please!!!

 :Wink: 

----------

## bleakcabal

 *ckpt-martin wrote:*   

> I just wanted to confirm that cdrecord works with ATAPI support without the need of SCSI emulation. Just burned a couple of CDs with xcdroast!!
> 
> If "cdrecord -scanbus" doesn't detect anything, try "cdrecord -scanbus dev=ATAPI". You should see something now.
> 
> BTW. xcdroast auto-detected my SONY ATAPI CDRW.
> ...

 

I have done :

cdrecord -scanbus dev=ATAPI

And that prints this :

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

scsidev: 'ATAPI'

devname: 'ATAPI'

scsibus: -2 target: -2 lun: -2

Warning: Using ATA Packet interface.

Warning: The related libscg interface code is in pre alpha.

Warning: There may be fatal problems.

Using libscg version 'schily-0.7'

scsibus0:

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

        0,0,0     0) 'ASUS    ' 'CD-S500/A       ' '3.1H' Removable CD-ROM

        0,1,0     1) 'LG      ' 'CD-RW CED-8080B ' '1.06' 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) *

That's all fine and all, and it seems to be doing something but what ? I could already mount my CDR as a CD before and after doing this and all my CDR still don't seem to want to write with my CDR.

Xcdroast says it doesnt see any scsi devices and that for ATAPI device I have to install scsi emulation first, but I have already compile in the kernel all the options mentioned in the gentoo help documents and the first post of this thread. I also followed the instructions in the install doc but not those of the first post as it said it was for SCSI emulation and now cdrtools had ATAPI emulation.

Do I need to do something to say this ( I have one CD and one CDR ) device must run scsi emulation ?

My CDR programs still don't work, is there something I should do next ?

----------

## RayVan

You can add the ide-scsi module to modules.autoload as the poster suggested, but this solution sucks. What's the point of compiling it as a module if you /always/ load it? Fortunately, there's a better (and more correct) way.   :Wink: 

The file /etc/modules.devfs is an 'overlay' to the modprobe config file used by devfsd. This file holds aliases that allow devfsd to tell modprobe to automatically load needed modules when devfsd creates new devices. For example....

 *Quote:*   

> # All SCSI devices
> 
> probeall  /dev/scsi             scsi_hostadapter sd_mod sr_mod st sg
> 
> 

 

As you can see, this part of the file automatically loads the scsi drivers whenever /dev/scsi is touched. There are other sections for specific types of scsi devices, but the important part is that they all include 'scsi_hostadapter'. This is where you put your low-level scsi device drivers. To do this, add the following line to a file in the /etc/modules.d directory.

 *Quote:*   

> probeall scsi_hostadapter ide-scsi

 

If you have 'real' SCSI devices, add them after ide-scsi. Now, the ide-scsi driver will be automatically loaded ONLY when you need it. This is superior to passing 'hdc=ide-scsi' to the kernel at boot, because it allows to module to be autoloaded, instead of forcibly loaded at boot. It will also automatically reload the module if necessary.

If you also need ide-ccd, and want it to ignore your ATAPI drive, you can use kernel options (as people have noted), but that way sucks because it 

The 'better' way is to tell the ide-cd driver to ignore your ATAPI drive by passing it options through modprobe (i.e. add  *Quote:*   

> options ide-cd ignore='hdc'

  to a file in /etc/modules.d).

FYI, modules such as sr_mod, sg, and scsi_mod do NOT neet to be in modules.autoload. These modules are loaded automatically by devfsd when needed, per the entries in modules.devfs. If they aren't being autoloaded, putting them in modules.autoload is just covering up the problem instead of fixing it. You can pretty much eliminate the need for modules.autoload completely by properly setting up modprobe and devfs, and you get the added benefit of only loading modules when you need them.

----------

## kerframil

 *RayVan wrote:*   

> You can add the ide-scsi module to modules.autoload as the poster suggested, but this solution sucks. What's the point of compiling it as a module if you /always/ load it? Fortunately, there's a better (and more correct) way.  

 

Indeed. And that isn't made entirely clear, admittedly. I recommend the alteration of the devfsd.conf file for this very reason, however ...

 *Quote:*   

> probeall scsi_hostadapter ide-scsi

 

... I wasn't aware of this and, as it enables ide-scsi to load automatically in addition to sg, sr_mod, scsi_mod, it is a very useful modification to make. Thanks for sharing that, I'll update the post at some point.

 *Quote:*   

> If you also need ide-ccd, and want it to ignore your ATAPI drive, you can use kernel options (as people have noted), but that way sucks because it 
> 
> The 'better' way is to tell the ide-cd driver to ignore your ATAPI drive by passing it options through modprobe (i.e. add  *Quote:*   options ide-cd ignore='hdc'  to a file in /etc/modules.d)

 

That is precisely the reason my post was made and, as such, this is recommended in my procedure. I appended the "old fashioned" method of using a kernel boot option simply because the "exclusion" method does not work on all configurations as has been noted and widely discussed. Until this is no longer the case, it would be unwise of me to omit this method of configuration from the instruction, although this point could be clarified further perhaps.

 *Quote:*   

> FYI, modules such as sr_mod, sg, and scsi_mod do NOT neet to be in modules.autoload. These modules are loaded automatically by devfsd when needed, per the entries in modules.devfs. If they aren't being autoloaded, putting them in modules.autoload is just covering up the problem instead of fixing it.

 

Well I wouldn't call it a problem as such, although you are right - it's sub-optimal from the point of view of configuration cleanliness! The modules certainly are loaded automatically, having made the necessary devfsd tweaks. The long and short if it is that I hadn't sussed out the usage of probeall, and this discovery is an important one.

I will perform a few tests, then clean up the post. Thanks.

----------

## DefconAlpha

Been doing this for months... Oh well. :P

----------

## sarumont

I just wanted to throw up my final working config in case it might help someone.

 I have ATAPI CDROM support, SCSI Emulation, SCSI CDROM and SCSI generic all 

compiled as modules.  I have no kernel commands in my grub.conf for hdc/hdd (CDR

and DVD).  I also don't have the cdr file in my /etc/modules.d.  I loaded none

of the SCSI or CD modules in modules.autoload, but I noticed after boot that

everything except ide-scsi loaded automatically.

At this point, cdrecord -scanbus showed nothing (giving the unable to access

SCSI driver error) although cdrecord -scanbus dev=ATAPI showed my DVD-ROM, but

not my CDR.  Then I used modprobe ide-scsi, tried both scanbus's again and

showed my DVD as ATAPI and my CDR as SCSI.

Thanks for the direction, kerframil, and I hope this helps at least one other who

wants CDR SCSI emulation without sacrificing their DVD-ROM.

----------

## bleakcabal

options ide-cd ignore='hdc hdd'

How do I know what is the device "name" of my cd-drives ?

----------

## David_Escott

hda is the primary drive on the first controller, hdb the secondary on the first controller, hdc the primary on the second controller, hdd the secondary on the second controller, etc.

Look at the files:

/proc/ide/ide*/*/model

to find out which one it is. Usually the first cdrom is hdc and the second is hdd.

----------

## Beekster

At least we are not alone in being frustrated with this issue.

Alan Cox writes  that:-  *Quote:*   

> 2.4.20 is kind of the nailing together of the old IDE as best as
> 
> possible. 2.4.21 is the IDE updates. It isnt perfect yet but its a lot
> 
> lot better.

 

I've tried too many times to get the DVD on IDE and the CD/rw on ide-scsi with 2.4.20-Gentoo and Gaming, although the vanilla 2.4.20 did work as expected (for me) as does 2.4.19-Gentoo-r10 and 2.5.67.

/me hopes 2.4.21 (Gentoo & Gaming) gets it right &/or 2.5.x gets lm_sensors working soon!

----------

## oiper

https://forums.gentoo.org/viewtopic.php?p=171479#171479

synic posted (here https://forums.gentoo.org/viewtopic.php?p=171479#171479 ),

 *Quote:*   

> 
> 
> This works for you guys that want to enable DMA for ide-scsi devices.
> 
> echo "using_dma:1" > /proc/ide/hdc/settings
> ...

 

Worked great for me!   :Rolling Eyes: 

----------

## link97381

A little tip and a question...

you can also set your usb up to autoload in modules.d much like the probeall scsi_hostadapter ide-scsi. Mine reads "probeall usb-interface usb-ohci ehci-hcd"  usb-ohci and ehci-hcd being my usb controllers.  you may have a usb-uhci or just a uchi controller.  

And then my question when I have "probeall scsi_hostadapter ide-scsi" in my modules.d it will load both my DVD and CDRW as scsi drives and the only way I know to get around it is to add ide-cd to my modules.autoload file.  Is that the only way to get it to work or is there a way where the ide-cd is loaded as needed like the scsi drivers?

Thanks for any help

----------

## cybermans

i have done your guide but now i have 6 dvdroms and 6 cdrecorders (when i look to my machine i count only 2 in total). Is this normal? and how the hell can i fix this

----------

## silux

Okay I know that this is probably a very very stupid question and I appologize for wasting everyones time who is reading this.  Basically I followed the instructions from the original post in this thread (very good btw and I very much appreciate it) but now I have the following delema: When I load up everything with scsi emulation I have no idea how to mount my cdrom and dvd-rom drive

I'm sure its just a matter of changing /etc/fstab but I dont' know what I'm doing ... as in I don't know what the dev paths are for scsi hardware and such.  So at the moment I seem to be left with the delema of being able to get cdbakeoven to recognize my "scsi" drive or being able to mount the drive.

If someone could post a reply with the fstab line I should use or tell me what I'm doing wrong I'd appreciate it.

--->>>> oh also just a suggestion ... it would be really nice if this was in the official gentoo docs since there is no documentation there for setting up a cd-r.  Not sure who actually makes that decision though.

----------

## link97381

The easiest thing to do is edit your /etc/devfsd.conf file   fine the part that looks like this

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

 except it'll all be commented out.  Just uncomment it then all you have to do(after rebooting) is do a mount /dev/cdrw to mount your cdrw. then cut and paste that same section except for change the cdrw's in it to dvd and then also change the sr0's to sr1.  But that is of course assuming that the CDRW is the primary device and the DVD is the secondary.......if your setup is the other way around then just switch the sr0's and sr1's  Hope this helps

----------

## silux

I guess if I understood devfs I probably would have figured that out eventually but thank you so much for pointing that out to me... now I can mount my drives and write my cd's woot

----------

## silux

I guess if I understood devfs I probably would have figured that out eventually but thank you so much for pointing that out to me... now I can mount my drives and write my cd's woot

----------

## DArtagnan

Hehe, mine is also working but as u can see I have the following WARNINGS 

```

cdrecord: Operation not permitted. WARNING: Cannot set RR-scheduler

cdrecord: Permission denied. WARNING: Cannot set priority using setpriority().

cdrecord: WARNING: This causes a high risk for buffer underruns.

```

 in the following during the burn:

```

liviu@starshooter burner $ cdrecord -v speed=2 dev=0,1,0 livecd-experimental-rc4-4-20-03.iso 

Cdrecord 2.01a14 (i686-pc-linux-gnu) Copyright (C) 1995-2003 Jörg Schilling

TOC Type: 1 = CD-ROM

scsidev: '0,1,0'

scsibus: 0 target: 1 lun: 0

Linux sg driver version: 3.1.24

Using libscg version 'schily-0.7'

atapi: 1

Device type    : Removable CD-ROM

Version        : 0

Response Format: 1

Vendor_info    : 'LG      '

Identifikation : 'CD-RW CED-8120B '

Revision       : '1.03'

Device seems to be: Generic mmc CD-RW.

Using generic SCSI-3/mmc   CD-R/CD-RW driver (mmc_cdr).

Driver flags   : MMC SWABAUDIO 

Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R96R

Drive buf size : 5185536 = 5064 KB

FIFO size      : 4194304 = 4096 KB

Track 01: data    55 MB        

Total size:       63 MB (06:19.97) = 28498 sectors

Lout start:       64 MB (06:21/73) = 28498 sectors

Current Secsize: 2048

ATIP info from disk:

  Indicated writing power: 6

  Is not unrestricted

  Is not erasable

  Disk sub type: Medium Type C, low Beta category (C-) (6)

  ATIP start of lead in:  -11231 (97:32/19)

  ATIP start of lead out: 359849 (79:59/74)

Disk type:    Short strategy type (Phthalocyanine or similar)

Manuf. index: 27

Manufacturer: Prodisc Technology Inc.

Blocks total: 359849 Blocks current: 359849 Blocks remaining: 331351

cdrecord: Operation not permitted. WARNING: Cannot set RR-scheduler

cdrecord: Permission denied. WARNING: Cannot set priority using setpriority().

cdrecord: WARNING: This causes a high risk for buffer underruns.

Starting to write CD/DVD at speed 4 in real TAO mode for single session.

Last chance to quit, starting real write    0 seconds. Operation starts.

Waiting for reader process to fill input buffer ... input buffer ready.

Performing OPC...

Starting new track at sector: 0

Track 01:   55 of   55 MB written (fifo 100%) [buf  99%]  -0.-x.

Track 01: Total bytes read/written: 58359808/58359808 (28496 sectors).

Writing  time:  102.339s

Average write speed   3.7x.

Min drive buffer fill was 99%

Fixating...

Fixating time:   61.362s

cdrecord: fifo had 920 puts and 920 gets.

cdrecord: fifo was 0 times empty and 794 times full, min fill was 90%.

```

Settings:

------------

starshooter root # cat /etc/modules.autoload 

```

nvidia

ide-scsi

sg

sr_mod

```

cat /etc/devfsd.conf

```

...

...

...

# Uncomment this to let PAM manage devfs

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

# Autoload the sg module if generic scsi driver compiled as module.

#LOOKUP          ^sg$      MODLOAD ACTION sg

# 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        ^scsi/host.*/bus.*/target.*/lun.*/generic    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

```

/boot/grub/grub.conf

```

title=Gentoo1.4 System

root (hd0,0)

kernel (hd0,0)/boot/bzImage-linux-2.4.20-ck7 root=/dev/hda2 ide-scsi=/dev/hdd apci=off

```

----------

## blueworm

 *Quote:*   

>  Also, don't run your burner using a 80-pin IDE cable, be sure to use a 40-pin one - AFAIK, no ATAPI device should use one of these "UDMA" cables which are often characterised by a blue connector on the mainboard side.

 

I firmly believe this to be untrue.

ATA66 cables (80pin cables with the colored ends) Will work perfectly

using the Cable Select settings, and often resolve device conflicts.

Give it a try change cable and set device jumpers to cable select. This also allows you you to sepate to optical devices to separate ide buses whilst still using ATA66/100 hardrives.

Kerframil I am havig problems with cdrw speed it records perfectly at x16 but cdrw is x40 and it used to work under Mandrake 9.0 untill one fine day it stopped working I have since moved on to Gentoo.

I have a detailed thread here https://forums.gentoo.org/viewtopic.php?t=53746

Thankyou in advance.

----------

## MrChucho

I followed this tutorial and got my burner working. But, I still had to add "ide-scsi=hdc" to my grub.conf. If I *don't* want to do this -- and let devfs handle everything, how/where do I indicate that my cd burner is "hdc"??

----------

## DArtagnan

 *MrChucho wrote:*   

> I followed this tutorial and got my burner working. But, I still had to add "ide-scsi=hdc" to my grub.conf. If I *don't* want to do this -- and let devfs handle everything, how/where do I indicate that my cd burner is "hdc"??

 

Yes, how to do this?

Regards

----------

## Jimbow

I've recently had an annoying problem with my combo CDROM/DVD drive when playing DVD's.  On most DVD's when I got to the last few minutes of the program, the DVD player would crash: mplayer, xine, and ogle.

I played around and emerged different libraries, all to no effect.  Then reading the Ogle faq I noticed that they recommend using SCSI emulation to fix some strange bugs (I had converted from SCSI emulation to ide-cdrom about a month or two ago).   So I recompiled my kernel removing ide-cdrom and including ide-scsi, etc and this fixed the problem.

----------

## FastTurtle

[qoute]As for the report above from perry saying that  the kernel option was needed, well yes, things seem pretty inconsistent. I had that problem also on one machine, but not on the original machine (which worked exactly according to my original instructions above) so I guess you do have to have that in some situations. I can't put my finger on it but there must be some rationale behind it.[/qoute]

Could it have something to do with Via Chipsets:? I've got one and it has to be setup with the kernel option at boot, although I have 2 drives, the second is a plain cdrom and it's running in ide mode w/o prob. :

----------

## FastTurtle

[qoute]Perhaps devfs isn't too intelligent about determing whether a device is a CD or DVD. In fact, maybe it has no way to distinguish the difference. Have a look at devfsd.conf (the relevant section of which xamn has conveniently posted above, and look at the REGISTER lines and the "Change foo to suit your setup" comments. Maybe they need tweaking for your setup.[/quote]

It got me thinking because mine does the same thing. I suspect what causes it is the emulation mode itself. IDE is the prefered method for IDE devices and scsi is going to be the secondary mode. Due to this, when you build both into the kernel, that is why CDRecord can't locate an IDE burner, the IDE driver has it locked and defined as IDE, thus not allowing scsi emulation a chance to talk to the device.  :Idea: 

----------

## eeknay

hi,

well first to say this guide is awesome, i finally got it working, BUT

while using k3b i have 7 writers now  :Wink:  not bad huh?

well, unforunally i just need ONE. The other thing is that my reader is now not visible anylonger, since i got the writer working.

i'm using a notebook with a combo-driver CD/DVD/CD-RW

before using this guide this combo was working on /dev/hdc

my well discovered writer is now /dev/scsi/host0/bus0/target0/lunX, as i said before its there 7 times.

any ideas?

----------

## glamdringlfo

Hey, great guide.  Thanks a lot.

I got it working after a while...the hardest part was figuring out that the modules had to be loaded in the right order, and then adding the appropriate flags to the kernel at boot.  

Keep up the good work, guys.  ; )

Skal!

Glamdringlfo

----------

## lamaistres

Thank you for the nice tutorial. I now have burning capabilities. 

I use gtoaster to burn CD's and if I try and record as a normal user I get a cdrecord warning about possible buffer underuns. I fixed this by editing visudo and using the command "sudo gtoaster". Works great.  :Very Happy: 

Thanks again.

----------

## bryon

Any pointers on what I should do if it is a external USB one.  More specifically a HP 8210e that runs at 4x.  One of the many things that I have to have enabled is the mass storage support right?

----------

## Snakey

Hello people, after reading this guide for SCSI emulation, I encountered a weird problem. 1st of all I'm a total newbie when it comes to linux and I couldn't understand this.

I setup my bootsplash (instructions here!: https://forums.gentoo.org/viewtopic.php?t=49036) and when it came to the part of adding the bootsplash screen to the other VT's, everything ran fine until I added the hdc=ide-scsi to the kernel line on my grub.conf. Does anyone have any idea what the problem is or if there's anywhere else I could add that hdc=ide-scsi so it wouldn't conflict with my VT bootsplash screens? Thank you!  :Smile: 

----------

## dorkus

hi, im new and thought i would ask, in case this isnt the same problem.

i got gentoo on a dell inspiron 5100. everything works except the cd drive. 

i installed using the drive, but in normal operation it doesnt let me access anything on the cd. i know it has something to do with scsi-ide stuff, but im kind of a newb with linux. any help is appreciated. sorry i cant provide more info, i don't have the computer here. the cd drive is a CD-RW/DVD drive.

----------

## silux

I followed the tutorial and I don't think I'm missing anything but when I did:

```
cdrecord -scanbus
```

I get the following error: 

```
root@alb-24-195-61-82 mattolsen # cdrecord -scanbus

Cdrecord-Clone 2.01a18 (i686-pc-linux-gnu) Copyright (C) 1995-2003 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.

cdrecord: For possible transport specifiers try 'cdrecord dev=help'.

```

Any help would be appreciated.... also I was wondering if anyone had played with using cdrecord without setting them up as scsi and if this was possible yet.

----------

## gwion

 *silux wrote:*   

> I followed the tutorial and I don't think I'm missing anything but when I did:
> 
> ```
> cdrecord -scanbus
> ```
> ...

 

same for me, would be thankful for anyhelp (with another install 4 months ago on EXACTLY the same box it worked like a charm...)

thanks...

----------

## Caffeine

 *silux wrote:*   

> I followed the tutorial and I don't think I'm missing anything but when I did:
> 
> ```
> cdrecord -scanbus
> ```
> ...

 

Try the thread "ATAPI burning using XCDRoast? It's possible!"

https://forums.gentoo.org/viewtopic.php?t=32009

----------

## cirrus

This is for people who tried every configuration one can think of including the hints from this thread and all efforts were worth nothing....

TURN OFF APIC !!!!!!

In Grub.conf 	insert option  "noapic"

lilo?!?

Sometimes it does magic!

On my system it did.

Karsten.

----------

## ruckles

Having done all this successfully and burning audio cds no problem, is there any way to actually play the cds (using the same device, the burner on hdc)? When I use xmms and try to find the disk, /mnt/cdrom comes up empty. However, if I put a data disk in, xmms finds it. 

xmms plays mp3 files fine, I just can't get it to find my audio cds.

I have the cdplayer plug-in enabled and set to device:/mnt/cdrom and dir:/mnt/cdrom

I'm told I don't need to mount audio cds.

I've tried commenting out the line in...modules.d/cdr, no luck.

I've looked all over for a solution and I am totally, completely lost.

Thanks.

----------

## guitou

For AudioCD, you have to give the path of the device. Should be /dev/cdrom, or /dev/cdroms/cdrom[0|1], maybe also /dev/sr0 (as you enabled scsi emulation), or even /dev/ide?/host?/bus...

Only the last one is the real path of the device, then wether you give this one, wether you give one of the previous, assuming it is linked to the right device.

----------

## ruckles

Sorry, I meant to say device:/dev/cdrom.

----------

## pamplemousse

Hello,

On my computer, I have an IDE cdrom reader and a SCSI CDR writer. I use this post to try to use my IDE cdrom without SCSI emulator. But it didn't work for me. So I decided to go back to previous configuration, by modifying config files for another time. But now, my cdrom reader freezes when I want to mount a cdrom. And 1 or 2 min. after that, all my computer freezes.  I get this from cdrecorder (after a long time scan):

```

cdrecord dev=ATAPI -scanbus 

Cdrecord-Clone 2.01a25 (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jörg Schilling

scsidev: 'ATAPI'

devname: 'ATAPI'

scsibus: -2 target: -2 lun: -2

Warning: Using ATA Packet interface.

Warning: The related libscg interface code is in pre alpha.

Warning: There may be fatal problems.

Using libscg version 'schily-0.8'.

scsibus0:

        0,0,0     0) 'MITSUMI ' 'CD-ROM FX320S !B' 'q01 ' Removable CD-ROM

        0,1,0     1) *

        0,2,0     2) *

        0,3,0     3) *

        0,4,0     4) *

        0,5,0     5) *

        0,6,0     6) *

        0,7,0     7) *

scsibus1:

        1,0,0   100) *

        1,1,0   101) 'YAMAHA  ' 'CDR400t         ' '1.0q' Removable CD-ROM

        1,2,0   102) *

        1,3,0   103) *

        1,4,0   104) *

        1,5,0   105) *

        1,6,0   106) *

        1,7,0   107) *

```

But scan in XCDRoast seems not to work and XCDroast freezes.

My SCSI CD burner works correctly, I can burn CD with no problems.  I have tried with and without SCSI emul. support in kernel. No success. The link /dev/cdroms/cdrom0 points to ide/host0/bus1/target0/lun0/cd. What sort of thing should I verify?

Here my devfsd.conf:

```

# 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.16 2003/05/18 21:51:34 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        ^log         IGNORE

CHANGE          ^log         IGNORE

CREATE          ^log         IGNORE

DELETE          ^log         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

# Autoload the sg module if generic scsi driver compiled as module.

#LOOKUP          ^sg$      MODLOAD ACTION sg

# 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        ^scsi/host.*/bus.*/target.*/lun.*/generic    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)

# 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

# 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

# Support additional config installed by packages ...

INCLUDE /etc/devfs.d

```

Thanks for any advice.

----------

## Massimo B.

As of today, what is required in the kernel?

```
# cdrecord -scanbus

Cdrecord-ProDVD-ProBD-Clone 3.02a09 (x86_64-pc-linux-gnu) Copyright (C) 1995-2016 Joerg Schilling

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

I have:

```
# zgrep SCSI /proc/config.gz |grep -v "^#"

CONFIG_BLK_SCSI_REQUEST=y

CONFIG_SCSI_MOD=y

CONFIG_SCSI=y

CONFIG_SCSI_DMA=y

CONFIG_SCSI_MQ_DEFAULT=y

CONFIG_SCSI_PROC_FS=y

CONFIG_SCSI_CONSTANTS=y

CONFIG_SCSI_SPI_ATTRS=y

CONFIG_SCSI_LOWLEVEL=y
```

----------

## NeddySeagoon

Massimo B.

You need CONFIG_CHR_DEV_SG=y

Optical writers appear as two devices.

A character device for control and a block device for data. You need to be in the cdrom group to write optical media.

----------

## Massimo B.

Thank you very much. The question was about xcdroast, in the meanwhile I found that k3b is working fine. Just for understanding, how can k3b work with the writer without the kernel support?

----------

## Massimo B.

 *NeddySeagoon wrote:*   

> You need CONFIG_CHR_DEV_SG=y

 That one was built as module, but not loaded. As it does not seem to be auto-loaded, I'm going to add it to /etc/conf.d/modules.

----------

