question

JugalPatel-1270 avatar image
0 Votes"
JugalPatel-1270 asked AndreasBaumgarten commented

How to resize centos root partition

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-machinesazure-disk-storage
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AndreasBaumgarten avatar image
0 Votes"
AndreasBaumgarten answered AndreasBaumgarten edited

Hi @JugalPatel-1270 ,

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:

https://serverfault.com/questions/861517/centos-7-extend-partition-with-unallocated-space
https://blog.bertello.org/2019/12/resizing-centos-7-disk/
https://www.golinuxcloud.com/extend-resize-primary-partition-non-lvm-linux/
https://gist.github.com/troyfontaine/87091bd6a5c68f45dd62ced3d12bc377
Resize Azure Linux CentOS 7 VM OS Disk -> https://www.ntweekly.com/2020/04/20/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)

Regards
Andreas Baumgarten

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JugalPatel-1270 avatar image
0 Votes"
JugalPatel-1270 answered AndreasBaumgarten commented

Thanks for your Help & Time @AndreasBaumgarten

I have been to this link https://www.ntweekly.com/2020/04/20/resize-azure-linux-centos-7-vm-os-disk/


but have to ran xfs_growfs / after reboot.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

You are welcome.

Thanks for the feedback.


Kind regards
Andreas Baumgarten

0 Votes 0 ·