> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Logical Volumes

> Overview of Logical Volume Management, covering PV VG LV architecture, common commands, benefits, and a basic workflow for creating and resizing flexible storage volumes.

A common limitation of traditional disk partitioning is fixed-size partitions: you allocate space once, and changing that allocation later is often disruptive. Logical Volume Management (LVM) removes that rigidity by pooling physical storage and letting you create, grow, shrink, and snapshot volumes with minimal downtime.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/9E2T0ocsNwD7Od8i/images/Prep-Course-Red-Hat-Certified-System-Administrator-RHCSA/Storage-Management/Logical-Volumes/dark-ui-blue-tiles-free-space.jpg?fit=max&auto=format&n=9E2T0ocsNwD7Od8i&q=85&s=e1599dc9abcd5d84caa0fa694949dac6" alt="A dark-themed UI mockup showing a row of blue gradient tiles with an indicated &#x22;Free Space&#x22; slot at the right. Below the tiles are three rounded buttons labeled &#x22;Create&#x22;, &#x22;Assign&#x22;, and &#x22;Realize.&#x22;" width="1920" height="1080" data-path="images/Prep-Course-Red-Hat-Certified-System-Administrator-RHCSA/Storage-Management/Logical-Volumes/dark-ui-blue-tiles-free-space.jpg" />
</Frame>

Instead of many separate, fixed buckets of space,

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/9E2T0ocsNwD7Od8i/images/Prep-Course-Red-Hat-Certified-System-Administrator-RHCSA/Storage-Management/Logical-Volumes/12-buckets-to-water-tank-diagram.jpg?fit=max&auto=format&n=9E2T0ocsNwD7Od8i&q=85&s=65e297dc2ec5cbbdb2033c1e002681bc" alt="A diagram showing twelve simple bucket icons arranged in a grid on the left with a right-pointing arrow. The arrow points to a large cylindrical container labeled &#x22;Water Tank&#x22; on a dark background." width="1920" height="1080" data-path="images/Prep-Course-Red-Hat-Certified-System-Administrator-RHCSA/Storage-Management/Logical-Volumes/12-buckets-to-water-tank-diagram.jpg" />
</Frame>

you aggregate devices into one large pool — the volume group — and carve out flexible, resizable logical volumes from that pool. If one logical volume needs additional space, you can increase its allocation without rebuilding partitions or moving data manually.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/9E2T0ocsNwD7Od8i/images/Prep-Course-Red-Hat-Certified-System-Administrator-RHCSA/Storage-Management/Logical-Volumes/water-tank-pouring-three-buckets.jpg?fit=max&auto=format&n=9E2T0ocsNwD7Od8i&q=85&s=49052e99ef5921454f0375dc72909795" alt="A large cylindrical water tank on the left labeled &#x22;Water Tank&#x22; with dashed arrows showing water being poured into three buckets of different sizes on the right. The graphic uses simple line art on a dark background." width="1920" height="1080" data-path="images/Prep-Course-Red-Hat-Certified-System-Administrator-RHCSA/Storage-Management/Logical-Volumes/water-tank-pouring-three-buckets.jpg" />
</Frame>

One pool, many adjustable volumes.

## LVM architecture (three layers)

Think of LVM in three simple layers:

* Physical Volumes (PV): the real disks or partitions you initialize for LVM.
* Volume Group (VG): a combined storage pool built from one or more PVs.
* Logical Volumes (LV): the usable block devices you create from the VG; they can be formatted, mounted, and resized.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/9E2T0ocsNwD7Od8i/images/Prep-Course-Red-Hat-Certified-System-Administrator-RHCSA/Storage-Management/Logical-Volumes/lvm-logical-volumes-volume-group-ssds.jpg?fit=max&auto=format&n=9E2T0ocsNwD7Od8i&q=85&s=7ef5799da20ee23908fdcbe40cda086e" alt="A diagram titled &#x22;LVM Components&#x22; showing two logical volumes (Logical Volume 01 and 02) layered above a single Volume Group, which in turn is built on multiple physical SSD volumes." width="1920" height="1080" data-path="images/Prep-Course-Red-Hat-Certified-System-Administrator-RHCSA/Storage-Management/Logical-Volumes/lvm-logical-volumes-volume-group-ssds.jpg" />
</Frame>

This layered model is what provides LVM's flexibility and makes commands predictable.

## Common LVM commands

Below is a compact reference of the primary LVM commands organized by layer. Use these commands to initialize devices, build pools, and manage logical volumes.

