- if device = Dir.glob("/sys/bus/pci/devices/#{slot}/host*/port-*:*/end_device-*:*/target*:#{bus}:#{target}/*:#{bus}:#{target}:0/scsi_generic/sg*").first
- disk[:device] = "/dev/#{File.basename(device)}"
+ Dir.glob("/sys/bus/pci/devices/#{slot}/host*/port-*:*/end_device-*:*/sas_device/end_device-*:*").each do |sas_device|
+ if read_sysctl_file("#{sas_device}/sas_address") == sas_address
+ if device = Dir.glob("#{sas_device}/device/target*:0:*/*:0:*:0/scsi_generic/sg*").first
+ disk[:device] = "/dev/#{File.basename(device)}"
+ end
+ end