LightYear
/Docs
DocsStorageExpand Disk Space on a Linux Server

Expand Disk Space on a Linux Server

Resize a partition and expand the filesystem after upgrading to a larger server plan.

intermediate
7 min read
LightYear Docs Team
Updated April 24, 2026
diskfilesystemresizepartitionlinux

After resizing your server to a larger plan, the additional disk space is allocated but not automatically available. You must resize the partition and expand the filesystem to use the new space.

Check Current Disk Usage

>_BASH
$df -h /
OUTPUT
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        25G   8G   17G  32% /
>_BASH
$lsblk
OUTPUT
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
vda    252:0    0   80G  0 disk
└─vda1 252:1    0   25G  0 part /

The disk (vda) is 80 GB but the partition (vda1) is only 25 GB — the remaining 55 GB is unallocated.

Step 1 — Install growpart

>_BASH
$apt install -y cloud-guest-utils

Step 2 — Resize the Partition

>_BASH
$growpart /dev/vda 1
OUTPUT
CHANGED: partition=1 start=2048 old: size=52426752 end=52428800 new: size=167770079 end=167772127

Step 3 — Resize the Filesystem

For ext4 filesystems:

>_BASH
$resize2fs /dev/vda1
OUTPUT
resize2fs 1.46.5 (30-Dec-2021)
Filesystem at /dev/vda1 is mounted on /; on-line resizing required
old_desc_blocks = 4, new_desc_blocks = 10
The filesystem on /dev/vda1 is now 20971259 (4k) blocks long.

For XFS filesystems:

>_BASH
$xfs_growfs /

Step 4 — Verify the New Size

>_BASH
$df -h /
OUTPUT
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        79G   8G   71G  11% /

The filesystem now uses the full 80 GB disk.

[!NOTE] This process is safe to perform on a live, running server. The resize2fs command supports online resizing for ext4 filesystems mounted at /.

Was this article helpful?

Your cookie choices for this website

This site uses cookies and related technologies, as described in our privacy policy, for purposes that may include site operation, analytics, and enhanced user experience. You may choose to consent to our use of these technologies, or manage your own preferences. Cookie policy