skip to content

When you standardise LVM provisioning across a fleet of Linux servers, how do you decide how much of each volume group to allocate to logical volumes up front rather than leaving extents unallocated?

level: principalimportance: nice to knowfreq 31%

answer

  1. one direction is cheap, the other is not
  2. an allocation is nearly permanent
  3. evacuation needs somewhere to go
  4. leanness is a promise to notice in time

basics

~20 s

Allocate lean and grow on demand. LVM growth is online and cheap, while shrinking is offline at best and impossible on XFS, so unallocated extents are the reversible position. Free extents also give operations like pvmove somewhere to relocate data.

solid answer

~50 s

The decision follows an asymmetry: growing a volume is an online, low-risk operation you can repeat; reclaiming space is offline for ext4 and simply unavailable for XFS. So an allocation is close to permanent, and free extents are the option you keep. My default is to size volumes to a near-term forecast with real headroom, leave a deliberate reserve unallocated in each group, and make growth a routine automated or runbooked change triggered by a utilisation alert. The reserve also pays for itself operationally — evacuating a failing physical volume with `pvmove` needs somewhere to put the data. Against that sits real cost: capacity you paid for and are not using, and a growth path that only works if someone or something actually notices in time. The failure mode of a lean policy is a missed alert, so the monitoring and the automation are part of the decision, not an afterthought.

go deeper

for a junior

Understand that leaving space unallocated in a volume group is deliberate, not sloppy, because volumes can be grown later far more easily than they can be shrunk.

for a middle

Be able to state the asymmetry concretely — online growth with lvextend versus offline ext4 shrink and no XFS shrink at all — and explain why that makes unallocated extents the reversible position.

for a senior

Argue the operational side: a reserve is what lets you evacuate a failing physical volume with pvmove, and a lean policy is only safe when utilisation alerting and the growth procedure are reliable enough to act in time.

for a principal

Own the whole tradeoff and write it down: idle capacity cost against outage risk, per-workload sizing rather than a single fleet number, where thin provisioning is and is not acceptable, and how the filesystem standard interacts with the allocation standard.

## The asymmetry that drives everything Every other consideration is downstream of one fact: in LVM, growth and reclamation are not mirror images. - **Growing** is online, fast and boring. Add extents with `lvextend`, grow the filesystem with `resize2fs` or `xfs_growfs` (or let `-r` do both), and no service notices. - **Reclaiming** is an outage on ext4 — `resize2fs` shrinks only while unmounted — and does not exist at all on XFS, the default on RHEL-family systems. Getting space back from an XFS volume means creating a new smaller volume, copying, swapping and deleting. That makes an allocation decision effectively one-way. Unallocated extents, by contrast, keep every option open. When one direction is cheap and the other is expensive or impossible, the sound default is to stay on the cheap side and move only when you have evidence. ## What the reserve buys beyond growth Free extents are not just future capacity for the volume that runs out. They are working room for LVM itself. Evacuating a failing physical volume with `pvmove` requires free extents on the *remaining* devices to receive the data; a group with everything allocated cannot perform that migration at all without first adding a disk, which is not always something you can do at three in the morning. A group that runs at, say, eighty per cent allocated has an escape route that a fully allocated group does not. ## What the reserve costs Be honest about the other side, because a principal-level answer that only lists benefits is not a judgement, it is a preference. - **Idle capacity.** Storage you provisioned, paid for and are not using. On managed cloud volumes billed by provisioned size, that cost is direct and continuous. - **Operational dependence on noticing.** A lean policy trades pre-allocated slack for a promise that someone will act before a volume fills. If filesystem-utilisation alerting is weak or the growth procedure is a manual ticket with a slow queue, the lean policy converts an over-provisioning cost into an outage risk. That is a bad trade, and the right response is to fix the alerting and automate the growth, not to abandon leanness. - **Change volume.** Growth-on-demand means more changes to production, each small but each a change. That argues for automation with guardrails rather than repeated manual intervention. ## How the choice varies by workload One policy across a fleet is convenient, but the sizing inside it should not be uniform: - **Predictable, slow-growing data** — application logs and artefacts with retention policies — can be sized close to forecast, because the growth rate is knowable and the alert lead time is long. - **Bursty or unbounded growth** — a database that can double after a schema change, a cache with no eviction — deserves more slack, because the time between "eighty per cent" and "full" can be minutes rather than weeks. - **Anything where filling the volume is an outage rather than an inconvenience** — a database's data directory, a broker's journal — argues for both slack and an automated growth path, since the alert-to-action window is what actually protects the service. ## Where thin provisioning fits LVM offers over-provisioning as an alternative shape of the same bet: volumes present more capacity than physically exists and consume it as written. That optimises for utilisation and moves the risk from "a volume fills up" to "the shared pool fills up", which is a correlated failure affecting every volume at once. It is a legitimate choice for environments with strong pool-level monitoring and a fast path to add capacity, and a poor one where a single pool backs unrelated critical services. Whichever shape you pick, the underlying question is unchanged: who is watching the number, and how fast can capacity arrive after they do? ## The filesystem choice is part of the policy Because XFS cannot shrink, standardising on it makes the lean policy more important, not less — an over-allocation there is not recoverable without data movement. Standardising on ext4 buys an offline escape hatch at the cost of a maintenance window. Either is defensible; what is not defensible is choosing the filesystem and the allocation policy independently, then discovering the interaction during an incident. ## A defensible default Size to a near-term forecast plus headroom, hold a deliberate unallocated reserve in every group, alert on filesystem utilisation with enough lead time for the growth to complete, automate the grow step so it is a routine action rather than an improvisation, and document the reserve as reserved — not as spare capacity to be quietly consumed the first time someone needs a volume in a hurry.

  • What is the failure mode of an aggressively lean allocation policy?
    A volume fills before anyone acts. Leanness converts pre-paid slack into a dependency on detection and response, so it is only as good as the utilisation alerting and the speed of the growth path. If alerts are noisy or growth is a slow manual ticket, you have traded a known cost for an unknown outage — the fix is automation and alert lead time, not abandoning the policy.
  • Does thin provisioning make this decision go away?
    No, it changes its shape. Over-provisioning optimises utilisation but converts a per-volume risk into a shared-pool risk: when the pool fills, every volume backed by it is affected at once. It suits environments with strong pool-level monitoring and a fast path to add capacity, and suits poorly a pool backing unrelated critical services.
  • How does the filesystem choice interact with this policy?
    Directly. On XFS there is no shrink, so an over-allocation can only be undone by copying data to a new smaller volume — the lean policy is effectively mandatory. On ext4 you retain an offline escape hatch at the cost of a maintenance window. Choosing the filesystem and the allocation policy independently is how teams discover the interaction during an incident.

saying these in an interview costs you the question

  • Allocates every extent at build time because unused space looks wasteful
  • Assumes reclaiming space later is as easy as adding it
  • Treats thin provisioning as free capacity rather than shifted risk
  • Sets one uniform allocation for every workload regardless of growth shape
  • Plans growth-on-demand with no utilisation alerting behind it

context