# CD burning for dummies (SCSI Emulation - Standard Method)

## peaceful

MOD EDIT: Changed Title as was generating some confusion

After it took me a day and reading 4 separate posts on cd burning, I finally got my ATAPI CD Writer working nicely by using scsi emulation.  I thought I would post the steps I took to help out other CD burning dummies (like me).

THE UNDERLYING PROBLEM

cdrecord (and I presume other cdr tools for linux) want to use SCSI drivers.  Why?  I don't know.  Most of us probably have ATAPI CD Writers, so we need to be able to emulate a SCSI CD Writer with our ATAPI CD Writer.  Forunately, the kernel has modules that can do this for us.  Unfortunately, the kernel isn't set up properly by default.

PREREQUISITES/SETUP

- I used cdrecord to test and see if my CD writer could be detected. (emerge cdrtools)

- I am running on i686 compatible architecture with the gentoo-sources-2.4.20-r5 kernel.  EDIT:  If you are using a 2.6.x kernel or newer, there is probably a better way than scsi emulation.

- I have an ATAPI CD writer whose cables and jumpers are properly connected.

GETTING IT WORKING

1. Check if cdrecord --scanbus shows your ATAPI CD writer. If it does, then you are all set. Skip to the last step. (You might need to emerge cdrtools to get cdrecord)

2. If your CD writer doesn't show up, do lsmod and see if both ide-scsi and ide-cd show up.  

EDIT: 2a. Also, make sure to add a kernel option hdX=ide-scsi for every CD drive you want to use, where X is the letter of your drive.  You can find out what letter corresponds to your drives by examining the output of dmesg | grep hd

Here's my kernel section (hdc is my writer and hdd is my reader):

```
title Gentoo Linux CD Burning

root (hd0,1)

kernel (hd0,1)/bzImage.cd_record ro root=/dev/hda5 vga=795 hdc=ide-scsi hdd=scsi-hdd
```

3. If the modules from part 2 do show up (or if you can modprobe them) and you have booted with the kernel options from part 2a, but cdrecord --scanbus still doesn't show your drives, use rmmod (module name) and modprobe (module name) to get the ide-scsi module loaded below the ide-cd module (below meaning it shows up below the other when doing lsmod).

