Course contentsShow
← Linux
Lesson 667 of 1,8197. Storage Management and Logical VolumesFree lesson

Striping across physical volumes

Improve I/O throughput by distributing data blocks across multiple physical spindles.

Enhancing Performance with LVM Striping

In this lesson, you will learn how to boost your disk I/O throughput by distributing data across multiple physical disks simultaneously using LVM striping.

The Concept of Striping

When you create a standard logical volume, data is written sequentially to a physical volume. If you have a high-performance requirement, the speed of that single disk becomes a bottleneck. Striping solves this by breaking your data into small "chunks" and writing them in a round-robin fashion across two or more physical volumes (PVs).

Imagine you are trying to move a massive pile of bricks. If you carry them one by one, it takes a long time. If you have two friends standing side-by-side and you hand one brick to each of them simultaneously, the work gets done twice as fast. In Linux, striping turns your multiple physical disks into that team of friends. Because the data is spread across different physical spindles, the system can perform parallel read/write operations, effectively multiplying your I/O throughput.

Implementing a Striped Logical Volume

To use striping, you must specify the number of stripes (the number of disks involved) and the stripe size (how much data to write to one disk before moving to the next). When creating a logical volume with lvcreate, you use the -i flag for the number of stripes and -I for the stripe size:

# Create a 10GB striped volume across 2 physical volumes with a 64KB stripe size
lvcreate -L 10G -i 2 -I 64k -n striped_vol my_volume_group

In this command:

  • -i 2: Specifies that we are using 2 physical volumes to stripe the data.
  • -I 64k: Sets the "stripe unit." This is the size of the data block written to each disk before switching to the next one.

Critical Considerations

It is important to remember that striping is a performance feature, not a redundancy feature. If one of the physical volumes involved in the stripe fails, the entire logical volume will likely become corrupted. Because you are interleaving data, the system cannot reconstruct the lost chunks easily. Always ensure you have a robust backup strategy when employing striping for performance gains.

Key Takeaway: Striping improves I/O throughput by writing data chunks in parallel across multiple physical volumes, though it requires all participating disks to remain healthy to keep the volume functional.