---
title: "How to expand a Linux VPS disk after an upgrade | StreetHosting"
description: "After a VPS upgrade, make the new disk space show up in Linux: lsblk, growpart, resize2fs for ext4, xfs_growfs for XFS, and the LVM path with pvresize."
url: "https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk"
type: "page"
language: "en-US"
---

VPS · 9 min · Intermediate

Published on Sep 28, 2026 · Updated on Sep 28, 2026

# Upgraded your VPS disk and the space didn't show up? Partition and filesystem step by step

The upgrade grows the virtual disk, but the partition and filesystem can stay at the old size. Learn how to check whether the image already expanded on its own and how to grow ext4, XFS and LVM with the VPS running.

By [Equipe StreetHosting](https://streethosting.com.br/en/autores#equipe-streethosting) · StreetHosting infrastructure and support team

[Linux administration](https://streethosting.com.br/en/guides/topics/linux)

Summarize with:

[](https://chat.openai.com/?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fexpand-linux-vps-disk.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "ChatGPT") [](https://claude.ai/new?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fexpand-linux-vps-disk.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Claude") [](https://www.google.com/search?udm=50&aep=11&q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fexpand-linux-vps-disk.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Google AI Mode") [](https://x.com/i/grok?text=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fexpand-linux-vps-disk.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Grok") [](https://www.perplexity.ai/search/new?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fexpand-linux-vps-disk.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Perplexity")

Share:

[](https://x.com/intent/tweet?text=How%20to%20expand%20a%20Linux%20VPS%20disk%20after%20an%20upgrade&url=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fexpand-linux-vps-disk "Share on X") [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fexpand-linux-vps-disk "Share on Facebook") [](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fexpand-linux-vps-disk "Share on LinkedIn") [](https://wa.me/?text=How%20to%20expand%20a%20Linux%20VPS%20disk%20after%20an%20upgrade%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fexpand-linux-vps-disk "Share on WhatsApp")

For agents: Copy as Markdown [.md](https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk.md)

In this guide 7 sections

* [What changes when the disk grows](https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk#tres-camadas)
* [Before you touch anything: backup and diagnosis](https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk#antes)
* [Check whether it already expanded on its own](https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk#expandiu-sozinho)
* [Simple partition: ext4 and XFS](https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk#particao-simples)
* [Disk with LVM: pvresize and lvextend](https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk#lvm)
* [Common errors and special cases](https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk#erros)
* [How much disk each VPS offers](https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk#quanto-disco)

Quick answer

To **expand a Linux VPS disk** after an upgrade, check with `lsblk` whether the disk is already larger than the partition. If it is, grow the partition with `sudo growpart /dev/vda 1` (package `cloud-guest-utils`) and then the filesystem: `resize2fs` for ext4 or `xfs_growfs /` for XFS. With LVM, the path is `pvresize` followed by `lvextend -r`. Many cloud images do this on their own at boot through `cloud-init`, so check before you touch anything and have a backup.

## What changes when the disk grows[](https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk#tres-camadas)

VPS storage has layers, and the upgrade only touches the first one. The virtual disk is the device the hypervisor hands to the machine, something like /dev/vda on a KVM VPS. The partition is a slice of that disk, such as /dev/vda1. And the filesystem, ext4 or XFS, is the structure inside the partition, the only layer df can see. Some installations also have LVM sitting between the partition and the filesystem.

| Layer                  | Example                         | Who grows it                          | How to see it |
| ---------------------- | ------------------------------- | ------------------------------------- | ------------- |
| Virtual disk           | /dev/vda at 80 GB               | The upgrade done in the control panel | lsblk         |
| Partition              | /dev/vda1 at 38.9 GB            | growpart, manual or automatic at boot | lsblk         |
| LVM volume, if present | Root logical volume             | pvresize and lvextend                 | sudo lvs      |
| Filesystem             | ext4 or XFS mounted at the root | resize2fs or xfs\_growfs              | df -hT        |

At StreetHosting, a VPS upgrade is done through the control panel, charges only the prorated difference for the billing cycle and increases memory, vCPU and disk. For the virtual machine to see the new hardware, it is rebooted. After that, the virtual disk already has the new size, but the partition and filesystem stay as they were until someone, or some automation in the image, grows both. That is why so many people run the upgrade, run df -h and think it did not work.

If you want a better understanding of why a KVM VPS behaves like a machine with its own disk, partition table and all, the concept is covered in [KVM VPS: what it is and its advantages](https://streethosting.com.br/en/guides/vps/what-is-a-kvm-vps).

## Before you touch anything: backup and diagnosis[](https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk#antes)

Growing a partition and filesystem is a routine operation in the cloud and, with the right tools, safe with the system running. Even so, it is partition table editing: one wrong partition number in the command and the problem turns into a restore. Since the VPS has no automatic snapshots, the backup has to be yours and live outside the machine. If you do not have that routine yet, set it up first with [automatic VPS backups with restic and cron](https://streethosting.com.br/en/guides/vps/vps-backup-restic-cron).

The diagnosis uses three commands:

`lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINTS df -hT / findmnt /`

On an Ubuntu 24.04 cloud image that went from 40 GB to 80 GB, lsblk shows something like this:

`NAME SIZE TYPE FSTYPE MOUNTPOINTS vda 80G disk ├─vda1 38.9G part ext4 / ├─vda14 4M part ├─vda15 106M part vfat /boot/efi └─vda16 913M part ext4 /boot`

How to read it: the vda disk is already 80 GB, but the vda1 partition, mounted at the root, is still 38.9 GB. There is about 40 GB free after it. The FSTYPE column tells you which command will grow the filesystem. If any item with TYPE lvm shows up in the tree, skip to the LVM section.

Pay attention to the numbering. On Ubuntu cloud images, the root is partition 1 even though it physically sits after the others, and it is precisely because it is the last one on the disk that it can grow into the new space. On other images the root may be vda2 or vda3. Never copy the number from a tutorial: always confirm it in your own lsblk.

## Check whether it already expanded on its own[](https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk#expandiu-sozinho)

Many cloud images, including the official Ubuntu ones, ship with `cloud-init`, which runs the growpart and resizefs modules on every boot. If there is free space right after the root partition, it grows the partition and the filesystem automatically. In other words: quite often, after the upgrade reboot, df already shows the new size and there is nothing left to do.

`df -h / cloud-init status sudo grep -iE "growpart|resize" /var/log/cloud-init.log | tail -n 20`

If df already shows the full total, you are done. If the log shows the growpart and resize lines with the old and new sizes, cloud-init did the work. If the command does not exist, the log file does not exist or there is a `/etc/cloud/cloud-init.disabled` file, automatic expansion does not run on this installation, and the path is the manual one in the next sections. This depends on the image used to install the VPS, so it is worth checking instead of assuming.

## Simple partition: ext4 and XFS[](https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk#particao-simples)

First, install the package that provides growpart. On Ubuntu cloud images it is already installed:

`sudo apt install -y cloud-guest-utils`

growpart takes the disk and the partition number separated by a space, not the full partition name:

`# disk /dev/vda, partition 1 sudo growpart /dev/vda 1 # the pattern is the same for other disk names # sudo growpart /dev/sda 1 # sudo growpart /dev/nvme0n1 1`

Output starting with CHANGED, with the old and new sizes, means it worked. The command works with the system running and the root mounted, no rescue mode needed. Run lsblk again: the partition now matches the disk size, but df still shows the old value, because the filesystem still has to grow.

### ext4 filesystem[](https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk#ext4)

`sudo resize2fs /dev/vda1 df -h /`

resize2fs grows ext4 while it is mounted. With no size given, it fills the whole partition. The operation usually takes a few seconds even on large disks, because it only appends new structure at the end.

### XFS filesystem[](https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk#xfs)

`sudo xfs_growfs / df -h /`

xfs\_growfs takes the mount point, not the device, and only works with the filesystem mounted. One detail that matters for planning: XFS can grow, but it can never shrink. If you overestimate the size, there is no way back without recreating the filesystem.

After the virtual disk grows, `fdisk -l` may warn GPT PMBR size mismatch or say that the backup GPT table is not at the end of the disk. That is expected: the table still describes the old size. growpart fixes it when it rewrites the partition table.

## Disk with LVM: pvresize and lvextend[](https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk#lvm)

If lsblk shows an item with TYPE lvm under the partition, there is one more layer. The partition is an LVM physical volume (PV), which belongs to a volume group (VG), and the root logical volume (LV) is carved out of that group. This layout is common on installations done from the Ubuntu Server ISO and rarer on cloud images.

`sudo pvs sudo vgs sudo lvs`

The sequence has three steps: grow the partition that holds the PV, tell LVM that the PV grew, and extend the LV together with the filesystem.

`# example with the PV on /dev/vda3 and the default volume from the Ubuntu installer sudo growpart /dev/vda 3 sudo pvresize /dev/vda3 sudo lvextend -r -l +100%FREE /dev/ubuntu-vg/ubuntu-lv df -h /`

The `-l +100%FREE` option uses all the free space in the group, and `-r` resizes the filesystem in the same command, whether ext4 or XFS. Confirm the LV path in the lvs output or through the device that shows up in df: `/dev/mapper/ubuntu--vg-ubuntu--lv` is the same volume under another name.

The Ubuntu Server installer with LVM usually leaves part of the volume group free and unused. Before you even think about an upgrade, look at the VFree column of `sudo vgs`: there may be gigabytes waiting for nothing more than an lvextend, with no growpart or pvresize needed.

## Common errors and special cases[](https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk#erros)

| Symptom                                    | Likely cause                                                                       | What to do                                                                                                     |
| ------------------------------------------ | ---------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| growpart answers NOCHANGE                  | The disk has not grown yet or there is no free space right after the partition     | Check the disk size in lsblk; if it has not changed, verify the upgrade and the VM reboot in the control panel |
| growpart: command not found                | Package not installed                                                              | Install the package named in the previous section with apt                                                     |
| resize2fs complains about Bad magic number | The filesystem is XFS, or the command pointed at the disk instead of the partition | Check FSTYPE in lsblk and use the partition or LV device                                                       |
| df did not change after growpart           | Only the partition grew                                                            | Run resize2fs, xfs\_growfs or lvextend with the resize option                                                  |
| lvextend says there is no free space       | pvresize was skipped                                                               | Run pvresize on the PV partition and repeat the lvextend                                                       |
| Swap or extended partition after the root  | The new space ended up behind another partition                                    | Disable swap, remove its partition, grow the root and recreate swap as a file                                  |

The last case deserves an explanation. Older images and many manual installations put a swap partition at the end of the disk, sometimes inside an extended partition (vda2 containing vda5). The new space lands after it, and the root cannot grow over it. The way out is to disable swap with swapoff, remove the swap partition with fdisk or parted, drop its line from /etc/fstab, grow the root with growpart and create swap again as a file, the way described in [setting up swap on your Ubuntu VPS](https://streethosting.com.br/en/guides/vps/set-up-swap-ubuntu-vps).

Removing a partition is the only part of this guide that can leave the VPS unable to boot if done wrong. Only do it with a recent backup, double-check the number of every partition and keep the control panel console open in a tab, so you can follow the reboot if SSH does not come back.

On a Windows VPS, the equivalent lives in Disk Management: right-click the C: volume and use Extend Volume. If there is a recovery partition right after C:, it blocks the extension the same way swap blocks it on Linux.

## How much disk each VPS offers[](https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk#quanto-disco)

Before moving up a plan because of disk, confirm the space is being used by data that needs to stay. The journal, old Docker images and backups stored on the VPS itself usually free up gigabytes at no cost, as shown in [finding out what is using space on the VPS](https://streethosting.com.br/en/guides/vps/find-what-uses-disk-space-on-vps).

On StreetHosting VPS plans, NVMe disk scales with the plan: each step brings 10 GB of NVMe for every GB of RAM. The upgrade through the control panel increases memory, vCPU and disk together, charges only the prorated difference for the cycle and reboots the VM; after that, just follow this guide or confirm the image already expanded on its own. A disk downgrade is not always possible, so plan growth in steps instead of jumping to the largest plan at once.

| Line                    | Smallest disk | Largest disk | Monthly price              |
| ----------------------- | ------------- | ------------ | -------------------------- |
| Ryzen 9 9950X VPS, DDR5 | 20 GB NVMe    | 640 GB NVMe  | R$ 40.00 to R$ 846.00      |
| Xeon VPS, DDR4          | 20 GB NVMe    | 640 GB NVMe  | R$ 26.00 to R$ 553.00      |
| AMD dedicated server    | 2 TB NVMe     | 2 TB NVMe    | R$ 1,499.00 to R$ 2,599.00 |

A concrete example: going from 40 GB to 80 GB costs the difference between R$ 66.00 and R$ 118.00 per month on the Ryzen line, or between R$ 43.00 and R$ 77.00 on the Xeon line. If only data is growing, not CPU load, the Xeon delivers the same disk for less. Compare every step on the [VPS page](https://streethosting.com.br/en/vps). Above 640 GB, the option is the [dedicated servers](https://streethosting.com.br/en/dedicated) in São Paulo, with 2 TB NVMe and dedicated 10 Gbps.

In this guide

* [What changes when the disk grows](https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk#tres-camadas)
* [Before you touch anything: backup and diagnosis](https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk#antes)
* [Check whether it already expanded on its own](https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk#expandiu-sozinho)
* [Simple partition: ext4 and XFS](https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk#particao-simples)
* [Disk with LVM: pvresize and lvextend](https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk#lvm)
* [Common errors and special cases](https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk#erros)
* [How much disk each VPS offers](https://streethosting.com.br/en/guides/vps/expand-linux-vps-disk#quanto-disco)

## Frequently asked questions

I upgraded the VPS disk, why doesn't df show the new space?

Because the upgrade grows the virtual disk, but the partition and filesystem stay at the old size. Check with lsblk; if the disk is larger than the partition, run growpart and then resize2fs or xfs\_growfs, unless the image already did it at boot.

Do I need to shut down the VPS to grow the partition?

No. growpart, resize2fs on ext4, xfs\_growfs and lvextend all work with the system running and the root filesystem mounted. The only reboot required is the one that happens during the upgrade, so the VM recognizes the larger disk.

What is the difference between resize2fs and xfs\_growfs?

resize2fs grows ext2, ext3 and ext4 filesystems and takes the device, such as /dev/vda1. xfs\_growfs is for XFS only and takes the mount point, such as the root. Find out which one you have in the FSTYPE column of lsblk or with df -hT.

How do I grow the disk when the VPS uses LVM?

Grow the partition that holds the physical volume with growpart, run pvresize on that partition and then lvextend -r -l +100%FREE on the root logical volume. The -r option resizes the filesystem in the same command.

Can I shrink the VPS disk later?

Not always. Shrinking requires shrinking the filesystem first, which on ext4 only works with it unmounted and on XFS does not exist at all. That is why a disk downgrade is not always possible, and the safest approach is to grow in steps as the need arises.

Next step

See VPS plans

Root VPS in Brazil with NVMe and Anti-DDoS.

[See VPS plans](https://streethosting.com.br/en/vps)

[See Xeon VPS Xeon VPS for steady workloads, automation and long-running projects.](https://streethosting.com.br/en/vps/xeon) [See dedicated servers Exclusive hardware in São Paulo with NVMe and Anti-DDoS.](https://streethosting.com.br/en/dedicated)

## Related guides

[VPS Beginner What is taking up disk space on your VPS: how to find and free it A full disk takes down databases, stalls updates and makes applications fail without a clear error message. Here is how to find the culprit in a few commands and what you can delete without breaking anything. 9 min Read guide](https://streethosting.com.br/en/guides/vps/find-what-uses-disk-space-on-vps) [VPS Advanced How to automate VPS backups with restic and cron A backup that depends on you remembering does not work. With restic and cron you create encrypted snapshots, send them off the VPS, control retention and test restores without daily effort. 9 min Read guide](https://streethosting.com.br/en/guides/vps/vps-backup-restic-cron) [VPS Intermediate How to set up swap on Ubuntu on a VPS Swap does not replace RAM, but it helps during peaks and can keep services from crashing when memory runs out. 2 min Read guide](https://streethosting.com.br/en/guides/vps/set-up-swap-ubuntu-vps)

[← Back to the Guide Center](https://streethosting.com.br/en/guides)
