Disk resizing problem

Majed OMRI 1 Reputation point
2021-11-04T06:53:46.83+00:00

Hi, Please please I have extended my disk from 32 GB to 64GB, in the Azure portal I can see the new size, but in the virtual machine (ubuntu) still display 32 GB. could you please advise

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,991 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Andriy Bilous 11,426 Reputation points MVP
    2021-11-04T08:23:06.143+00:00

    Hello @Majed OMRI

    I understand that you have extended disk from 32 GB to 64GB in Azure Portal.
    If your disk was not extended in OS , you need to resize the disk partition from 32 GB to 64GB in Ubuntu OS directly.
    Steps to increase disk in Ubuntu:

    Login to Your Linux VM and check space on disks

    df -h  
    

    In Ubuntu you will see partition with 32GB size (For example /dev/sda1)

    Change partition:

    sudo fdisk /dev/sda  
    

    Press u to change the units to sectors.

    Press p to list the partitions details. The most important information is the starting sector (e.g. 2048).

    Next step is to delete the partition (it will not delete Your data, it will only alter the partition table).
    Press d and select the partition (if it’s only one partition, it will be selected automatically).

    Press n and next press p to create a primary partition.
    Press 1 or 2 to create first or second partition (depends on which partition we deleted). Next, enter the same value for starting sector from step where we have been printing an information about partitions. To end accept the default end sector to use the entire disk.

    Write the partitions pressing w. If there will be some error, just ignore it - it's OK.
    Reboot

    sudo reboot  
    

    Resize the filesystem

    sudo resize2fs /dev/sdaX  
    

    Where X is resized partition's number. This operation can take a long time, so don't be nervous.
    Verify

    df -h  
    

    https://lnx.azurewebsites.net/resizing-a-linux-vm-system-disk-in-microsoft-azure/

    https://video2.skills-academy.com/en-us/azure/virtual-machines/linux/expand-disks

    https://video2.skills-academy.com/en-us/azure/virtual-machines/linux/resize-os-disk-gpt-partition#ubuntu

    1 person found this answer helpful.

  2. Giovani Costa 1 Reputation point
    2022-01-22T18:12:55.637+00:00

    I solved that with

    sudo parted -l

    and fix option

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.