Fibre Channel: Zoning, Masking and the Missing LUN
A LUN reaches a host only when two independent doors agree: the fabric zone (which ports may talk) and the array masking (which host may see which LUN). "Missing LUN" incidents live in exactly one of the two — plus the host's own scan.
Layer 1: does the HBA see the fabric at all?
cat /sys/class/fc_host/host*/port_state # Online vs Linkdown cat /sys/class/fc_host/host*/port_name # the host WWPNs cat /sys/class/fc_host/host*/supported_speeds dmesg -T | grep -i -E 'fc |fibre|lpfc|qla' | tail
Linkdown is physical or SFP: cable, GBIC, or a disabled switch port. Online means login (FLOGI) succeeded and the problem is further up. After switch maintenance, a host that stayed Linkdown usually needs nothing more than the port re-enabled — but check the switch side for the port's error counters first.
Layer 2: zoning — who can talk to whom
On the switch, confirm the effective zone set actually contains your host WWPN ↔ target WWPN pair, not just the defined config (a zone edit that was never cfgenabled is the classic):
# Brocade-style: zoneshow; cfgshow; nsshow # effective config + name-server logins # Cisco MDS-style: show zone active; show flogi database
The name server is the truth of visibility: if the host's FLOGI is present but the target port WWPNs are absent from the host's view, zoning is the gap. Single-initiator zones make typos cheap to find — every missing pair is one zone member line.
Layer 3: masking — the array's own door
Zoned but still no LUN: the array's host group lacks the host WWPN, or the LUN is not mapped to that group. Symptoms differ subtly from zoning: with masking missing, the host sees the target ports (remote ports appear in /sys/class/fc_remote_ports) but zero LUNs from them; with zoning missing, the remote ports themselves never appear.
ls /sys/class/fc_remote_ports/ # target ports visible? ls /sys/class/fc_transport/target*/ # and LUNs under them?
Compare the host's WWPN character-for-character with the array entry — a transposed nibble made during manual entry is a standing rite of passage. Copy WWPNs from port_name, never retype them.
Layer 4: the host must rescan
FC does not announce new LUNs to a running Linux host; you scan:
# rescan all hosts for new LUNs: for h in /sys/class/scsi_host/host*; do echo "- - -" > $h/scan; done # remove a stale device after unmapping: echo 1 > /sys/block/sdX/device/delete
Skipping the delete step after an unmap leaves ghost devices that multipath treats as failed paths — clean both ends when storage moves.
Path loss after switch or array changes
- Half the paths gone after a switch reboot: the other fabric's zone was touched, or the array port stayed disabled — check the array's port state, not just the host.
- Host flapping between Online/Linkdown: dirty connectors or a marginal SFP; swap ends one at a time and watch
fc_hoststatistics counters. - After an ISL change, verify zone merge did not drop your zone set (merge failures pick one config; the loser's zones vanish from the effective set).
NPV/NPIV: when the host WWPN is invisible on the switch
Blade and edge switches often run in NPV mode: host logins ride uplink FLOGIs, so the host WWPN does not appear as a switch port login where you expect it. Zone against the host WWPN regardless — but verify visibility in the NPV tables, not the port FLOGI list:
# Cisco MDS in NPV: show npv flogi-table # Brocade access gateway: portloginshow / fcpinshow equivalents
A host absent from both the NPV table and the upstream core's name server is a host-side problem (HBA driver, cable, SFP), and chasing zoning for it wastes an hour. After blade reboots, NPIV logins can lag; give the fabric a minute before declaring the path dead.
The provisioning runbook, verbatim
- Copy host WWPNs from
/sys/class/fc_host/host*/port_nameinto the change record. - Add zone members on the fabric; enable the effective config; verify with
cfgshow/show zone active. - Add the WWPN to the array host group; map the LUN.
- Host: rescan, confirm remote ports and LUNs under
/sys/class/fc_transport, then multipath map. - Reverse order for removals, ending with
device/deleteso no ghost paths remain.
Every "missing LUN" postmortem in the industry reduces to a skipped step in this list.
Prevention checklist
- Keep zoning and masking documents with copy-pasteable WWPNs; manual retyping is the top root cause.
- After any fabric change, verify effective config, not defined config.
- Script the host rescan+cleanup pair for provisioning so adds and removes stay symmetric.
- Monitor fc_host port_state transitions; a flapping fabric path is a cable with a deadline.