Platform location of an adapter

Knowing the physical location of an adapter can be done physically (by looking at the main board of your system and searching for your adapter) or remotely, and that can be a little tricky.

In order to remotely know the platform location of an adapter in your Power System, you need to perform 3 steps:

1) Getting to know the PCI address of your card/adapter (here, I want to see my disks):

[root@proteus ~]# lspci | grep RAID
0001:08:00.0 RAID bus controller: IBM PCI-E IPR SAS Adapter (ASIC) (rev 02)
0003:04:00.0 RAID bus controller: IBM PCI-E IPR SAS Adapter (ASIC) (rev 02)

2) Then:

[root@proteus ~]# cat "/sys/bus/pci/devices/0003:04:00.0/devspec" 
/pciex@3fffe40500000/pci@0/pci@0/pci@8/raid@0

3) Lastly:

[root@proteus ~]# cat /proc/device-tree/pciex@3fffe40500000/pci@0/pci@0/pci@8/raid@0/ibm,loc-code 
U78CB.001.WZS03W8-P1-C15

There you go: the adapter is located at the C15 slot.

To make things a bit easier and save more time, here’s a script grouping the above steps

#!/bin/bash

# This scripts returns the platform location of an adapter, provided a pci
# address.
# Usage: # ./scipt.sh 0001:08:00.0
# U78CB.001.WZS03W8-P1-C14 

pci_address=$1

echo 
cat /proc/device-tree/$(cat "/sys/bus/pci/devices/$pci_address/devspec")/ibm,loc-code
echo
echo

Thank you.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s