Azure Linux VM Expand Centos\Redhat 7.x Os Disk

Hello All,

On today scenario we will cover how to expand your Azure Os disk.

Linux Os Disk is usually being created with a size of 29-32 GB and if you expend it it will not automatically grow for some distro.

This seems to be because the Os disk type is XFS. so lets see how can we overcome it.

First lets deallocate the VM and resize the Disk size to the required size, if not already done in the VM creation.

After that lets start the VM and ssh to it. we would like to make sure the kernel is seeing the correct disk size. this can be done by using the fdisk command as shown below. sudo fdisk  -l /dev/sda

you can notice that df is not seeing the entire partition allocated.

After confirming the disk size is correct we need to recreate the partition in order to expand and allocate the maximum block size on that partition.

Here is an example: fdisk -l /dev/sda] and delete partitions 2

Now lets create a new partition and execute part probe command to send a sync command to the kernel.

Now we need to reboot the VM.

Let’s re-connect via ssh and list the mount point sizes.

Should be the same.

Let’s excute the xfs_growfs on our root partition and see how all the blocks are been allocated

Now we are able to see the new allocated size for our / partition.

Thank you,

Tzachi Elkabatz

3 thoughts on “Azure Linux VM Expand Centos\Redhat 7.x Os Disk

Comments are closed.

Close Bitnami banner