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

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.

  • Do many IDE devices speak SCSI, and do they show up under /proc/scsi? On another system, I have an IDE DVD drive which is listed under /proc/ide/hdb/model. Nov 10 '10 at 1:37
  • @Stefan: All non-ancient IDE hardware devices speak SCSI to the controller. All (I think) IDE drivers can speak SCSI (or maybe I should say look SCSI) to the generic disk layer if compiled accordingly, but they (and a few SATA drivers) can also look like IDE. Nov 10 '10 at 1:45
  • Gilles, can you please precise the layers (from hw to Linux upper layers)? I guess we have something like: device (physical drive), SATA host controller (PHY HBA), Low level driver (receiving SCSI commands, speaking to PHY HBA), SCSI-core midlayer (scsi_mod.ko), libata OR scsi-disk-driver (sd_mod.ko), block (available through /dev/sdX). Do you agree?
    – Totor
    Nov 3 '13 at 18:10
  • I meant "can you please specify"...
    – Totor
    Nov 4 '13 at 0:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.