# Enabling IDE-SCSI emulation for IDE CD-RW

## brent_weaver

Hello all... I am trying to use my IDE CDRW for burning CD's via cdrecord command line util. I beleve that I need to recompile my kernel to enable SCSI CDROM suppot???!!! Beyond that I {believe} I need to edit /etc/modules.conf with an alias.

If this is correct please tell me exactly what I need to put it /etc/modules.conf, if not please set me straight. My cdrom drive is /dev/cdrom.

Any help is appreciated! Gentoo rocks!

----------

## UB|K

I don't know if you have to modify something in modules.conf... i'd rather add something like "/dev/hdx=ide-scsi" as a kernel boot option in grub.conf (or lilo). Maybe someone can confirm that since in not sure...

Anyway, if you use a 2.6 kernel, you don't need ide-scsi emulation to use an IDE cd-burner

----------

## adaptr

- what kernel version ?

- genkernel or manual ?

- no, your cd drive is not /dev/cdrom - that's a link.

Anyway, regardless - the kernel needs ide-scsi, sg and sr to burn cd-rw's.

(Not even sure about the sr, but it seems logical).

----------

## brent_weaver

Kernel - Linux emperor 2.6.9-gentoo-r1 #3 SMP Thu Feb 24 10:40:34 EST 2005 i686 Pentium III (Katmai) GenuineIntel GNU/Linux

Manual kernel. What does it matter if I refer to /dev/cdrom as opposed to /dev/hdd? I have never seen a case where using the link was a problem. Please advise!

----------

## adaptr

Because you have to tell the kernel which device is the ide-scsi drive - and it has to be the real device name.

See your first reply above for how.

----------

## brent_weaver

The following is my grub config file:

emperor dev # cat /boot/grub/grub.conf

default 0

timeout 5

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

title=Gentoo 2.6.9-gentoo-r1

root (hd0,0)

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

I recompiled my kernel to unclude SCSI CSROM Support. What more do I need to do?

emperor dev # cdrecord --scanbus

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

cdrecord: Warning: Running on Linux-2.6.9-gentoo-r1

cdrecord: There are unsettled issues with Linux-2.5 and newer.

cdrecord: If you have unexpected problems, please try Linux-2.4 or Solaris.

cdrecord: Warning: Linux-2.6.8 introduced incompatible interface changes.

cdrecord: Warning: SCSI transport does no longer work for suid root programs.

cdrecord: Warning: if cdrecord fails, try to run it from a root account.

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

cdrecord: For possible targets try 'cdrecord -scanbus'.

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

do I need to specify "append /dev/hdc=ide-scsi"? Some info that I got said that w/ grub you do not include the "append".

Help!

----------

## hw-tph

It's hdc=ide-scsi, not the full device name. Plus, you need to load the ide-scsi module: Add it on a line of its own to /etc/modules.autoload.d/kernel-${VERSION} (where ${VERSION}=2.6 if you use a 2.6 series kernel). And have SCSI CD-ROM support in the kernel too.

Håkan

----------

## brent_weaver

thanks for the info - however I do not want to load any modules, I want them to be part of the kernel. Is that possibe? if so what is the kernel option in menuconfig I need to set!

Thanks for the help!

----------

## ebichu

CONFIG_BLK_DEV_IDESCSI

In menuconfig for a 2.4 kernel:

ATA/IDE/MFM/RLL support --> IDE, ATA and ATAPI Block devices --> SCSI emulation support

----------

## brent_weaver

cdrecord still does not return a SCSI dev :

emperor root # cat /boot/grub/grub.conf

default 0

timeout 5

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

title=Gentoo 2.6.9-gentoo-r1

root (hd0,0)

kernel /boot/bzImage root=/dev/hda3

hdc=ide-scsi

I recompiled the kernel accordingly - enabling SCSI emulation as a static module. What gives?

emperor root # cdrecord -scanbus 

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

cdrecord: Warning: Running on Linux-2.6.9-gentoo-r1

cdrecord: There are unsettled issues with Linux-2.5 and newer.

cdrecord: If you have unexpected problems, please try Linux-2.4 or Solaris.

cdrecord: Warning: Linux-2.6.8 introduced incompatible interface changes.

cdrecord: Warning: SCSI transport does no longer work for suid root programs.

cdrecord: Warning: if cdrecord fails, try to run it from a root account.

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

