How to resize centos root partition

Jugal Patel 21 Reputation points

df -h

/dev/sda2        30G   25G  4.8G  84% /
devtmpfs        3.9G     0  3.9G   0% /dev
tmpfs           3.9G     0  3.9G   0% /dev/shm
tmpfs           3.9G  9.1M  3.9G   1% /run
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sda1       497M   81M  417M  17% /boot
tmpfs           799M     0  799M   0% /run/user/1000

We have resize os partition from Azure Portal to 64GB but it is not reflectingin df -h command.

It is showing old size for **/dev/sda2 ** partition

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,373 questions
Azure Disk Storage
Azure Disk Storage
A high-performance, durable block storage designed to be used with Azure Virtual Machines and Azure VMware Solution.
586 questions
0 comments No comments
{count} votes

Accepted answer
  1. Andreas Baumgarten 99,466 Reputation points MVP

    Hi @Jugal Patel ,

    I am not familiar with Linux but using a search engine is helpful. There are a lot of search results "how to resize a partition in Linux/CentOS". Here are a few:
    Resize Azure Linux CentOS 7 VM OS Disk ->

    As always when working on partitions in any OS: Create a proper backup of the VM first! If something is going wrong you are able to restore the vm from backup.


    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Andreas Baumgarten

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Jugal Patel 21 Reputation points

    Thanks for your Help & Time @Andreas Baumgarten

    I have been to this link

    but have to ran xfs_growfs / after reboot.