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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
Application
Filesystem (ext4, xfs, btrfs)
LVM (optional)
/dev/mapper/mpatha  ← DM Multipath device
┌─────────────┬─────────────┐
│  /dev/sda   │  /dev/sdb   │  ← Physical paths
│  (eth0/iSCSI)│ (eth1/iSCSI)│
└─────────────┴─────────────┘
    ↓              ↓
Storage Array (SAN/NAS/iSCSI Target)

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:

PolicyDescriptionUse Case
failoverSingle active path, standby pathsSimple HA
multibusAll paths active, round-robinLoad balancing
least-pendingRoute to path with fewest pending I/OMixed workloads
queue-lengthRoute to path with shortest queueVariable latency
service-timeRoute based on historical service timeHeterogeneous paths
io-affinityRoute based on NUMA localityNUMA 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

1
2
3
4
5
6
7
8
# Debian/Ubuntu
sudo apt install multipath-tools

# RHEL/Fedora/CentOS
sudo dnf install device-mapper-multipath

# Arch Linux
sudo pacman -S multipath-tools

Docker Compose for iSCSI + Multipath

While multipath-tools runs on the host, here is a complete setup with an iSCSI target:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
version: "3.8"
services:
  iscsi-target:
    image: erichough/iscsi-target:latest
    container_name: iscsi-target
    restart: unless-stopped
    ports:
      - "3260:3260"
    volumes:
      - ./iscsi-target.conf:/etc/iet/ietd.conf:ro
      - /data/iscsi:/data
    cap_add:
      - SYS_ADMIN
    devices:
      - /dev/loop-control

Host-side multipath configuration (/etc/multipath.conf):

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
defaults {
    user_friendly_names yes
    find_multipaths yes
    path_grouping_policy multibus
    path_selector "service-time 0"
    failback immediate
    no_path_retry 5
    rr_min_io 100
    max_fds 8192
}

blacklist {
    devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
    devnode "^hd[a-z]"
    devnode "^sda$"
    wwid ".*"
}

blacklist_exceptions {
    wwid "36001405.*"
}

devices {
    device {
        vendor "LIO-ORG"
        product "iSCSI Disk"
        path_grouping_policy group_by_prio
        path_checker tur
        prio alua
        hardware_handler "1 alua"
        failback immediate
        no_path_retry 12
        rr_min_io 100
        detect_prio yes
    }
}

Management Commands

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Start and enable the daemon
sudo systemctl enable multipathd
sudo systemctl start multipathd

# Show multipath topology
sudo multipath -ll

# Show verbose output
sudo multipath -ll -v 3

# Flush a multipath device
sudo multipath -f mpatha

# Reload configuration
sudo systemctl reload multipathd

# Show paths in sysfs
ls -la /sys/block/sd*/device/state

# Monitor in real-time
sudo multipathd -k
> show paths
> show maps
> show config
> quit

Monitoring with multipathd Interactive Mode

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
$ sudo multipathd -k
multipathd> show maps
name sysfs uuid
mpatha dm-0 36001405abcdef0123456789

multipathd> show paths
dev dev_t pri dm_st chk_st dq_st next_check
sda 8:0 50 [active][ready][running] XXXXXXXX.. 4/40
sdb 8:16 50 [active][ready][running] XXXXXXXX.. 14/40

multipathd> show config
# Displays the effective configuration

multipathd> resize map mpatha
# Resize a multipath device after underlying storage changes

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:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
devices {
    device {
        vendor "NETAPP"
        product "LUN"
        path_grouping_policy group_by_prio
        path_checker tur
        prio alua
        hardware_handler "1 alua"
        failback immediate
    }
}

Custom Path Checkers

For non-standard storage, you can implement custom path checkers:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
devices {
    device {
        vendor "CustomVendor"
        product "StorageArray"
        path_checker directio
        # directio: performs direct I/O to verify path
        # tur: sends Test Unit Ready (fastest)
        # readsector0: reads first sector (most thorough)
        # emc_clariion: EMC-specific checker
    }
}

Comparison: DM Multipath Management

Featuremultipath-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.confdmsetup 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Quick health check
multipath -ll | grep -c "active ready running"

# Detect failed paths
multipath -ll | grep "faulty"

# Count active paths per device
for dev in /dev/mapper/mpath*; do
    name=$(basename $dev)
    paths=$(multipath -ll $name 2>/dev/null | grep -c "active")
    echo "$name: $paths active paths"
done

Prometheus Exporter

For centralized monitoring, use a custom exporter:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python3
"""Simple multipath Prometheus exporter."""
import subprocess
import re
from prometheus_client import start_http_server, Gauge

def get_multipath_metrics():
    result = subprocess.run(['multipath', '-ll'], capture_output=True, text=True)
    metrics = {}
    for line in result.stdout.split('
'):
        if 'mpath' in line:
            name = line.split()[0]
            active = line.count('active')
            faulty = line.count('faulty')
            metrics[f'multipath_active_paths{{device="{name}"}}'] = active
            metrics[f'multipath_faulty_paths{{device="{name}"}}'] = faulty
    return metrics

start_http_server(9119)
print("Serving multipath metrics on :9119")

Log Monitoring

1
2
3
4
5
6
7
8
# Watch multipathd logs
journalctl -fu multipathd

# Filter for path failures
journalctl -u multipathd | grep -i "path.*fail\|checker.*fail"

# Alert on single-path devices
multipath -ll | grep -B1 "1 active" | grep mpath

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?

  1. Identify the paths: multipath -ll
  2. Disable one path: echo offline > /sys/block/sdX/device/state
  3. Verify failover: multipath -ll should show the path as “failed”
  4. Re-enable: echo running > /sys/block/sdX/device/state
  5. Verify recovery: multipath -ll should 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.