Difference between revisions of "Drive Symbols"

From unRAID
Jump to: navigation, search
(rough first draft)
(No difference)

Revision as of 05:23, 21 March 2013

Note: this is a work-in-progress, still very incomplete
Note2: this will need to be constantly updated, after future kernel releases and additional controllers

We often get questions about figuring out which drive is being referred to when a drive error occurs, because different Linux functions refer to drives in a number of different ways. This is an attempt to help sort out all of the drive symbols, and hopefully provide methods of determining which drive a particular symbol refers to.

I wish this were easier, but it's not! Long ago, I helped Brian with a feature in the MyMain page of UnMenu, that would identify all of the symbols (eg. scsi0, sd 0:0:0:0, scsi 0:0:0:0, ata1, ata1.00, sda, md1) associated with a drive, and locate every related syslog line that contained them. But even then, it was not perfect, maybe 99.8% correct. And the exceptions to the rules have gotten much worse since then, with simultaneous assignment of symbols by differing driver modules, resulting very often in mixed up order. It's partly trial and error now, partly simple logic, sometimes just working backwards from the very last symbol assignments, and sometimes from clues within the error messages themselves.

Caution #1, the fact that some of the scsi numbers, ata numbers, and Disk numbers are equal is generally coincidental!
Caution #2, scsi and ata number assignments may change with EACH boot!

Long ago, it was relatively simple. The kernel would identify the flash drive, assign it to scsi0, and since USB drives don't get ata symbols, the ata and scsi assignments would very often line up. So then the motherboard ports would be identified and set up after the flash drive, which would result in the flash drive being associated with scsi0, scsi0:0:0:0, sd0:0:0:0, and sda; the first hard drive would be associated with the symbols scsi1, scsi1:0:0:0, sd1:0:0:0, ata1, ata1.00, and sdb; and the sixth attached drive would be associated with scsi6, scsi6:0:0:0, sd6:0:0:0, ata6, ata6.00, and sdg. If there were no other disk controllers, it was really easy to understand, and to follow in the syslog. Even then though, occasionally the USB flash drive would be identified AFTER the motherboard ports, which resulted in the flash drive possibly being assigned scsi6, and the first drive being scsi0 and ata1, the sixth drive scsi5 and ata6, all drive symbols off by one between the ata and scsi symbol numbers.

Since then, it has gotten much more complex, with considerable inconsistency in the order of drive identification and setup, and in the way each driver module handled acquiring the symbol assignments.

Here are the current rules (to the best of my knowledge):

  1. The ata symbol numbers begin with one (eg. ata1, ata2, ata13, etc). With a single number, they represent a single 'channel', with one or more ports. When it includes a period and 2 digits (eg. ata1.00, ata14.01, etc), then it represents a device that will use that channel. Most of the time, there is only one port associated, so the attached drive on ata5 would be ata5.00. But for IDE emulating controllers or Port Multipliers or certain other controllers, there may be multiple ata device assignments per ata channel, whether occupied or empty. An IDE type controller might have ata6.00 and ata6.01 using the ata6 channel. A port multiplier might have ata8.00, ata8.01, ata8.02, ata8.03, ata8.04, and ata8.05 using the ata8 channel. And there is another card with 8 ports (a PCI-X card?) that would use ata#.00 through ata#.07 on the ata# channel.
  2. The scsi symbol numbers begin with zero (eg. scsi0, scsi1, scsi12, etc). With a single number, they somewhat loosely represent a single 'channel' or family of one or more ports. When it includes 3 colons and 3 digits (eg. scsi1:0:0:0, scsi14:0:2:0, etc), then it represents a device that will use that 'channel'. The 2 forms of scsi symbols, scsi#:0:0:0 and sd#:0:0:0, are essentially equivalent, used interchangeably, and I have yet to see a distinction. Some kernel functions use the scsi_ form, and others use the sd_ form. Some controllers assign one scsi 'channel' per port (eg. 8 channels for an 8 port card), so their first port could be scsi6:0:0:0 on scsi6, and their second port could be scsi7:0:0:0 on scsi7. Other controllers use only one scsi 'channel' with multiple scsi sub-assignments on that one channel (eg. 1 channel for an 8 port card). So their first port could be scsi6:0:0:0 on scsi6, and their second port could be scsi6:0:1:0 on scsi6.
  3. USB drives get scsi symbols, but not ata symbols (eg. scsi2, scsi2:0:0:0, and sd2:0:0:0). A USB drive gets one scsi symbol assignment, usually pretty quickly but sometimes later, rarely the last to be assigned.
  4. The symbol assignments (especially the ata symbols) for many controllers may be intermixed with other controllers assignments, since they are happening simultaneously. And on the next boot, the assignments may be quite different. This is the one item that makes syslog analysis of drive issues the most challenging!
  5. The ahci module gets one scsi symbol and one ata symbol per port. It is used by most motherboard SATA ports, the JMB SATA ports, and others. They usually get the scsi assignments very early, especially motherboard ports (often the first). They delay a little before acquiring the associated ata symbols, so sometimes another controller will beat them to the next ata symbols, making it somewhat harder when trying to analyze a syslog!
  6. The mvsas module (used by mvsas-based controller cards) announces itself very early (often first), and acquires one scsi assignment right then, for a single controller. It usually waits awhile before using the assignment however, well after other controllers, and then begins the identification of attached drives, using scsi sub-assignments, and then acquiring ata symbols for each. The mvsas module often gets scsi0, but then assigns, for example to a 4 port card, the individual drive symbols scsi0:0:0:0, scsi0:0:1:0, scsi0:0:2:0, and scsi0:0:3:0 (each also referred elsewhere as the equivalent symbols sd0:0:0:0, sd0:0:1:0, sd0:0:2:0, and sd0:0:3:0). If there were another mvsas-based 2 SATA port card, it might pop up later with the assignment of scsi9, and would later assign to its 2 ports/drives scsi9:0:0:0 and scsi9:0:1:0 (equal to sd9:0:0:0 and sd9:0:1:0). There is another delay before it acquires ata symbols for each port (empty or occupied).
  7. The ata_piix module (used by IDE emulating SATA ports on a motherboard, whether the main ports or an auxiliary onboard controller) works like IDE channels, and divides the ports into pairs, assigning one scsi and ata symbol for each 2 ports. For example, it might get scsi3 and ata4, so then ata4.00 and ata4.01 for the 2 ports. In general, if you see the ata_piix module in use in the syslog, you should check to see if the BIOS settings can be changed to use AHCI instead.
  8. sata_nv - motherboard ports on an nForce-based board...
  9. sata_mv - Marvell chipset ports...
  10. sas2lp?...
  11. sil - if 2 ports: SiI3112; if 4 ports: SiI3114; could be onboard or addon card controller...
  12. sil24 - if 2 ports: SiI3132; if 4 ports: SiI3124; could be onboard or addon card controller...
  13. sata_promise? - SATA ports on Promise card...
  14. others?...
  15. IDE channels - hda, hdb, etc; piix; fixed hd# assignment; IDE0, IDE1, IDE2, etc...
  16. sda, sdb, etc - dynamic sd# assignment...
  17. md1, md2, etc...
  18. clues within and adjacent to the exception handler series of syslog lines...

...