Device Mapper Multipath (DM Multipath) is the Linux kernel’s built-in solution for aggregating multiple I/O paths between a server and storage arrays into a single logical device. This provides both high availability (automatic failover when a path fails) and load balancing (distributing I/O across multiple paths). While the kernel module handles the core multipathing, user-space tools manage configuration, monitoring, and path selection. This guide compares the leading DM Multipath management tooling.
Why DM Multipath for Self-Hosted Storage?
In self-hosted infrastructure, storage reliability is paramount. Whether you are running iSCSI targets, Fibre Channel SANs, or NFS/iSCSI over multiple network interfaces, path failures are a real risk — cable disconnections, switch failures, HBA issues, or network partitioning.
DM Multipath addresses this by presenting multiple physical paths as a single /dev/mapper/ device. If one path fails, I/O automatically redirects through remaining paths with zero data loss. For storage-intensive workloads (databases, virtualization hosts, backup servers), this failover capability is the difference between a brief I/O pause and a complete service outage.
Load balancing across paths also improves throughput. A dual-path iSCSI configuration can theoretically double sequential read/write bandwidth, and DM Multipath handles distribution transparently to the filesystem and applications above it.
For iSCSI target management, see our iSCSI target comparison. If you need LVM storage management, our LVM management guide covers volume management on top of multipathed devices. For comprehensive storage monitoring, our disk health monitoring guide shows how to monitor the underlying physical drives. If you need LVM storage management, our LVM management guide covers volume management on top of multipathed devices. For comprehensive storage monitoring, our disk health monitoring guide shows how to monitor the underlying physical drives.
device-mapper-multipath: The Core Kernel Module
The Linux kernel’s dm-multipath module is part of the device-mapper framework. It provides the core multipathing functionality, while user-space tools handle configuration and monitoring.
How DM Multipath Works
| |
Key Kernel Features
- Path grouping — multiple paths aggregated into a single block device
- Path failover — automatic switch to alternate paths on failure
- Load balancing — distribute I/O across available paths
- Path prioritization — prefer certain paths based on policy
- Queueing — hold I/O during path transitions
- ALUA support — Asymmetric Logical Unit Access for storage arrays
Multipath Policies
The kernel supports several path selection policies:
| Policy | Description | Use Case |
|---|---|---|
failover | Single active path, standby paths | Simple HA |
multibus | All paths active, round-robin | Load balancing |
least-pending | Route to path with fewest pending I/O | Mixed workloads |
queue-length | Route to path with shortest queue | Variable latency |
service-time | Route based on historical service time | Heterogeneous paths |
io-affinity | Route based on NUMA locality | NUMA systems |
multipath-tools: The Standard User-Space Suite
multipath-tools (also known as multipath-tools or device-mapper-multipath) is the standard user-space management suite for DM Multipath, maintained as part of the Linux kernel project. It provides the multipathd daemon, multipath command, and configuration framework.
Key Features
- multipathd daemon — monitors path health, triggers failover
- multipath command — create, configure, and manage multipath devices
- Blacklist/whitelist support for device filtering
- Hardware handlers for specific storage array types (HP, EMC, NetApp)
- Path checker — directio, readsector0, tur (Test Unit Ready), io
- sysfs integration for real-time path status
- udev integration for automatic device creation
Installation
| |
Docker Compose for iSCSI + Multipath
While multipath-tools runs on the host, here is a complete setup with an iSCSI target:
| |
Host-side multipath configuration (/etc/multipath.conf):
| |
Management Commands
| |
Monitoring with multipathd Interactive Mode
| |
Path Priority and Hardware-Specific Handlers
Different storage arrays report path priority differently. DM Multipath uses hardware handlers and priority group modules to interpret these signals correctly.
ALUA (Asymmetric Logical Unit Access)
ALUA-aware storage arrays (most enterprise SANs) report path states:
- Active/Optimized (AO) — preferred path
- Active/Non-Optimized (ANO) — usable but slower
- Standby — available but not recommended
- Unavailable — path is down
Configuration for ALUA-capable arrays:
| |
Custom Path Checkers
For non-standard storage, you can implement custom path checkers:
| |
Comparison: DM Multipath Management
| Feature | multipath-tools (default) | multipath-tools (custom) | Manual dmsetup |
|---|---|---|---|
| Path Monitoring | ✅ multipathd daemon | ✅ multipathd daemon | ❌ Manual |
| Auto Failover | ✅ Sub-second | ✅ Sub-second | ❌ Manual |
| Load Balancing | ✅ Multiple policies | ✅ Multiple policies | ❌ Manual |
| Hardware Handlers | ✅ 20+ built-in | ✅ Custom handlers | ❌ |
| Path Checkers | ✅ 5+ types | ✅ Custom checkers | ❌ |
| udev Integration | ✅ Automatic | ✅ Automatic | ❌ |
| sysfs Monitoring | ✅ | ✅ | ✅ |
| Configuration | /etc/multipath.conf | /etc/multipath.conf | dmsetup commands |
| Interactive Mode | ✅ multipathd -k | ✅ multipathd -k | ❌ |
| Prometheus Metrics | ❌ (need exporter) | ❌ (need exporter) | ❌ |
| Docker Compatible | ❌ (host-level) | ❌ (host-level) | ❌ |
Monitoring and Alerting
Multipath Status Monitoring
| |
Prometheus Exporter
For centralized monitoring, use a custom exporter:
| |
Log Monitoring
| |
Choosing the Right Multipath Setup
Use multipath-tools with default configuration for most self-hosted setups. The find_multipaths yes default auto-detects multipath-capable devices without manual WWID configuration. The multibus path grouping policy provides both failover and load balancing out of the box.
Customize multipath.conf when connecting to enterprise storage arrays (NetApp, EMC, HP) that require specific hardware handlers, priority groups, or path checkers. The hardware-specific device stanzas in the default config cover most common arrays.
Use manual dmsetup commands only for debugging or when multipathd is not available. In production, always rely on the daemon for automatic path monitoring and failover.
FAQ
How many paths does DM Multipath support?
The kernel imposes no practical limit on path count. Typical configurations use 2-4 paths (dual-controller SAN with dual-port HBAs). Some enterprise setups use 8+ paths for maximum redundancy and bandwidth. Each path requires a separate initiator-target connection.
Does DM Multipath work with NVMe?
NVMe multipathing uses a different mechanism called NVMe native multipathing (CONFIG_NVME_MULTIPATH), not DM Multipath. NVMe fabrics (NVMe-over-Fabrics) handle path management at the NVMe protocol level. For traditional block storage (iSCSI, FC, SAS), DM Multipath remains the standard.
What happens during path failover?
When a path fails, multipathd detects it within the checker interval (typically 5 seconds). I/O is queued briefly (controlled by no_path_retry) and then redirected through remaining active paths. Applications may experience a brief I/O pause (100ms-2s) but no data loss. Filesystem and applications above the block layer see a continuous device.
Can I use DM Multipath with ZFS or Ceph?
ZFS has its own multipathing awareness — it sees individual paths and can use them independently. Running DM Multipath below ZFS is generally NOT recommended as it can interfere with ZFS’s own I/O scheduling. For Ceph, multipathing applies to the OSD storage devices, not to Ceph’s network-level replication. Use DM Multipath for the physical storage layer only.
How do I test path failover safely?
- Identify the paths:
multipath -ll - Disable one path:
echo offline > /sys/block/sdX/device/state - Verify failover:
multipath -llshould show the path as “failed” - Re-enable:
echo running > /sys/block/sdX/device/state - Verify recovery:
multipath -llshould show the path as “active”
Always test failover during maintenance windows and monitor application behavior during the transition.
Is DM Multipath necessary for single-path storage?
No. If your storage has only one physical path (single cable, single switch), DM Multipath provides no benefit and adds unnecessary overhead. Use find_multipaths yes in your configuration — this ensures multipath only activates when multiple paths to the same device are actually detected.