How to Configure Multipath I/O for Redundant SAN Storage on Ubuntu

Enterprise database clusters and high-availability hypervisors connect to centralized Storage Area Network (SAN) arrays across multiple redundant Fibre Channel (FC) Host Bus Adapters (HBAs) or dedicated iSCSI network fabrics. Without specialized path aggregation, the Linux kernel detects each physical path to an identical storage volume as a separate, duplicate block device (e.g., /dev/sdb, /dev/sdc, /dev/sdd), risking catastrophic filesystem corruption if mounted simultaneously. DM-Multipath (Device Mapper Multipath) aggregates multiple redundant physical paths into a single resilient virtual block device (e.g., /dev/mapper/mpatha), managing automated failover and dynamic I/O load balancing.

DM-Multipath Architecture and Kernel Device Mapping

Multipath I/O functions through coordinated kernel and userland subsystems:

  • Device Mapper: The underlying Linux kernel driver that re-routes block I/O requests across active physical paths according to configured priority algorithms.
  • multipathd: The userspace monitoring daemon that continuously checks path health. If an HBA fails or a Fibre Channel cable is severed, multipathd automatically reroutes active transactions to alternate paths within milliseconds without interrupting running applications.
  • World Wide Identifiers (WWID): Persistent SCSI inquiry descriptors that uniquely identify a SAN Logical Unit Number (LUN) regardless of varying device node names assigned during system reboot.

Installing Multipath Packages and Enabling the Daemon

Install the device-mapper multipath suite on Ubuntu Server:

sudo apt update
sudo apt install multipath-tools -y

# Enable and start multipathd service
sudo systemctl enable --now multipathd.service

Generating and Customizing /etc/multipath.conf

Create the primary multipath configuration file to define path checking policies and custom aliases:

sudo nano /etc/multipath.conf

Append enterprise production configuration parameters:

defaults {
    user_friendly_names yes
    find_multipaths yes
    path_grouping_policy multibus
    path_checker directio
    path_selector "round-robin 0"
    failback immediate
    no_path_retry 12
    rr_min_io 100
}

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

multipaths {
    multipath {
        wwid "36001405a1b2c3d4e5f60000000000001"
        alias data_volume_lun01
    }
}

Setting user_friendly_names yes assigns recognizable names, while mapping the unique SAN wwid to custom alias data_volume_lun01 creates persistent symlinks in /dev/mapper/.

Applying Configuration and Inspecting Active Path Topology

Apply configuration changes and reload the kernel multipath topology:

# Reload multipath service
sudo systemctl restart multipathd

# Rescan SCSI buses for newly presented SAN LUNs
sudo rescan-scsi-bus.sh

# Re-run multipath detection
sudo multipath -v2

Inspect active path health and latency status using the diagnostic viewer:

sudo multipath -ll

The output renders the consolidated device hierarchy, displaying active physical device nodes (e.g., [active][ready]) mapped underneath the virtual target volume.

Formatting and Mounting the Aggregated Multipath Block Device

Always format and mount the virtual /dev/mapper/ device node rather than raw underlying SCSI disks:

# Create filesystem on the multipath virtual device
sudo mkfs.ext4 -m 1 /dev/mapper/data_volume_lun01

# Mount to target mount point
sudo mkdir -p /mnt/san_storage
sudo mount /dev/mapper/data_volume_lun01 /mnt/san_storage

Deploying DM-Multipath guarantees uninterrupted storage connectivity and high-throughput data resilience across mission-critical Ubuntu SAN environments.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.