cdrecord: For possible targets try 'cdrecord -scanbus'.

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

----------

## NeddySeagoon

brent_weaver,

ATAPI burning works under 2.6 kerenls, SCSI emualtion is no longer essential.

Check your dmesg to see if your CD-RW has been detected as a SCSI device, thike this

```
Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0,  type 0
```

```
ide-scsi is deprecated for cd burning! Use ide-cd and give dev=/dev/hdX as device

scsi2 : SCSI host adapter emulation for IDE ATAPI devices

  Vendor: SONY      Model: DVD RW DW-D22A    Rev: BYS1

  Type:   CD-ROM                             ANSI SCSI revision: 02

sr0: scsi3-mmc drive: 48x/48x writer cd/rw xa/form2 cdda tray

Uniform CD-ROM driver Revision: 3.20

Attached scsi CD-ROM sr0 at scsi2, channel 0, id 0, lun 0

Attached scsi generic sg2 at scsi2, channel 0, id 0, lun 0,  type 5
```

if you don't have lines like that, your kernel is broken.

----------

## brent_weaver

The following is from my dmesg screen:

```

Probing IDE interface ide0...

hda: Maxtor 91366U4, ATA DISK drive

hdb: Maxtor 91024D4, ATA DISK drive

ide0 at 0x1f0-0x1f7,0x3f6 on irq 14

Probing IDE interface ide1...

[u][b]hdc: CRD-8400B, ATAPI CD/DVD-ROM drive[/b][/u]

hdd: CD-RW CRX100E, ATAPI CD/DVD-ROM drive

hdc: Disabling (U)DMA for CRD-8400B (blacklisted)

ide1 at 0x170-0x177,0x376 on irq 15

Probing IDE interface ide2...

ide2: Wait for ready failed before probe !

Probing IDE interface ide3...

ide3: Wait for ready failed before probe !

Probing IDE interface ide4...

ide4: Wait for ready failed before probe !

Probing IDE interface ide5...

ide5: Wait for ready failed before probe !

hda: max request size: 128KiB

hda: 26588016 sectors (13613 MB) w/2048KiB Cache, CHS=26377/16/63, UDMA(33)

hda: cache flushes not supported

 /dev/ide/host0/bus0/target0/lun0: p1 p2 p3

hdb: max request size: 128KiB

hdb: 19999728 sectors (10239 MB) w/512KiB Cache, CHS=19841/16/63, UDMA(33)

hdb: cache flushes not supported

 /dev/ide/host0/bus0/target1/lun0: p1

[/b][/u]hdc: ATAPI 40X CD-ROM drive, 128kB Cache[/b][/u]

Uniform CD-ROM driver Revision: 3.20

hdd: ATAPI 24X CD-ROM CD-R/RW drive, 1024kB Cache, DMA

Loading Adaptec I2O RAID: Version 2.4 Build 5go

Detecting Adaptec I2O RAID controllers...

ipr: IBM Power RAID SCSI Device Driver version: 2.0.11 (August 3, 2004)

libata version 1.02 loaded.

ieee1394: raw1394: /dev/raw1394 device initialized

USB Universal Host Controller Interface driver v2.2

PCI: Found IRQ 11 for device 0000:00:07.2

PCI: Sharing IRQ 11 with 0000:00:11.0

```

I do not see any indication of:

```
Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0,  type 0
```

Help - what am I missing!

----------

## NeddySeagoon

brent_weaver,

One of these is your writer ?

```
Probing IDE interface ide1...

[u][b]hdc: CRD-8400B, ATAPI CD/DVD-ROM drive[/b][/u]

hdd: CD-RW CRX100E, ATAPI CD/DVD-ROM drive 
```

You need to add  hdc=ide-scsi or  hdd=ide-scsi to your kernel command line in grub to stop

the ide system grabbing the drive.

You also need to include scsi Cd rom in your kernel along with ide-scsi and scsi-generic.

When your kernel command line is right, the writer will vanish from /dev/hd?

When your kernel modules are loaded it will appear as a SCSI device

----------

## brent_weaver

My /boot/grub/grub.conf is as follows:

```

emperor installs # cat /boot/grub/grub.conf

default 0

timeout 5

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

title=Gentoo 2.6.9-gentoo-r1

root (hd0,0)

kernel /boot/bzImage root=/dev/hda3

hdc=ide-scsi

```

