I want to detect whether a disk is attached to the correct sata-port. While lsscsi gives me some useful information about the used host, I was wondering whether the SCSI host number will always stay the same:
[0:0:0:0] disk ATA 2.5" SATA SSD 3M P130 /dev/sda [1:0:0:0] disk ATA 2.5" SATA SSD 3M P130 /dev/sdb [4:0:0:0] disk ATA SATADOM D150SV-L 1209 /dev/sdc
A small test showed that neither rebooting the system nor a removal of one of the disks affects one of the other host numbers. In addition, I found the following at http://www.tldp.org/HOWTO/SCSI-2.4-HOWTO/scsiaddr.html:
The SCSI adapter number is typically an arbitrary numbering of the adapter cards on the internal IO buses (e.g. PCI, PCMCIA, ISA etc) of the computer. [...] SCSI adapter numbers are issued by the kernel in ascending order starting with 0.
Both together leads me to the assumption that the SCSI host number should always stay the same on a system as the bus is always enumerated the same way? Is this correct?
UPDATE: It seems that attaching an ATA Pass Through (ATP) device can change the host numbers of all devices.