Short tip: Find WWN/WWID for Fibre-channel controller under Linux
To find out the World Wide Name / World Wide Identifier of a Fibre channel controller under Linux you actually have multiple possibilities.
A very common way is to read the /sys
directory. In this virtual file system there are e.g. special files which contain further information about the hardware. Below the folder fc_host
there are additional sub-folders (host1,...) per adapter. In this subfolder there are additional files starting with node
- those files contain the pretended WWN / WWID:
1# cat /sys/class/fc_host/host*/node*
20x2000f1ad66c7f1e9
30x2000f1ad66c7f1e9
In my case these information weren't correct - the 6th position of the hexadecimal ID was incorrect (see also beyond). In accordance with the output above the system would have been equipped with two adapters with the same WWN / WWID - and that's impossible. Having a look in the server's BIOS acknowledged my assumption - the output was erroneous. I didn't have that error on other servers before - I can't get behind the cause of this misinformation.
An alternative is using the systool
command. On Enterprise Linux systems (RHEL/RHED, CentOS, Scientific Linux, Oracle Enterprise Linux) you might need to install the sysfsutils
package.
Using this command I was able to read the WWN / WWID of both controllers correctly:
1# systool -c fc_host -v|grep -i port_name
2 port_name = "0x2001f1ad66c7f1e9"
3 port_name = "0x2002f1ad66c7f1e9"
🙂