---
title: "Expand CentOS LVM disk and filesystem"
url: https://michalasobczak.pl/posts/expand-centos-lvm-disk-and-filesystem.html
author: "Michał Sobczak"
description: "There are two ways of expanding your root filesystem space. It’s either by adding additional volumes or by resizing PV. Let’s try the latter. We have CentOS 7 wth XFS running on Proxmox. First expand drive size with admin UI."
published: 2022-11-02T10:21:29.000Z
updated: 2022-11-02T10:22:17.000Z
language: en
categories: ["Technology"]
tags: ["CentOS"]
license: CC BY-NC-ND 4.0 (https://creativecommons.org/licenses/by-nc-nd/4.0/)
---
# Expand CentOS LVM disk and filesystem

There are two ways of expanding your root filesystem space. It’s either by adding additional volumes or by resizing PV. Let’s try the latter. We have CentOS 7 wth XFS running on Proxmox. First expand drive size with admin UI. Next:

```bash
yum install cloud-utils-growpart
growpart /dev/sdX 2
pvresize /dev/sdX2
lvextend -l +100%FREE /dev/mapper/centos-root
# and...
xfs_growfs / # for XFS 
# or
resize2fs /dev/mapper/centos-root
```

At first after resizing drive you will see in `lsblk` that the drive should have additional space. At `growpart` you will see your partition expands. At `pvresize` there is no change. Change happens on `lvextend`, so you will see you LVM increases in space. To see filesystem change in `df` you need to run either `xfs_growfs` or `resize2fs` depending on your filesystem you’re running on.
