SATA Devices in /proc/scsi/scsi – Why SATA Devices Show Up Under /proc/scsi/scsi

deviceslinuxsatascsi

I have 3 SATA devices on my system. They show up under /proc/scsi/scsi, although these are not SCSI devices. Why do my SATA devices show up under the SCSI directory?

$ cat /proc/scsi/scsi 
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: ATA      Model: WDC WD2500AAJS-6 Rev: 01.0
  Type:   Direct-Access                    ANSI  SCSI revision: 05
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: TSSTcorp Model: CDDVDW TS-H653Z  Rev: 4303
  Type:   CD-ROM                           ANSI  SCSI revision: 05
Host: scsi4 Channel: 00 Id: 00 Lun: 00
  Vendor: ATA      Model: ST3320620AS      Rev: 3.AA
  Type:   Direct-Access                    ANSI  SCSI revision: 05

Best Answer

They show up as SCSI devices because the drivers speak SCSI to the next kernel layer (the generic disk driver). This isn't actually true of all SATA drivers on all kernel versions with all kernel compile-time configurations, but it's common. Even PATA devices can appear as SCSI at that level (again, that depends on the kernel version and kernel compile-time configuration, as well as whether the ide-scsi module is used).

It doesn't really matter whether the driver speaks SCSI to the physical device. Often, it does. ATAPI, used for talking to PATA/SATA optical drives and other devices, is a SCSI-based protocol encapsulation. However, PATA/SATA disks don't use ATAPI. The libata set of drivers also includes a translator between the ATA command set and SCSI so that you can place PATA/SATA disks under the umbrella of the SCSI subsystem. The separate ide interface inside the kernel is more of a historical survivance.

You'll notice that USB disks also appear as SCSI, for the same reason (and they speak SCSI too on the USB bus). The same goes for Firewire.

Related Question