In this lesson, you will learn how Linux abstracts physical hardware into virtual paths to ensure data remains accessible even when individual connection cables or controllers fail.
The Concept of Multi-pathing
In enterprise storage environments, a single physical disk is rarely connected to a server through just one path. You might have two Host Bus Adapters (HBAs) connecting to two different network switches, which then connect to your storage array. To the operating system, this looks like the same physical disk appearing as multiple distinct device nodes (e.g., /dev/sda, /dev/sdb, and /dev/sdc).
Virtual storage device mapping is the process of creating a single, logical "virtual" device that encapsulates these redundant physical paths. Instead of the filesystem writing directly to sda, it writes to a virtual mapper device. If one cable is unplugged, the mapping layer automatically redirects traffic to an alternative path without the filesystem ever knowing a failure occurred.
Visualizing the Topology
You can see how Linux handles these mappings using the multipath tool. When configured, it creates a unique device identifier under /dev/mapper/.
If you run multipath -ll, you will see a tree-like output showing the relationship between the physical drives and the virtual device:
mpatha (3600508b400105e190000800000b90000) dm-0 HP,LOGICAL VOLUME
size=100G features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=1 status=active
| `- 0:0:0:0 sda 8:0 active ready running
`-+- policy='round-robin 0' prio=1 status=enabled
`- 0:0:0:1 sdb 8:16 active ready running
In this example, mpatha is the virtual device. Notice that sda and sdb are both "mapped" to this single entity. The kernel is currently configured to distribute I/O requests between these two paths.
By mapping the topology this way, you gain two major benefits:
- Redundancy: If path
sdagoes down, the kernel immediately routes requests tosdb. - Load Balancing: You can spread the I/O workload across multiple physical controllers, preventing any single connection from becoming a performance bottleneck.
When managing complex storage, always remember that you are working with an abstraction layer; verify your underlying hardware state before assuming a storage issue is a filesystem error.
Key Takeaway: Virtual storage device mapping creates a resilient logical layer that hides redundant physical paths from the filesystem, ensuring continuous data availability through failover and load balancing.