4. If they don't show up and you can't modprobe the modules in, then you need to recompile your kernel (see x86 installation guide if you don't know how) using (at least) the following options:

```

ATA/IDE/MFM/RLL support -> IDE, ATA, and ATAPI Block Devices -> <M> SCSI Emulation Support

SCSI support -> <M> SCSI support

SCSI support -> <M> SCSI CDROM support

SCSI support -> <M> SCSI generic support

```

5. It is important that all these options are selected as modules, because they probably won't be loaded in the right order by default regardless of whether they are 'compiled in' or 'compiled as modules.'  Compiling them as modules makes it so you can have some level of control over how and when they are loaded. With these all selected as modules, you should be able to use most Linux CD recording tools that rely on SCSI drivers or SCSI emulation drivers. In other words, now you will be able tell linux to pretend that your ATAPI CD writer is a SCSI CD writer.

6. Recompile the kernel (see the x86 installation guide or somewhere else for more info on kernel stuff):  make dep && make clean bzImage modules modules_install

7. Make sure that your boot partition is mounted, then cp /usr/src/linux/arch/i386/boot/bzImage /boot/(pick a name for your kernel)

8. edit /boot/grub/grub.conf (or whatever boot loader you use) to reflect the changes.  (you remembered the kernel options from part 2a, right?)

9. reboot

10. Go repeat steps 1, 2 and 3 until the CD writer shows up.

11. To get it to work automatically on boot up, I added ide-scsi to /etc/modules.autoload, which makes it appear below ide-cd automatically on boot up.

12. Once it shows up, you can use cdrecord from the command line (you are on your own there), or, if you like nice GUI programs I highly recommend using k3b (emerge k3b), for KDE.  It is very similar to CD Recording programs that you would find on Windoze from companies with funny names like Roxio or Nero. 

Happy Burning!Last edited by peaceful on Wed Nov 05, 2003 3:17 am; edited 2 times in total

----------

## GentooBox

Thanks, nice to have.

----------

## Anime_Fan

With kernel 2.6 coming, this info will become (eventually) obselete...

With only ATAPI CDROM compiled into the kernel, you just:

cdrecord dev="/dev/hda" -scanbus

Also, shouldn't this go into documentation/tips&tricks?

----------

## puggy

 *Anime_Fan wrote:*   

> Also, shouldn't this go into documentation/tips&tricks?

 

Indeed it should as it looks nice and simple.

Moving to Docs, Tips & Tricks. Cheers. Puggy

----------

## choco

It's a good guide, for the information that's there, and I followed it to the letter.

But it was only after looking at the x86 Installation doc (which this guide points to) that I found out I had to add a boot parameter: 

hd? = ide-scsi

Worked great after that.  Thanks.

----------

## puggy

 *choco wrote:*   

> It's a good guide, for the information that's there, and I followed it to the letter.
> 
> But it was only after looking at the x86 Installation doc (which this guide points to) that I found out I had to add a boot parameter: 
> 
> hd? = ide-scsi
> ...

 

Your not using ATAPI burning at all if you added that. Your using SCSI-emulation, which is fine, but not what this thead is about....  :Very Happy: 

Puggy

----------

## bsolar

 *puggy wrote:*   

> Your not using ATAPI burning at all if you added that. Your using SCSI-emulation, which is fine, but not what this thead is about.... 

 

Actually the thread is not about ATAPI burning but about using an IDE writer with SCSI emulation.

IMHO the tiltle should be modified I think it's misleading now.

----------

## puggy

Actual ATAPI burning thread split

Support Request split

Puggy

----------

## vibidoo

Dear ALL 

I had following this how to and applied in the kernel the right module according to this How-to .

But when I check the CDR W

```

#cdrecord --scanbus

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

 
```

I had modify my devfsd.conf too !!!

----------

## puggy

 *vibidoo wrote:*   

> Dear ALL 
> 
> I had following this how to and applied in the kernel the right module according to this How-to .
> 
> But when I check the CDR W
> ...

 

Editing your devfsd.conf should not be necesary. Have you got hdaX=ide-scsi in your boot line in grub/lilo? Where X is the cd writer device, e.g. hda2.

Puggy

----------

## vibidoo

Thanks 

it's works 

 :Wink: 

----------

## NorthGoingZax

Puggy *Quote:*   

> 
> 
> Editing your devfsd.conf should not be necesary. Have you got hdaX=ide-scsi in your boot line in grub/lilo? Where X is the cd writer device, e.g. hda2.
> 
> Puggy

 

can you give an example of the syntax for lilo ? Where do I put that line ?

----------

## puggy

 *NorthGoingZax wrote:*   

> Puggy *Quote:*   
> 
> Editing your devfsd.conf should not be necesary. Have you got hdaX=ide-scsi in your boot line in grub/lilo? Where X is the cd writer device, e.g. hda2.
> 
> Puggy 
> ...

 

You need to add an append line. My config looked like this (I've moved to grub now).

```
# Linux bootable partition config begins

        image = /boot/bzImage

        append= "hda=ide-scsi"

        root = /dev/hdi3

        label = Gentoo

        read-only # read-only for checking
```

For completeness in grub

```
title Gentoo 2.6

root (hd0,0)

kernel (hd0,0)/bzImage root=/dev/hdi3 hda=ide-scsi
```

Puggy

----------

## peaceful

Thanks puggy and all for the kernel option stuff.  Weird enough, the first computer I figured all this stuff out on worked fine without the kernel options.

However, the second computer I did this on wouldn't work until I added them.  Odd, eh?

Anyway, I added the kernel option stuff as step 2a.

----------

## SubAtomic

Always had hdd=ide-scsi on my kernel line for my gentoo o/s in grub.conf and could never figure out why burning never worked (cdrdao doesnt support atapi blah blah blah) .... then I came across this little gem of a piece of info from peaceful

 *peaceful wrote:*   

> 
> 
> 11. To get it to work automatically on boot up, I added ide-scsi to /etc/modules.autoload, which makes it appear below ide-cd automatically on boot up.
> 
> Happy Burning!

 

Thank you so very much.

----------

## peaceful

 *SubAtomic wrote:*   

> Always had hdd=ide-scsi on my kernel line for my gentoo o/s in grub.conf and could never figure out why burning never worked (cdrdao doesnt support atapi blah blah blah) .... then I came across this little gem of a piece of info from peaceful
> 
> ...
> 
> Thank you so very much.

 

You're welcome!

It's always nice to get things working.  :Smile: 

----------

## vbenares

Thanks for the tutorial.  I have been trying to get Nautilus cd-burner to work for months.  I followed your directions and finally have my cdrw as an option in the cd-burner drop down menu.  Hooray.  

Unfortunately, I don't seem to have the permissions set correctly on something - presumably /dev/sg0.  Am I right about the problem?  If so, to what should I set the permissions?  Should I give permission only to the cdrom group?

Here's the error message:

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

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

cdrecord: Permission denied. Cannot open '/dev/sg0'. Cannot open SCSI driver.

scsibus: 0 target: 0 lun: 0

scsidev: '0,0,0'

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

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

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

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

cdrecord: Operation not permitted. WARNING: Cannot do mlockall(2).
```

----------

## vbenares

Oops should have done a better search.  I needed to change the name of the cdrom group listed in my  /etc/devfsd.conf

----------

## bonedaddyhimself

I read the scsi emulation guide but still no go. I can execute cdrecord -- scanbus and my burner shows up on scsibus 1. I added hdc = ide-scsi to grub (which is my cd burner, i checked). I also added ide-scsi to /etc/modules.autoload. I creeated this file because I only had /etc/modules.autoload.d and still no go. My kernel options seem to be correct because scanbus works. 

But when I load k3b it still prompts me to enable scsi for my burner.

I changed my fstab so that sr0 is used instead of hdc.

Note: I do have a scsi cd-rom which is sr0 so I added sr1 to fstab as well.

What am I missing?

bd

----------

## blazer34i

I had the same problems as everyone else it seems.. Here are some snippits from my config files that finally made it work.. One note though be sure to run k3bsetup as root to apply the correct permissions to the devices and binaries... Also be sure to  mount /boot and rerun /sbin/lilo after modifying the lilo.conf, and reboot... This worked for me when nothing else did, now I can burn CD's as a "normal" user.

From /etc/lilo.conf

image = /boot/kernel-2.4.22-ac1

        label = Gentoo

        read-only

        initrd=/boot/initrd-2.4.22-ac1

        append="root=/dev/hde5 init=/linuxrc hda=scsi hdb=scsi"

## Where hda and hdb are my ATAPI CD devices(replace with yours), I happen to have a IDE Raid controller so my hard drives are actually hde and hdf

	From /etc/modules.conf

### modules-update: start processing /etc/modules.d/cdr

options ide-cd ignore='hda hdb'

### Ignores ATAPI devices hda and hdb

### modules-update: end processing /etc/modules.d/cdr

	From /etc/modules.autoload.d/kernel-2.4

probeall scsi_hostadapter ide-scsi ataraid

----------

## Bastux

Just to say :

If you tried the 2.6 and burning is not working anymore, juste recompile cdrtools with the last version :

```

ACCEPT_KEYWORDS="~x86" emerge cdrtools

```

----------

## blight01

Hello,

I would like to add something new to this useful posts...I encountered some problems during compiling my kernel with gcc version gcc (GCC) 3.3.2 20031218 (Gentoo Linux 3.3.2-r5, propolice-3.3-7)  running on my gentoo, version  2.4.20-gentoo-r6.

A error appeared at line 440 of the /usr/src/linux-2.4.20-gentoo-r6/drivers/ide/ide-cd.h file:

__u8 short slot_tabelen

In fact, this slot_tabelen can be found at another place, in the /usr/src/linux-2.4.20-gentoo-r6//include/linux/cdrom.h file but this is defined differently:

 __u16 slot_tablelen

You can either modified the first file either the second in order to have the same definition in both files. Once the same definition in both files, the compilation should work.

(link: http://lists.debian.org/debian-hppa/2003/debian-hppa-200301/msg00035.html/ )

@+,

Blight.

----------

## KenTI

really useful   :Very Happy: 

just one thing, is there a way to burn .nrg image files or .ccd files?

----------

## erickfq

I see here that the last cdrtools have atapi suport and i downloaded and probe it, with xcdroast, 

and all works fine, i can burn without scsi emulation, so try it

 :Laughing: 

----------

