# Please someone clear this up: IDE-SCSI && kernel

## Rhiz()m3

I have read hella posts on the subject and conceptually scsi emulation is not that difficult.  But nowhere can I find anything telling exactly which things to add to the kernel and whether or not they should be modulized or compiled in.  Can someone puleaze tell me exactly which and how.  Sorry for being such a choad, but I've already rebuilt my kern 3 times to no avail.

----------

## rac

On my machine with SCSI emulation only (no real SCSI host adaptor), I have under ATA/IDE support, SCSI emulation support.  Under SCSI support, SCSI support, SCSI CD-ROM support, SCSI generic support.  No SCSI low-level drivers.  All of the above are in the kernel; nothing is made as a module.

----------

## Rhiz()m3

does that mean that under ATA/IDE you do not have IDE CDROM SUPPORT?  Instead, the SCSI CDROM creates /dev/cdroms/cdromx?

----------

## rac

 *Rhiz()m3 wrote:*   

> does that mean that under ATA/IDE you do not have IDE CDROM SUPPORT?

 

Correct.  CONFIG_BLK_DEV_IDECD is not set.

 *Quote:*   

> Instead, the SCSI CDROM creates /dev/cdroms/cdromx?

 

Yes. 

```
$ ls -al /dev/cdroms/cdrom0 

lr-xr-xr-x    1 root     root           34 Dec 31  1969 /dev/cdroms/cdrom0 -> ../scsi/host0/bus0/target0/lun0/cd
```

----------

## Rhiz()m3

man, thank you so much..  you've done your good deed for the day.  :Idea: 

----------

## TheCoop

if you dont compile ide cdrom support, do you need to specify hdd=scsi on the kernel command line?

----------

## rac

 *TheCoop wrote:*   

> if you dont compile ide cdrom support, do you need to specify hdd=scsi on the kernel command line?

 

I pass hdd=ide-scsi, and I haven't tried it without.

----------

## TheCoop

hdd=scsi works as well

----------

## karl11

Reason being it's still on the ide bus. It's just that you don't have support for a CD drive on the ide bus. I personally run both ide cdrom support and ide-scsi emulation (for my burner) and it's never failed me yet. Works quite well, but on a system level(below OS), it's still an ide device, and thus at kernel load is still mapped as one. The module ide-scsi doesn't load until the boot is almost done anyway.

Karl

----------

## dantrevino

I've done this before and cant figure why I'm having problems.  I've verifed all my kernel settings.  hdd=ide-scsi is being passed to the kernel.  The following is a snippet from dmesg:

====================================

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

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

=====================================

When I run gcombust I get this error message:

======================================

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

TOC Type: 1 = CD-ROM

scsidev: '0,0,0'

scsibus: 0 target: 0 lun: 0

/usr/bin/cdrecord: Read-only file system. Cannot open '/dev/pg0'. Cannot open SCSI driver.

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

=====================================

I've tried adding /dev/sr0 to the override box with no luck.

cdrecord -scanbus gives this output:

=====================================

bash-2.05a$ cdrecord -scanbus

Cdrecord 1.11a34 (i686-pc-linux-gnu) Copyright (C) 1995-2002 Jrrg Schilling

cdrecord: Read-only file system.   Cannot open '/dev/pg0'.  Cannot open SCSI driver.

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

====================================

Of course there is no /dev/pg0, but /dev/sr0 exists as a link:

lr-xr-xr-x    1 root     root          31 Sep 27 04:15 /dev/sr0 -> scsi/host0/bus0/target0/lun0/cd

What is the difference between pg*, sg*, or sr*?  Previously my cdrw was showing up as sg0.  Any ideas anyone?  ....Anyone?

----------

## jay

I'm having problems too:

```

# cdrecord -scanbus

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

cdrecord: Read-only file system. Cannot open '/dev/sg0'. 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 looked up dmesg:

```

scsi0 : SCSI host adapter emulation for IDE ATAPI devices

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

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

root@xenon schitten #

```

I made sure that the kernel command line is passed correctly:

Kernel command line: root=/dev/hdb3 hdc=ide-scsi video=vesa:ywrap,mtrr vga=0x31A

When I try to mount it I get:

```

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

```

But in /etc/fstab i  set sg0 to rw !

Can anybod shed some light here?

----------

## dantrevino

 *jay wrote:*   

> I'm having problems too:
> 
> [code]
> 
> I made sure that the kernel command line is passed correctly:
> ...

 

Make sure /etc/devfsd.conf is setting permissions on /dev/sg0 to 660 for cdrw group (should be by default), and make sure you are in the cdrw group.  Also, just fyi, you no longer need scsi emulation for writing to cdrw.  You can use dev=ATAPI:x,y,z to access your drive, where x is bus, y is target, z is lun.

----------

## biroed

 *Quote:*   

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

 

You should use the sr0 device instead of sg0 in fstab, which is the generic support...

Be sure your modules are loaded

----------

## jay

Thanks, I changed the permissions and switched to sr0. The problem however persisted.

But I'm beginning to understand... a new version of cdrecord is out and now the device is treated as ATAPI:

```

# cdrecord dev=ATAPI -scanbus

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

        0,1,0     1) 'IDE     ' 'DVD-ROM 16X     ' '3.10' 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) *

scsibus1:

        1,0,0   100) 'ASUS    ' 'CRW-2410A       ' '1.0 ' Removable CD-ROM

        1,1,0   101) *

        1,2,0   102) *

        1,3,0   103) *

        1,4,0   104) *

        1,5,0   105) *

        1,6,0   106) *

        1,7,0   107) *

```

The latest xcdroast version is able to write on this device. However the interface is still alpha code, and audio cd writing doesn't work in DAO mode (TAO  worked fine).  How can I force the SCSI emulation on this 

device ?

----------

## biroed

are you sure you load the ide-scsi module?(and generic support)

If it's not loaded you get the errors like cannot open /dev/sg0.

----------

## Thetargos

I got my drives to work properly, but still need to find a way to load the ide-scsi module at start up. How would I do that?

EDIT: ATM I need to load the modules manually, to make cdrecord -scanbus detect my optical drives (otherwise it only detects my Paralell Zip drive)

----------

## jay

Yes I made sure that I loaded the ide-scsi module. There is no difference. If I remove the hdc=ide-scsi from the kernel command line, both devices are on the same bus, if I leave the line in both devices are on a different bus (see above).

But both are still treated as ATAPI ide devices.

----------

## jay

 *Thetargos wrote:*   

> I got my drives to work properly, but still need to find a way to load the ide-scsi module at start up. How would I do that?
> 
> 

 

YOu could just add a line into /etc/modules.autoload

----------

## Thetargos

Jay:

I tried, but in the first reboot I got a modprobe complaint about line 107 of modules.conf (via etc-update I think) which happens to reffer to a modprobe ide-scsi command and would not let me go into X environment. Odd thing here is that it only complaints when trying to initialize X. I have changed the runlevel to non-X and tried to startx (without commenting out the line about modprobing the modules in modules.conf) and I get the error in /var/log/XFree86.0.log stating that same line as in the start up check up. But after going into X if I manually load the module either by insmod or modprobe it would load, but wont be able to load at boot time  :Sad: 

----------