| Layer | Purpose | Common commands |
| - | - | - |
| Physical Volume (PV) | Prepare disks/partitions for LVM and inspect or move extents | `pvcreate`, `pvdisplay`, `pvmove`, `pvremove` |
| Volume Group (VG) | Create and manage the storage pool that backs LVs | `vgcreate`, `vgdisplay`, `vgextend`, `vgremove` |
| Logical Volume (LV) | Create, inspect, resize, or remove the volumes you use | `lvcreate`, `lvdisplay`, `lvextend`, `lvremove` |

You can think of the command flow as PV → VG → LV; the naming conventions make the workflow intuitive.

Example listing of the commands:

```bash theme={null}
pvcreate
pvdisplay
pvremove
pvmove

vgcreate
vgdisplay
vgremove
vgextend

lvcreate
lvdisplay
lvremove
lvextend
```

## Benefits of LVM

* Flexible allocations: grow or shrink volumes (within filesystem limits) as needs change.
* Storage pooling: combine multiple disks into a single administration unit to simplify capacity management.
* Online resizing: extend logical volumes (and typically their filesystems) without rebooting.
* Snapshots: capture point-in-time volume states for backups, testing, or safe upgrades.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/9E2T0ocsNwD7Od8i/images/Prep-Course-Red-Hat-Certified-System-Administrator-RHCSA/Storage-Management/Logical-Volumes/lvm-benefits-flexible-pooling-resize-snapshots.jpg?fit=max&auto=format&n=9E2T0ocsNwD7Od8i&q=85&s=dbcaf5e3b558a8040d71a54747827317" alt="A dark-themed slide titled &#x22;LVM - Benefits&#x22; showing four feature boxes. They list Flexible (dynamic storage allocation), Storage Pooling (combine disks into pool), Online Resizing (extend volumes without reboot), and Snapshots (point‑in‑time volume copies)." width="1920" height="1080" data-path="images/Prep-Course-Red-Hat-Certified-System-Administrator-RHCSA/Storage-Management/Logical-Volumes/lvm-benefits-flexible-pooling-resize-snapshots.jpg" />
</Frame>

<Callout icon="lightbulb" color="#1CB2FE">
  Online resizing often works without downtime, but it depends on the filesystem. For example, [XFS](https://en.wikipedia.org/wiki/XFS_filesystem) supports online growth with [xfs\_growfs](https://man7.org/linux/man-pages/man8/xfs_growfs.8.html) but cannot be shrunk; `ext4` can typically be grown online with `resize2fs` and usually requires unmounting to shrink. Always check filesystem capabilities before resizing. Also consider using [thin provisioning](https://en.wikipedia.org/wiki/Thin_provisioning) or modern snapshot approaches for better snapshot performance.
</Callout>

## Quick workflow example (high level)

1. Prepare devices as PVs: `pvcreate /dev/sdb /dev/sdc`
2. Create a VG from those PVs: `vgcreate vg_data /dev/sdb /dev/sdc`
3. Create an LV from the VG: `lvcreate -n lv_backup -L 100G vg_data`
4. Format and mount the LV: `mkfs.ext4 /dev/vg_data/lv_backup` → `mount /dev/vg_data/lv_backup /mnt/backup`
5. Increase an LV when needed: `lvextend -L +50G /dev/vg_data/lv_backup` then grow the filesystem (e.g., `resize2fs` or `xfs_growfs` as appropriate)

## Links and references

* LVM man pages and documentation: [https://man7.org/linux/man-pages/man8/lvm.8.html](https://man7.org/linux/man-pages/man8/lvm.8.html)
* XFS filesystem: [https://en.wikipedia.org/wiki/XFS\_filesystem](https://en.wikipedia.org/wiki/XFS_filesystem)
* ext4 filesystem: [https://en.wikipedia.org/wiki/Ext4](https://en.wikipedia.org/wiki/Ext4)
* Thin provisioning overview: [https://en.wikipedia.org/wiki/Thin\_provisioning](https://en.wikipedia.org/wiki/Thin_provisioning)
* Kubernetes and LVM (storage planning): [https://kubernetes.io/docs/concepts/storage/volume-pvc-datasource/](https://kubernetes.io/docs/concepts/storage/volume-pvc-datasource/)

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/red-hat-certified-system-administrator-rhcsa/module/2f9323b6-f8cf-4f7e-94e3-a136743e7970/lesson/1c2b1e9a-ce9b-49dc-8153-7fc24a72a0bc" />
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.