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 fchost there are additional sub-folders ( host1,) per adapter.
![Wwn Wwn](/uploads/1/2/5/4/125425066/694422710.png)
When you configure storage on the storage unit for Fibre Channel attachment, you must specify the worldwide name (WWN) of the Fibre Channel adapter in the IBM® System Storage® DS Storage Manager or DS CLI. On Linux systems, the required WWN displays in the /var/log/messages system log file when you load the driver.
In this subfolder there are additional files starting with node – those files contain the pretended WWN / WWID: # cat /sys/class/fchost/host./node.0x200 0f1ad66c7f1e90x200 0f1ad66c7f1e9In 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: # systool -c fchost -v grep -i portnameportname = '0x200 1f1ad66c7f1e9'portname = '0x200 2f1ad66c7f1e9'🙂.
# ls -ld /sys/block/sd./devicelrwxrwxrwx 1 root root 0 Oct 4 12:12 /sys/block/sdaz/device -././devices/pci00:20:02.0/0000:27:00.0/host2/rport-2:0-0/target2:0:0/2:0:0:29lrwxrwxrwx 1 root root 0 Oct 4 12:12 /sys/block/sdbi/device -././devices/pci00:20:02.2/0000:24:00.0/host3/rport-3:0-0/target3:0:0/3:0:0:29Now compare hostX info with target with previous command( /proc/scsi/scsi ) to obtain details which disk is mapped to which LUN ID. The numbers marked at the end represent host, channel, target and LUN respectively. So the first device in command “ls -ld /sys/block/sd./device” corresponds to the first device scene in the command “cat /proc/scsi/scsi” command above. Host: scsi2 Channel: 00 Id: 00 Lun: 29 corresponds to 2:0:0:29.
![Check Check](http://cdn.techgenix.com/media/upls/image010_78.png)
Check the highlighted portion in both commands to correlate.