I am in the process of setting up a ZFS storage system with a large number of disks. I want to use WWN numbers to identify devices (aliased in vdev_id.conf) but when trying to get the WWN numbers, I noted a shift between the WWN reported by the LSI controller (LSI MegaRAID SAS 9380-8e, all disks are in JBOD mode) and the WWN shown in /dev/disk/by-id:
$ storcli64 /c0/e72/s0 show all | grep 5008472696
WWN = 5000C5008472696C
0 Active 6.0Gb/s 0x5000c5008472696d
1 Active 6.0Gb/s 0x5000c5008472696e
$ ll /dev/disk/by-id/wwn-0x* | grep 5008472696
/dev/disk/by-id/wwn-0x5000c5008472696f -> ../../sdn
On this set of hardware (Disks, JBOD, controller), the pattern seems to be consistent (shifted by 3).
I have a 'feeling' that this is caused by the dual link but I could not find a suitable explanation for this behavior. Any suggestions will be greatly appreciated.
EDIT:
Another sample would be
WWN = 5000C50084726B78
0 Active 6.0Gb/s 0x5000c50084726b79
1 Active 6.0Gb/s 0x5000c50084726b7a
The controller reports 0x5000c50084726b7b
, which is consistent with the suggested explanation given by Matthew.
You have a transport address and individual port identifiers for the dual-port SAS drives you're using (multipath). One WWN, multiple port identifiers.
A better illustration would be examining the output of:
multipath -l
,lsscsi --wwn
andlsscsi --transport
Like:
For your purposes, go with the WWN. If this is ZFS, please elaborate on your controller and JBOD solution. If it's Linux, you should be using the DM Multipath and building the pool with the DM devices. Also see: https://github.com/ewwhite/zfs-ha/wiki
This is purely an observation of just one of your entries but
It could be a difference in bitwise operations on how each system calculates the WWN.
Do you have any other examples?
If this is right (and I'm only guessing) I can only assume that no standard way exists and both the raid controller and the kernel implementations each choose a different method.
To round out the other answers, every SAS drive has a single LUN (LUN 0) and four addresses:
0x5000c5008472696c
)0x5000c5008472696d
)0x5000c5008472696e
)0x5000c5008472696f
)Although all four addresses refer to the same drive, the LUN 0 address is what Linux presents as the WWN. It's the most portable, and—as ewwhite says— it's what you should use for ZFS.
(h/t to this comment on r/zfs, which helped me wrap my head around it)