I have already recompiled my kernel with SCSI emulation (I do not want to load any modules if possible). What am I missing?

----------

## UB|K

hdc=ide-scsi  should be on the same line of kernel...

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

----------

## brent_weaver

the open src community rocks!!!

Thank you all!

----------

## hw-tph

 *UB|K wrote:*   

> hdc=ide-scsi  should be on the same line of kernel...
> 
> ```
> kernel /boot/bzImage root=/dev/hda3 hdc=ide-scsi 
> ```
> ...

 

Read the dmesg output again - with hdc you're enabling ide-scsi on the DVD-ROM:

 *brent_weaver wrote:*   

> 
> 
> ```
> hdd: CD-RW CRX100E, ATAPI CD/DVD-ROM drive 
> ```
> ...

 

So the line should be something like this:

```
kernel /boot/bzImage root=/dev/hda3 hdd=ide-scsi
```

Håkan

----------

## eandry

 *brent_weaver wrote:*   

> Kernel - Linux emperor 2.6.9-gentoo-r1 #3 SMP Thu Feb 24 10:40:34 EST 2005 i686 Pentium III (Katmai) GenuineIntel GNU/Linux

 

 *UB|K wrote:*   

> Anyway, if you use a 2.6 kernel, you don't need ide-scsi emulation to use an IDE cd-burner

 

If that's the case, then why was brent_weaver continuously told to use "hdd=ide-scsi"?

I have a similar problem and I am using 2.6.11.  Whenever I insert a DVD-ROM in my CDRW/DVD-ROM drive.  I try to mount the CD, it returns "mount: no medium found".  Regular CDs and CDRs are recognized just fine.  If I remember correctly I have SCSI CDROM compiled in the kernel or as a module.

I will post relevant configuration files when I get home but thought this might be something stupid and a quick fix can be recommended.

TIA

** EDIT **

Here is some configuration items that may help diagnose my problem:

line from fstab:

 *Quote:*   

> /dev/hdc                /media/cdrecorder       auto    exec,user,noauto,managed 0 0

 

output of lsmod:

 *Quote:*   

> # lsmod
> 
> Module                  Size  Used by
> 
> pktcdvd                26428  0
> ...

 

output of dmesg when inserting and accessing a DVD+R

 *Quote:*   

> hdc: SD-R2102, ATAPI CD/DVD-ROM drive
> 
> hdc: ATAPI 24X DVD-ROM CD-R/RW drive, 2048kB Cache, DMA
> 
> hdc: packet command error: status=0x51 { DriveReady SeekComplete Error }
> ...

 

Also, I'm NOT using append="hdc=ide-scsi".  Regular DVD movies, CDR, and CDRWs work fine.

*** EDIT ***

I started this thread for my issue.  I've been away on travel for a few days but will add more with my latest findings tonight.Last edited by eandry on Wed Apr 06, 2005 3:53 pm; edited 1 time in total

----------

## thoughtform

i'm having troubles with this too

cdrecord -scanbus returns

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

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

i've compiled scsi cd-rom support in my kernel

i've compiled ide scsi emulation as a module and loaded it automatically at boot

i've appended hdb=ide-scsi to the kernel line of my grub.conf

here's my dmesg

ide-scsi is deprecated for cd burning! Use ide-cd and give dev=/dev/hdX as device

scsi2 : SCSI host adapter emulation for IDE ATAPI devices

  Vendor: DVDRW     Model: IDE1008           Rev: 0055

  Type:   CD-ROM                             ANSI SCSI revision: 02

Linux teh 2.6.11-gentoo-r5 #1 Fri Apr 1 23:42:10 EST 2005 i686 AMD Athlon(tm) XP 1800+ AuthenticAMD GNU/Linux

manual kernel config, udev

----------

## Cintra

Eandry

 *Quote:*   

> Here is some configuration items that may help diagnose my problem:
> 
> line from fstab:
> 
> Quote:
> ...

 

you are missing rw

mvh

----------

## xbmodder

try ATAPI

```

cdrecord -dev=ATAPI -scanbus

cdrecord -dev=ATAPI:(Device) (ISO)

```

use a newer kernel

----------

## piewie

 *Scorpaen wrote:*   

