A common situation is extending a partition with fdisk or parted, then running df -h and noticing that the size hasn’t changed.

That’s because only the partition was expanded, but the filesystem itself still needs to be resized.

resize2fs takes care of that by expanding the ext4 filesystem to fill the newly available space.

In this guide, we’ll explain what resize2fs does, how to expand an ext4 filesystem after resizing a partition, and how to verify the change in Linux.

When you resize a partition using fdisk, parted, growpart, or a cloud provider’s disk expansion tool, only the partition itself gets larger.

The filesystem inside that partition is a separate layer and still thinks it’s the old size.

This happens because ext4 stores its size information in filesystem metadata, including the superblock.

It doesn’t automatically detect that the underlying partition has grown.

That’s where resize2fs comes in.

It updates the filesystem metadata so ext4 can use the newly available space.

Once you run it, the filesystem expands to match the larger partition.

If you skip this step, the extra space remains unused.

Even though the partition is bigger, commands like df -h will continue to show the old filesystem size because ext4 hasn’t been resized yet.

Think of it this way: expanding the partition gives you a larger room, but resize2fs is what removes the wall so the filesystem can actually use that extra space.

Without it, the additional storage is there, but your system can’t access it.

Before resizing anything, it’s a good idea to verify the current sizes of both the filesystem and the partition, which helps you confirm that the partition has already been expanded and that only the filesystem still needs to be resized.

First, check the filesystem size:

Example output:

Next, check the actual partition size:

Example output:

In this example, the partition (/dev/sda1) is already 50 GB, but the filesystem is still only 20 GB.

The extra 30 GB exists on the partition but isn’t being used by the filesystem yet.

This is the situation where resize2fs is needed.

It expands the ext4 filesystem so it can use all the space available in the larger partition.

You can also verify the filesystem type before proceeding:

Example output:

If the filesystem type is ext4, you’re ready to resize it using resize2fs.

If the disk was recently extended on a cloud VPS (like DigitalOcean, Linode, or AWS), the OS might not have scanned the new disk size yet, so run:

Once you’ve confirmed that the partition has already been expanded, the next step is to resize the ext4 filesystem so it can use the extra space.

Run resize2fs against the partition:

Example output:

The important part is the final line, which confirms that the filesystem has been expanded successfully.

Since ext4 supports online resizing, the filesystem can often be grown while it’s mounted and actively in use.

After the resize completes, verify the new size:

Example output:

The filesystem now matches the full size of the partition.

In this example, the partition was expanded to 50 GB, and the filesystem can now use all of that space.

If you want a quick before-and-after check, compare the output of df -h before running resize2fs and after it finishes.

The filesystem size should increase to match the partition size shown by lsblk.

If it does, the resize was successful and the newly available space is ready to use.

When resizing a mounted root filesystem, resize2fs can usually perform the operation online without any downtime.

However, for unmounted partitions, it’s a good practice to run a filesystem check first.

Start by unmounting the partition:

Next, run a filesystem check with e2fsck:

Example output:

e2fsck checks the filesystem for inconsistencies and ensures everything is in a healthy state before resizing.

If all five passes complete without errors, the filesystem is ready to be resized.

Now run resize2fs:

Example output:

Once the resize is complete, mount the partition again and verify the new size:

The updated df -h output should show the larger filesystem size.

A common error you’ll see is:

This simply means resize2fs wants the filesystem to be checked before making changes, so run e2fsck -f on the unmounted partition, then execute resize2fs again.

As a general rule:

Taking a minute to run e2fsck before an offline resize can help catch filesystem issues early and ensures the resize process goes smoothly.

If your filesystem is stored on an LVM logical volume rather than a standard partition, you’ll need to expand the logical volume first and then resize the filesystem.

To add 10 GB to the logical volume, run:

Here’s what the lvextend options mean:

Example output:

In this example, the logical volume grows from 20 GB to 30 GB, and resize2fs immediately expands the ext4 filesystem to use the newly available space.

You can verify the result with:

Both commands should show the larger filesystem size.

If you don’t want to specify an exact size and would rather use all free space available in the volume group, use:

Here, -l +100%FREE tells LVM to allocate all remaining free extents in the volume group to the logical volume.

On many modern Linux distributions, you can even combine both steps into a single command:

The -r option automatically runs the appropriate filesystem resize tool after extending the logical volume, making the process faster and less error-prone.

This is often the easiest approach when working with ext4 filesystems on LVM.

You now know why resize2fs is a separate step from resizing the partition itself.

The filesystem and the partition are different layers, and each one needs to be told about changes to the other.

For a mounted root partition, resize2fs handles it online.

For unmounted partitions, run e2fsck -f first.

Try it on a test disk or a cloud VPS snapshot before doing it on a production system.

Extend the disk by 5G in your provider’s console, then run through the full sequence: lsblk, resize2fs, df -h.

Ever hit a situation where the disk showed the right size but df still showed the old one? Drop a comment below and let me know what tool or step triggered it.

How to Downgrade and Lock Packages With dnf in RHEL Systems

5 Ways to Check Remote Port Connectivity in Linux

at Command: Schedule One-Time Linux Tasks Without Cron

20 Must-Know Linux Commands for System Administrators

How to Stop Linux Processes from Using Excessive CPU and RAM

Create a Chat Server in Linux and 5 Other Terminal Tricks

Hegemon – A Modular System Monitoring Tool for Linux

How To Install and Connect an Agent to Pandora FMS Server

How to Install Nagios 4 in Ubuntu and Debian

How to Monitor Docker Containers with Zabbix Monitoring Tool

How to Check Integrity of File and Directory Using “AIDE” in Linux

7 Best Tools to Monitor and Debug Disk I/O Performance in Linux

How to Clone a Partition or Hard drive in Linux

How to View Configuration Files Without Comments in Linux

How to Manage User Password Expiration and Aging in Linux

How to Use diff3 Command for File Merging in Linux

How to Find MySQL, PHP and Apache Configuration Files

How to Install netstat Command in Linux

8 Useful Linux Security Features and Tools for Beginners

10 Best Flowchart and Diagramming Software for Linux

6 Best Modern Linux ‘init’ Systems (1992-2025)

16 Best Tools to Access Remote Linux Desktop

8 Best RDP (Remote Desktop) Clients for Linux in 2024

8 Useful GUI Email Clients for Linux Desktop

**📚 Original Source:**
[How to Resize ext4 Partitions and Filesystems in Linux](https://www.tecmint.com/resize2fs-expand-ext4-filesystem-linux/)

About The Author

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *