2 added udevadm info.
source | link

If you want to write your own custom rules for drives on that HBA, try running udevadm info /dev/disk/by-id/..... That may provide enough info to create a symlink that identifies the drive bay.

e.g. on one of my drives (a SATA drive connected to an IBM M1015, an LSI SAS2008, part of one of my ZFS pools):

# udevadm info /dev/disk/by-path/pci-0000:07:00.0-sas-phy0-lun-0
P: /devices/pci0000:00/0000:00:0b.0/0000:07:00.0/host0/port-0:1/end_device-0:1/target0:0:1/0:0:1:0/block/sdb
N: sdb
S: disk/by-id/ata-WDC_WD10EACS-00ZJB0_WD-WCASJ2114122
S: disk/by-id/wwn-0x50014ee2023dc46f
S: disk/by-path/pci-0000:07:00.0-sas-phy0-lun-0
E: DEVLINKS=/dev/disk/by-path/pci-0000:07:00.0-sas-phy0-lun-0 /dev/disk/by-id/ata-WDC_WD10EACS-00ZJB0_WD-WCASJ2114122 /dev/disk/by-id/wwn-0x50014ee2023dc46f
E: DEVNAME=/dev/sdb
E: DEVPATH=/devices/pci0000:00/0000:00:0b.0/0000:07:00.0/host0/port-0:1/end_device-0:1/target0:0:1/0:0:1:0/block/sdb
E: DEVTYPE=disk
E: ID_ATA=1
E: ID_ATA_DOWNLOAD_MICROCODE=1
E: ID_ATA_FEATURE_SET_AAM=1
E: ID_ATA_FEATURE_SET_AAM_CURRENT_VALUE=254
E: ID_ATA_FEATURE_SET_AAM_ENABLED=0
E: ID_ATA_FEATURE_SET_AAM_VENDOR_RECOMMENDED_VALUE=128
E: ID_ATA_FEATURE_SET_HPA=1
E: ID_ATA_FEATURE_SET_HPA_ENABLED=1
E: ID_ATA_FEATURE_SET_PM=1
E: ID_ATA_FEATURE_SET_PM_ENABLED=1
E: ID_ATA_FEATURE_SET_PUIS=1
E: ID_ATA_FEATURE_SET_PUIS_ENABLED=0
E: ID_ATA_FEATURE_SET_SECURITY=1
E: ID_ATA_FEATURE_SET_SECURITY_ENABLED=0
E: ID_ATA_FEATURE_SET_SECURITY_ENHANCED_ERASE_UNIT_MIN=276
E: ID_ATA_FEATURE_SET_SECURITY_ERASE_UNIT_MIN=276
E: ID_ATA_FEATURE_SET_SMART=1
E: ID_ATA_FEATURE_SET_SMART_ENABLED=1
E: ID_ATA_SATA=1
E: ID_ATA_SATA_SIGNAL_RATE_GEN1=1
E: ID_ATA_SATA_SIGNAL_RATE_GEN2=1
E: ID_ATA_WRITE_CACHE=1
E: ID_ATA_WRITE_CACHE_ENABLED=1
E: ID_BUS=ata
E: ID_MODEL=WDC_WD10EACS-00ZJB0
E: ID_MODEL_ENC=WDC\x20WD10EACS-00ZJB0\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
E: ID_PART_TABLE_TYPE=gpt
E: ID_PART_TABLE_UUID=53ad1007-a736-ca41-a1fb-98ec491cc00a
E: ID_PATH=pci-0000:07:00.0-sas-phy0-lun-0
E: ID_PATH_TAG=pci-0000_07_00_0-sas-phy0-lun-0
E: ID_REVISION=01.01B01
E: ID_SERIAL=WDC_WD10EACS-00ZJB0_WD-WCASJ2114122
E: ID_SERIAL_SHORT=WD-WCASJ2114122
E: ID_TYPE=disk
E: ID_WWN=0x50014ee2023dc46f
E: ID_WWN_WITH_EXTENSION=0x50014ee2023dc46f
E: MAJOR=8
E: MINOR=16
E: SUBSYSTEM=block
E: TAGS=:systemd:
E: UDISKS_ATA_SMART_IS_AVAILABLE=1
E: UDISKS_IGNORE=1
E: UDISKS_PARTITION_TABLE=1
E: UDISKS_PARTITION_TABLE_COUNT=2
E: UDISKS_PARTITION_TABLE_SCHEME=gpt
E: UDISKS_PRESENTATION_HIDE=1
E: UDISKS_PRESENTATION_NOPOLICY=0
E: USEC_INITIALIZED=15128136

If you want to write your own custom rules for drives on that HBA, try running udevadm info /dev/disk/by-id/..... That may provide enough info to create a symlink that identifies the drive bay.

e.g. on one of my drives (a SATA drive connected to an IBM M1015, an LSI SAS2008, part of one of my ZFS pools):

# udevadm info /dev/disk/by-path/pci-0000:07:00.0-sas-phy0-lun-0
P: /devices/pci0000:00/0000:00:0b.0/0000:07:00.0/host0/port-0:1/end_device-0:1/target0:0:1/0:0:1:0/block/sdb
N: sdb
S: disk/by-id/ata-WDC_WD10EACS-00ZJB0_WD-WCASJ2114122
S: disk/by-id/wwn-0x50014ee2023dc46f
S: disk/by-path/pci-0000:07:00.0-sas-phy0-lun-0
E: DEVLINKS=/dev/disk/by-path/pci-0000:07:00.0-sas-phy0-lun-0 /dev/disk/by-id/ata-WDC_WD10EACS-00ZJB0_WD-WCASJ2114122 /dev/disk/by-id/wwn-0x50014ee2023dc46f
E: DEVNAME=/dev/sdb
E: DEVPATH=/devices/pci0000:00/0000:00:0b.0/0000:07:00.0/host0/port-0:1/end_device-0:1/target0:0:1/0:0:1:0/block/sdb
E: DEVTYPE=disk
E: ID_ATA=1
E: ID_ATA_DOWNLOAD_MICROCODE=1
E: ID_ATA_FEATURE_SET_AAM=1
E: ID_ATA_FEATURE_SET_AAM_CURRENT_VALUE=254
E: ID_ATA_FEATURE_SET_AAM_ENABLED=0
E: ID_ATA_FEATURE_SET_AAM_VENDOR_RECOMMENDED_VALUE=128
E: ID_ATA_FEATURE_SET_HPA=1
E: ID_ATA_FEATURE_SET_HPA_ENABLED=1
E: ID_ATA_FEATURE_SET_PM=1
E: ID_ATA_FEATURE_SET_PM_ENABLED=1
E: ID_ATA_FEATURE_SET_PUIS=1
E: ID_ATA_FEATURE_SET_PUIS_ENABLED=0
E: ID_ATA_FEATURE_SET_SECURITY=1
E: ID_ATA_FEATURE_SET_SECURITY_ENABLED=0
E: ID_ATA_FEATURE_SET_SECURITY_ENHANCED_ERASE_UNIT_MIN=276
E: ID_ATA_FEATURE_SET_SECURITY_ERASE_UNIT_MIN=276
E: ID_ATA_FEATURE_SET_SMART=1
E: ID_ATA_FEATURE_SET_SMART_ENABLED=1
E: ID_ATA_SATA=1
E: ID_ATA_SATA_SIGNAL_RATE_GEN1=1
E: ID_ATA_SATA_SIGNAL_RATE_GEN2=1
E: ID_ATA_WRITE_CACHE=1
E: ID_ATA_WRITE_CACHE_ENABLED=1
E: ID_BUS=ata
E: ID_MODEL=WDC_WD10EACS-00ZJB0
E: ID_MODEL_ENC=WDC\x20WD10EACS-00ZJB0\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
E: ID_PART_TABLE_TYPE=gpt
E: ID_PART_TABLE_UUID=53ad1007-a736-ca41-a1fb-98ec491cc00a
E: ID_PATH=pci-0000:07:00.0-sas-phy0-lun-0
E: ID_PATH_TAG=pci-0000_07_00_0-sas-phy0-lun-0
E: ID_REVISION=01.01B01
E: ID_SERIAL=WDC_WD10EACS-00ZJB0_WD-WCASJ2114122
E: ID_SERIAL_SHORT=WD-WCASJ2114122
E: ID_TYPE=disk
E: ID_WWN=0x50014ee2023dc46f
E: ID_WWN_WITH_EXTENSION=0x50014ee2023dc46f
E: MAJOR=8
E: MINOR=16
E: SUBSYSTEM=block
E: TAGS=:systemd:
E: UDISKS_ATA_SMART_IS_AVAILABLE=1
E: UDISKS_IGNORE=1
E: UDISKS_PARTITION_TABLE=1
E: UDISKS_PARTITION_TABLE_COUNT=2
E: UDISKS_PARTITION_TABLE_SCHEME=gpt
E: UDISKS_PRESENTATION_HIDE=1
E: UDISKS_PRESENTATION_NOPOLICY=0
E: USEC_INITIALIZED=15128136
1
source | link

The "files" under /dev/disk/by-* are symlinks created by udev, using information about the block device(s) provided by the kernel. The symlinks point to the actual device nodes for the drives. For example:

/dev/disk/by-path/pci-0000:00:11.0-ata-1 -> ../../sdn

and

/dev/disk/by-path/pci-0000:07:00.0-sas-phy0-lun-0 -> ../../sdb

The driver does not create them, and the kernel does not create them. they're entirely the responsibility of udev.

udev uses rules defined in /etc/udev/rules.d/ (for the local system admin's own rules and over-rides) and /lib/udev/rules.d/ (system defaults) to create them.

For example: /lib/udev/rules.d/60-persistent-storage.rules. On my debian system, the first few lines of that file are:

# do not edit this file, it will be overwritten on update

# persistent storage links: /dev/disk/{by-id,by-uuid,by-label,by-path}
# scheme based on "Linux persistent device names", 2004, Hannes Reinecke <hare@suse.de>