> 
> 
> cdrecord -scanbus returns
> 
> Cdrecord 1.11a15 (i686-pc-linux-gnu) Copyright (C) 1995-2001 Jörg Schilling
> ...

 

Your cdrtools are older than my grandmother.

----------

## eandry

 *Cintra wrote:*   

> 
> 
>  *eandry wrote:*   /dev/hdc /media/cdrecorder auto exec,user,noauto,managed 0 0 <<<<<<
> 
>  
> ...

 

Why is "rw" necessary if "auto" is specified?  I'm trying to mount a data DVD, not a CDRW.  The CD drive can't burn DVDs just CDRWs.  I haven't had a chance to try CDRW burning yet either.

----------

## Cintra

From 'man mount'

 *Quote:*   

> rw     Mount the file system read-write

 

----------

## Lanthanum

Hi,

First question: Is there a how-to for ide cdrw/dvdrw that I can walk through?

Second Question:

I added the hdc=ide-scsi and now my drive shows up with cdrecord -scanbus. 

When I attempted to burn with this drive under ATAPI it would lock up the cdrecord task

could not even kill -9 it.

When I tried to burn under SCSI it did not lock up the task, but the drive 

had some kind of DMA failure, and was removed from the SCSI list.

I have added cdrom0="-d0" to /etc/conf.d/hdparm but have not tried to burn yet.

Should this work or am I way off track?

-Lanthanum

----------

## NeddySeagoon

Lanthanum,

hdparm only works for IDE devices. With your IDE CD/RW attached as SCSI, hdparm cannot see it any longer.

