When creating an LVM logical volume with lvcreate, what is the difference between the default linear layout and a striped one requested with -i, and when does striping actually buy you anything?
answer
- fill one, then the next
- alternate in fixed chunks
- one stripe wants one disk
- parallelism only if the devices are
- neither layout protects anything
basics
~20 sA linear LV concatenates extents, filling one physical volume before using the next, so one request hits one disk. A striped LV created with lvcreate -i alternates fixed-size chunks across several PVs, so a large sequential transfer is served by all of them in parallel.
solid answer
~50 sLinear is the default: LVM takes extents from the first PV that has them, so a volume on two disks is really the first disk followed by the second, and any single I/O lands on exactly one device. `lvcreate -i 2 -I 128 -L 100G -n data vg0` instead round-robins the volume across two PVs in 128 KiB chunks, so a big sequential read is split between both spindles and throughput roughly adds up. The requirements are real: you need at least as many PVs as stripes, and the stripe count is fixed into the volume's layout. Striping helps when the bottleneck is genuinely per-device — several independent spindles or separate backing devices — and buys nothing when the PVs are slices of one SAN LUN or one SSD that is already parallel inside. It also adds no redundancy: losing one PV in either layout loses the volume, but with striping essentially every file is affected.
code
bash · 4 lineslvcreate -L 50G -n plain vg0
lvcreate -i 2 -I 128 -L 50G -n fast vg0
lvs -o lv_name,seg_type,stripes,stripe_size vg0
lvdisplay -m /dev/vg0/fastgo deeper
Know that linear is the default and simply fills one disk before the next, while -i asks lvcreate for a striped volume spread across several disks for speed.
Explain the round-robin chunking that -i and -I define, why the stripe count needs at least that many physical volumes, and that the layout is fixed at creation time.
Bring the judgment: name the cases where striping is theatre — one SAN LUN, one SSD, small random I/O — and account for the larger failure blast radius of an unprotected stripe.
Own the layering question: whether performance should come from LVM at all rather than from the array, the cloud volume class or the filesystem, and what redundancy has to sit underneath before a stripe is acceptable for production data.
## Two ways to lay a volume across a pool A logical volume is a list of extents, and the interesting question is *which* physical volumes those extents come from and in what order. LVM's segment type answers it. **Linear** (the default) is concatenation. The allocator takes extents from a PV until it runs out, then moves to the next. A 300 GiB volume across two 200 GiB disks is 200 GiB of disk one followed by 100 GiB of disk two. Logical block 0 and logical block 1 are adjacent on the same device, so any individual read or write is served by exactly one disk. **Striped** interleaves. With two stripes and a 64 KiB stripe size, the first 64 KiB of the volume live on PV A, the next 64 KiB on PV B, the next on A again, and so on. A single 1 MiB read is therefore chopped into requests against both devices, which issue them concurrently. ```bash lvcreate -L 100G -n data vg0 # linear, the default lvcreate -i 2 -I 128 -L 100G -n fast vg0 # 2 stripes, 128 KiB stripe size ``` `-i` is the stripe count; `-I` is the stripe size in kibibytes (the default on current LVM2 is 64 KiB, and it must be a power of two). ## What striping actually costs and requires **You need the disks.** With the default allocation policy, LVM places each stripe on a different physical volume, so `-i 3` in a group containing two PVs fails outright with an insufficient-allocatable-extents error. This is not a bug — a stripe set built from two ranges of one disk gives you the seek pattern of striping with none of the parallelism. **The layout is baked in.** The stripe count and size become part of the volume's segment definition. They are not a runtime tunable you can revisit later, so choose them when you create the volume. **Space is consumed in lockstep.** A striped volume takes an equal number of extents from each PV it stripes over, so the usable size is bounded by the smallest contributing disk. Ten spare gigabytes on one PV and none on another is unusable for a two-way stripe. **There is still no redundancy.** Neither layout protects anything. The difference is the blast radius when a PV dies: with a linear volume, files whose extents happened to land on the surviving disk may be recoverable; with a stripe, every file of any size has a piece on the dead device. Striping makes an unprotected volume *more* fragile in practice, which is why it belongs on top of already-redundant devices, not instead of them. ## When it helps — and when it is theatre Striping only wins where the bottleneck is per-device and the devices are genuinely independent: - Several separate physical disks or several separate NVMe namespaces, with a workload doing large sequential I/O or deep parallel I/O. Throughput adds up close to linearly. - A database or log volume where per-device queue depth is the limit rather than the fabric behind it. It does nothing useful when: - The PVs are partitions of the *same* physical device. You have added seek work and gained no parallelism. - The PVs are LUNs carved from one SAN pool or one hardware RAID set. That array already stripes across its own members; layering another stripe on top mostly changes request sizes. - The workload is small random I/O. Each request is smaller than the stripe size, so it lands on one device anyway; the gain comes from having more devices in the group, which linear allocation across a busy pool also delivers. On cloud block storage the calculus is different again: throughput is usually capped per volume by the provider, so attaching several volumes and striping over them is a legitimate way to buy more of it — but the limiting number to check is the instance's aggregate storage bandwidth, not the disk's. ## Telling what you have Existing volumes reveal their layout: ```bash lvs -o lv_name,vg_name,seg_type,stripes,stripe_size lvdisplay -m /dev/vg0/data ``` `seg_type` reads `linear` or `striped`; `stripes` is the count. `lvdisplay -m` prints the segment map — for each range of logical extents, the type and the physical volumes backing it. A volume can even be a mixture: segments created at different times can have different types, which the segment map makes visible and the summary line does not. ## The honest default For most general-purpose volumes, linear is the right answer. It imposes no constraints on how space is consumed, it lets a volume grow onto whatever PV happens to have room, and on modern storage the parallelism it supposedly gives up is usually being provided a layer down. Reach for `-i` when you can name the independent devices you are spreading across and the workload whose profile makes the difference measurable — and when the data underneath is protected by something other than hope.
- Does a striped logical volume give you any redundancy?None. LVM striping is RAID 0 in behaviour: it distributes data for throughput and stores no parity or mirror. If any contributing PV fails, the volume is gone. It also enlarges the blast radius compared with a linear volume, because nearly every file of meaningful size has a chunk on the failed device. Redundancy has to come from a mirrored or raid segment type, or from the storage beneath.
- How do you tell whether an existing logical volume is linear or striped?`lvs -o lv_name,seg_type,stripes,stripe_size` shows the segment type and stripe count as columns. For the full picture use `lvdisplay -m`, which prints the segment map: each range of logical extents with its type and the physical volumes backing it. That also reveals mixed volumes whose segments were created at different times with different layouts.
- Why does striping across two partitions of the same physical disk gain nothing?Parallelism comes from having several devices that can seek and transfer at the same time. Two partitions share one set of heads, one queue and one bus, so alternating between them just adds seeking between two regions of the same platter. The stripe count has to correspond to genuinely independent devices for the throughput to add up.
saying these in an interview costs you the question
- Thinks LVM striping provides redundancy like RAID 1
- Stripes across partitions of one physical disk
- Believes stripe count can be tuned after creation
- Assumes striping always increases throughput
- Confuses stripe size with the extent size