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

# How to Extend an LVM Logical Volume on Linux

> Extend an LVM logical volume on Linux with lvextend -r -l +100%FREE, after pvresize for a bigger disk or vgextend for a new one. Covers pvs, vgs, lvs and lvcreate.

To extend an LVM logical volume, make sure its volume group has free space, then run `sudo lvextend -r -l +100%FREE /dev/vg0/root`. The `-r` option grows the file system in the same step. If the disk got bigger, run `sudo pvresize /dev/vda3` first; if you added a disk, run `sudo pvcreate /dev/vdb` and `sudo vgextend vg0 /dev/vdb` first. Check with `df -h`.

| Difficulty | Time | Works on | Needs |
| - | - | - | - |
| Intermediate | 10–15 minutes | Ubuntu, Debian, AlmaLinux, Rocky Linux, Fedora | sudo, the `lvm2` package, a backup |

## Before you start

* **Take a backup first.** Disk work on a live server can go wrong. On a VPS, take a [panel backup](https://help.freakhosting.com/portals/vps-panel/how-to-schedule-and-restore-backups.md); see also [back up a Linux server](https://help.freakhosting.com/portals/other/how-to-back-up-a-linux-server.md).
* [Connect with SSH](https://help.freakhosting.com/portals/other/how-to-connect-to-a-linux-server-with-ssh.md). Commands use `sudo`; root users can leave it out.
* Keep console access ready: on a VPS the [VNC console](https://help.freakhosting.com/portals/vps-panel/how-to-enable-and-use-vnc-console-access.md) and [rescue mode](https://help.freakhosting.com/portals/vps-panel/how-to-use-rescue-mode.md); on a dedicated server your KVM/IPMI console or a [ticket](https://freakhosting.com/clientarea/submitticket.php).
* LVM tools come in the `lvm2` package: `sudo apt install lvm2` or `sudo dnf install lvm2`.

## What is LVM?

**LVM** (Logical Volume Manager) puts a flexible layer between disks and file systems:

| Layer | What it is | List it with |
| - | - | - |
| Physical volume (PV) | A disk or partition given to LVM, for example `/dev/vda3` | `sudo pvs` |
| Volume group (VG) | A pool of space made from one or more PVs, for example `vg0` | `sudo vgs` |
| Logical volume (LV) | A slice of the pool that holds a file system, for example `/dev/vg0/root` | `sudo lvs` |

You can grow a logical volume while it is mounted and add disks to the pool later.

## How to check your LVM layout

```bash theme={null}
sudo pvs
sudo vgs
sudo lvs
```

```text theme={null}
  PV         VG  Fmt  Attr PSize   PFree
  /dev/vda3  vg0 lvm2 a--  <78.00g 38.00g
  VG  #PV #LV #SN Attr   VSize   VFree
  vg0   1   1   0 wz--n- <78.00g 38.00g
  LV   VG  Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root vg0 -wi-ao---- 40.00g
```

`VFree` is unused space in the volume group. Your names will differ; use the ones `vgs` and `lvs` show. `lsblk` shows how everything fits together.

## How to extend a logical volume with free space

If `VFree` is more than zero:

```bash theme={null}
sudo lvextend -r -l +100%FREE /dev/vg0/root
```

* `-l +100%FREE` adds all free space. Use `-L +10G` to add 10 GB instead.
* `-r` (`--resizefs`) grows the file system too, for ext4 and XFS, while it is mounted.

Check it worked:

```bash theme={null}
df -h /
```

> [!WARNING]
>
> Without `-r`, the logical volume grows but the file system does not, so `df` shows no change. Run `sudo resize2fs /dev/vg0/root` (ext4) or `sudo xfs_growfs /` (XFS) to fix it. Never use `lvreduce` on a volume holding data unless you have a backup: XFS cannot be shrunk at all.

## How to extend LVM after the disk got bigger

When the disk itself is bigger (for example after a plan upgrade), grow each layer from the bottom up:

**1. Grow the partition that holds the PV**

Find it with `sudo pvs` (here `/dev/vda3`), then:

```bash theme={null}
sudo growpart /dev/vda 3
```

See [resize a partition after a disk upgrade](https://help.freakhosting.com/portals/other/how-to-resize-a-partition-after-a-disk-upgrade.md) for installing `growpart`.

**2. Tell LVM the PV is bigger**

```bash theme={null}
sudo pvresize /dev/vda3
```

```text theme={null}
  Physical volume "/dev/vda3" changed
  1 physical volume(s) resized or updated / 0 physical volume(s) not resized
```

`sudo vgs` now shows more `VFree`.

**3. Extend the logical volume and file system**

```bash theme={null}
sudo lvextend -r -l +100%FREE /dev/vg0/root
```

## How to add a new disk to a volume group

> [!WARNING]
>
> `pvcreate` erases the disk you name. Check with `lsblk` and `sudo wipefs -n /dev/vdb` (no output means empty) that you have the new, empty disk.

**1. Make the disk a physical volume**

```bash theme={null}
sudo pvcreate /dev/vdb
```

**2. Add it to the volume group**

```bash theme={null}
sudo vgextend vg0 /dev/vdb
```

```text theme={null}
  Volume group "vg0" successfully extended
```

**3. Extend the logical volume**

```bash theme={null}
sudo lvextend -r -l +100%FREE /dev/vg0/root
```

> [!NOTE]
>
> A logical volume spread over two disks is lost if **either** disk fails. On a dedicated server with several disks, put LVM on top of [software RAID](https://help.freakhosting.com/portals/other/how-to-check-and-manage-software-raid-with-mdadm.md) if you need to survive a disk failure, and keep backups either way.

## How to create a new logical volume

To use free space as a separate volume, for example for `/srv/data`:

```bash theme={null}
sudo lvcreate -n data -L 50G vg0
sudo mkfs.ext4 /dev/vg0/data
sudo mkdir -p /srv/data
sudo mount /dev/vg0/data /srv/data
```

Add it to `/etc/fstab` to mount at boot, as shown in [mount a new disk](https://help.freakhosting.com/portals/other/how-to-mount-a-new-disk-on-linux.md).

## Frequently asked questions

### How do I know if my server uses LVM?

Run `lsblk`. If the `TYPE` column shows `lvm`, or the root device is `/dev/mapper/…`, it uses LVM.

### Can I extend the root logical volume while the server is running?

Yes. `lvextend -r` grows ext4 and XFS online, including `/`.

### What is the difference between -L and -l?

`-L` takes a size such as `+10G`. `-l` takes extents or a percentage such as `+100%FREE`.

### Why does pvresize not add any space?

The partition under the PV has not grown yet. Run `growpart` on it first, then `pvresize` again.

## Related guides

> [card] [VPS and dedicated server guides](https://help.freakhosting.com/portals/other/vps-and-dedicated-server-guides.md)
>
> Every guide in this section.

> [card] [Resize a partition after a disk upgrade](https://help.freakhosting.com/portals/other/how-to-resize-a-partition-after-a-disk-upgrade.md)
>
> growpart, resize2fs and xfs\_growfs.

> [card] [Mount a new disk](https://help.freakhosting.com/portals/other/how-to-mount-a-new-disk-on-linux.md)
>
> Format, mount and add to fstab.

> [card] [Software RAID with mdadm](https://help.freakhosting.com/portals/other/how-to-check-and-manage-software-raid-with-mdadm.md)
>
> Protect data on dedicated servers.

> [card] [Check disk space](https://help.freakhosting.com/portals/other/how-to-check-disk-space-on-linux.md)
>
> Confirm the new space.

***

> [!NOTE]
>
> **Checked against the official [Red Hat Enterprise Linux 9 guide to modifying the size of a logical volume](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/configuring_and_managing_logical_volumes/modifying-the-size-of-a-logical-volume_configuring-and-managing-logical-volumes)** on 4 November 2026; `pvcreate`, `vgcreate`, `vgextend`, `pvresize`, `pvs` and `vgs` tested on Ubuntu 24.04 LTS (lvm2 2.03.16) using loop devices. `lvcreate` and `lvextend` were checked against the documentation only. Commands can differ on other distributions or releases.

> [!NOTE]
>
> ### Need Extra Help?
>
> If you encounter any issues, our support team is ready to assist:
>
> * **Live Chat:** Quick assistance via our website.
> * **Support Ticket:** [Open a Ticket](https://freakhosting.com/clientarea/submitticket.php)
> * **Discord:** [Join our Community](https://discord.gg/freakhosting)
> * **Email:** [support@freakhosting.com](mailto:support@freakhosting.com)

> [!TIP]
>
> ### Save on Your Hosting
>
> Ready to upgrade your hosting? Use code **KB20** at checkout for **20% off** your first order!

***

**Last Updated:** November 2026


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