Search the Linux Documentaion Project for the CDRW HOWTO. (Don't quote me on the name). It was written around 2.2/2.4 kernels but its still correct for 2.6

----------

## Lanthanum

I am up an burning now, Joy is mine!

Neddy you were correct, it did not appear in my hdparm drives when it was ide-scsi

Here is what I needed to do.

on my kernel line I used hdc=ide-cd

and then in /etc/conf.d/hdparms 

cdrom0_args="-d0"

At the command line I started hdparms

/etc/init.d/hdparms start

added it to the rc list

rc-update add hdparms default 

and then burned CD CDRW and DVD-RW with k3b

I have kernel 2.6.11-r5 and 

Cdrecord-Clone 2.01.01a01 (i686-pc-linux-gnu) Copyright (C) 1995-2004 JÃ¶rg Schilling

Cdrecord-ProDVD-Clone 2.01.01a01 (i686-pc-linux-gnu) Copyright (C) 1995-2004 JÃ¶rg Schilling

K3b: 0.11.20

I think my problems were mainly with the drive itself, DMA issues

Here are the two lines out of dmesg.  

hdc: DVD-RW IDE1004, ATAPI CD/DVD-ROM drive

hdc: ATAPI 40X DVD-ROM DVD-R CD-R/RW drive, 2048kB Cache

I dont remember what it brand it was, Staples special. I'll post the drive info when I find it, this

thing would not run in the USB case I have (which my cdrw  burner is working without issue as generic scsi)

which is another shortfall of this cheapo DVD+-RW drive.

-Lanthanum

----------

## NeddySeagoon

Lanthanum,

That hdparm command won't do anything for you. To make DMA work with emulated SCSI CD/DVD burning, you have to get DMA set up in the kernel, so its the default.

----------

## Gentree

Ah that's interesting.

I take it this is what you are refering to:

 ATA/ATAPI/MFM/RLL support 

```

[*]     PCI IDE chipset support                                     

  [*]       Sharing PCI IDE interrupts support                       

  [ ]       Boot off-board chipsets first support                    

  <*>       Generic PCI IDE Chipset Support                           

  < >       OPTi 82C621 chipset enhanced support (EXPERIMENTAL)         

  < >       RZ1000 chipset bugfix/support                            

  [*]       Generic PCI bus-master DMA support                         

  [ ]         Force enable legacy 2.0.X HOSTS to use DMA                

  [*]         Use PCI DMA by default when available                    

    [ ]           Enable DMA only for disks                              

 
```

I still use ide-scsi on 2.6.9 because if I use ATA cdrecord throws out warnings about "no DMA at all"

Jorg Schillig seems to be at war with linux kernel devs which is a shame since his cdrecord seems to be the defacto std in cd/dvd recording.

I am unable to get cdrecording to work with ide-scsi on 2.6.11 , so I need to reboot every time I want to burn a CD.

What would you suggest?

TIA.  :Cool: 

----------

## NeddySeagoon

Gentree,

As well as the items in your post, you also need your chip set selected further down that menu.

I can't get SCSI emulation buring to work in 2.6.11 either. Dispite SCSI Emualtion being selected, I did a device scan and X-CD-Roast only found the ATAPI devices, which worked, much to my surprise.

----------

## NeddySeagoon

Gentree,

As well as the items in your post, you also need your chip set selected further down that menu.

I can't get SCSI emulation buring to work in 2.6.11 either. Dispite SCSI Emualtion being selected, I did a device scan and X-CD-Roast only found the ATAPI devices, which worked, much to my surprise.

----------

## Gentree

Thanks,

did you get the usual warings about long wait and poor performance when you used ide devices.

I dont even know if this is current or is just part of the cdwr wars.

Since just about every front end , including k3b , uses cdrecord it looks like this is not going to go away.

I find this side of Gentoo a serious liability. I have to deal with configuring every damn then do it all again 3 motnths later when a new kernel minor upgrade  comes out.

I have not even started to look at dvd , cdrw and doing any/all of that as user.

Every Gentoo user should get the title "dev".

In short , do you know if we risk under-runs or other probs if using ide-cd?

Thx  :Cool: 

----------

## NeddySeagoon

Gentree,

I think the dire warnings aboout no DMA are just old messages that are no longer true. I get 20x, which is the limit imposed by my media, with no buffer under runs. It was true in the early days of ATAPI writing that DMA was not supported.

I have my grub.conf set up to use either emulated-scsi or ATAPI writing (boot time choice) but there is little to choose between them now.

----------

## Gentree

Thanks for your comments . I have made too many frizbees in the past to just try all possibilities.

I got the feeling that the warning were redundant but they are still there in the lastest version so it seemed a bit stupid to ignore them.

I have the same as you in grub bit its a pain to reboot if I need the cdr.

Anyway I did a 4x on ide-cd lastnight and after what you say I'll stick with it till it fails.

Seems that, rightly or wrongly , Jorg Shillig has an axe to grind with kernel devs

Thanks again, it was a great help you were able to confirm my intuition about the msgs.

 :Cool: 

Burn, baby burn!

----------

## Lanthanum

 *NeddySeagoon wrote:*   

> Lanthanum,
> 
> That hdparm command won't do anything for you. To make DMA work with emulated SCSI CD/DVD burning, you have to get DMA set up in the kernel, so its the default.

 

I am missing why this would not actually work, partly because I can burn now.

First I am now using ide-cd which I do not know the relationship to ide-scsi

Secondly I am attempting to DISABLE DMA on this drive since there is some

problem with the DMA on the drive itself.

hdparm is applied after the kernel is up and should override whatever parameters 

the kernel has compiled as defaults. No?

-Lanthanum

----------

## Gentree

I think what was meant is that using hdparm after booting a kernel with ide-scsi boot option will not affect DMA on a scsi emulated drive because you cannot adress it as /dev/hdx .

If you have DMA enabled in your kernel it _may_ get activated before the ide-scsi layer gets loaded and therefore would be effective . The earlier post suggests that would be the case, I cannot comment.

If you have not select SCSI emulation for CDROM in your kernel that does not affect you.

If you have set up /etc/conf.d/hdparm that should disable DMA as you expect. That is not always configured so it is not always applied after the kernel loads as you assumed in your comment.

So you weren't missing anything , just misinterpreting what was posted .

HTH.  :Cool: 

btw if you see in my earlier post there is a kernel option 

```
 Enable DMA only for disks 
```

 that is designed to deal with that sort of pb. , although targetting that device with hdparm is more precise in your case.

----------

## NeddySeagoon

Lanthanum,

When you use SCSI emualtion for an IDE drive, (lets call it /dev/hdc), then /dev/hdc does not exist.

Setting up DMA requires changes to the the drive and chip set registers. hdparm works via  the device special file for the IDE drive, which is now missing, so it cannot set any parameters for that drive.

Setting DMA for a SCSI drive, even an emulated SCSI drive is not a valid thing to do, so hdparm is ineffective.

You can choose the DMA defualt state at kernel compile time - it applies to all your IDE interfaces.

----------

