LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   SCSI emulation: how can I know if its being used? (https://www.linuxquestions.org/questions/slackware-14/scsi-emulation-how-can-i-know-if-its-being-used-903625/)

stf92 09-17-2011 11:18 PM

SCSI emulation: how can I know if its being used?
 
kernel 2.6.21.5, slackware 12.0

Hi:
How could I know if the OS uses scsi emulation or not?
How can I know

frieza 09-17-2011 11:56 PM

type 'mount'
if your devices (including any IDE devices) are listed as /dev/sdX and they aren't scsi then probably scsi emulation is being used, though i believe this is default for most distributions, even LFS uses scsi emulation these days.

tristezo2k 09-18-2011 12:04 AM

There are AFAIK three ways to think scsi in the linux kernel
- The true scsi, that is a hardware piece that acts as an scsi target such as those adaptec.
- the sg devices, that is some devices are accessed using scsi commands such as midi, synthetizers, and such
- the scsi to ata layer.
I am not sure if this is a good way to put it, but is what comes to my mind now :)
So, short answer, more or less all the disk you have are accessed using scsi commands, that translates to the native commands.

Out of boredom I have just setup a debian 6.0 64bits vm at virtualbox.
I added PATA, Sata (AHCI), 2 x true scsi (lsilogic and buslogic), a SAS controller and one iscsi device. This is the lsscsi output
This are the kernel names for the disks
root@debian:~# lsscsi -k
[0:0:0:0] disk VBOX HARDDISK 1.0 /dev/sdb
[1:0:0:0] disk ATA VBOX HARDDISK 1.0 /dev/sda
[2:0:0:0] cd/dvd VBOX CD-ROM 1.0 /dev/sr0
[3:0:0:0] disk ATA VBOX HARDDISK 1.0 /dev/sdc
[4:0:0:0] disk VBOX HARDDISK 1.0 /dev/sdd
[5:0:0:0] disk VBOX HARDDISK 1.0 /dev/sde
[6:0:0:0] disk OPNFILER VIRTUAL-DISK 0 /dev/sdf

And this are the "hosts"
root@debian:~# lsscsi --hosts -v
[0] BusLogic
dir: /sys/class/scsi_host/host0
device dir: /sys/devices/pci0000:00/0000:00:15.0/host0
[1] ata_piix
dir: /sys/class/scsi_host/host1
device dir: /sys/devices/pci0000:00/0000:00:1f.1/host1
[2] ata_piix
dir: /sys/class/scsi_host/host2
device dir: /sys/devices/pci0000:00/0000:00:1f.1/host2
[3] ahci
dir: /sys/class/scsi_host/host3
device dir: /sys/devices/pci0000:00/0000:00:1f.2/host3
[4] mptspi
dir: /sys/class/scsi_host/host4
device dir: /sys/devices/pci0000:00/0000:00:14.0/host4
[5] mptsas
dir: /sys/class/scsi_host/host5
device dir: /sys/devices/pci0000:00/0000:00:16.0/host5
[6] iscsi_tcp
dir: /sys/class/scsi_host/host6
device dir: /sys/devices/platform/host6

As you can see sata, sas, iscsi, and ahci devices are mapped to a virtual scsi device and accessed as SCSI.
Thanks for letting me play with this a while. It had been a while since I had had so much fun :)

Regards
Sebastian

stf92 09-18-2011 12:22 AM

Hi: and thanks for your post. I think slackware does not mount optical media at boot. My problem is cdrecord, which does not recognize the device. But I solved it this way, for the time being at least. Notice I'm using slack 9.1 and current is 13.x:

a) I added line 'append= "hdc=ide-scsi" in lilo.conf
b) I made the soft links
/dev/cdrom -> /dev/hdc -> /dev/scd0

Now I run 'cdrecord -toc dev=0,0,0' and this does it. But I'm not convinced about b) being necessary.


All times are GMT -5. The time now is 06:16 PM.