WIPIVERSE

Linux DM Multipath

Linux DM Multipath (Device Mapper Multipath) is a kernel-level feature of the Linux operating system that provides fault‑tolerant, load‑balanced access to block storage devices that are reachable through multiple physical pathways. It aggregates several redundant I/O paths—such as those from multiple Host Bus Adapters (HBAs), Fibre Channel links, or iSCSI sessions—into a single logical device presented to the operating system and applications.

Core Components

Component Description
Device Mapper (dm) A kernel framework that provides a generic way to map one block device onto another. Multipath is implemented as a dm target module (dm-multipath).
Multipath daemon (multipathd) Userspace service that discovers multipath devices, builds and updates the path groups, and applies policies for path selection and failover.
Path groups Collections of paths that lead to the same underlying storage LUN (Logical Unit Number). Each group can have a status (active, standby, failed).
Policies Algorithms that determine how I/O is distributed across active paths, e.g., round‑robin, weighted round‑robin, or failover (single‑path).

Operational Overview

  1. Discovery – When block devices appear (e.g., via scsi or fc subsystems), the multipath daemon inspects their World Wide Names (WWNs), target identifiers, and LUN IDs. |
  2. Binding – Paths that share the same underlying storage (identified by matching WWNs, target ports, and LUN numbers) are bound together into a single multipath device (typically /dev/mapper/mpathX). |
  3. Path Selection – Based on the configured policy, multipathd directs I/O to one of the active paths. |
  4. Failover / Recovery – If a path fails (detected via I/O errors, link loss, or health checks), multipathd marks it offline and routes subsequent I/O through an alternative active path. When the failed path recovers, it can be reinstated automatically. |
  5. Load Balancing – For policies that permit multiple active paths, the daemon distributes I/O across them to improve throughput and reduce latency. |

Configuration

  • Primary file: /etc/multipath.conf (or /etc/multipath/conf.d/*.conf).
  • Key directives:
    • defaults – Global defaults such as user_friendly_names yes, path_grouping_policy multibus, failback immediate.
    • blacklist / blacklist_exceptions – Exclude or include specific devices based on vendor, product, or WWN.
    • devices – Per‑vendor or per‑product parameter overrides (e.g., queue depth, timeout).
    • multipaths – Per‑LUN overrides such as specific path selection policies.

Typical administrative commands:

Command Purpose
multipath -ll List current multipath devices and their path groups.
multipath -v2 Run the daemon in verbose mode for troubleshooting.
multipathd reload Reload configuration without stopping the daemon.
systemctl restart multipathd Restart the daemon (systemd‑based systems).

Benefits

  • High Availability – Continuous I/O service despite hardware failures (HBA, cable, switch).
  • Performance – Parallel use of multiple paths can increase aggregate bandwidth.
  • Simplified Management – Applications see a single logical device regardless of underlying topology.

Limitations & Considerations

  • Compatibility – Multipath must be supported by the storage array; some arrays require specific vendor modules or firmware versions.
  • Path Consistency – All paths should have identical block size, queue depth, and other SCSI parameters to avoid data integrity issues.
  • Latency Sensitivity – Some load‑balancing policies may introduce additional latency if paths have disparate performance characteristics.
  • Complexity – Misconfiguration of multipath.conf can lead to path flapping, I/O errors, or sub‑optimal performance.

Common Use Cases

  • Enterprise SAN environments – Fibre Channel fabrics with dual‑fabric or dual‑HBA connectivity.
  • iSCSI clusters – Multiple network interfaces providing redundant paths to iSCSI targets.
  • NVMe over Fabrics – Emerging implementations that expose multiple transport routes to NVMe namespaces.

References for Further Reading

  • Linux Kernel Documentation – Documentation/blockdev/dm-multipath.txt.
  • Red Hat Enterprise Linux Documentation – “Configuring Device Mapper Multipathing”.
  • Ubuntu Server Guide – “Multipath I/O”.
  • SCSI Primary Commands – Standard defining WWN and LUN identification used by multipath algorithms.
Browse

More topics to explore

    Browse all articles