Need to Reduce Data disk size of Linux VM on azure

kumar b 1 Reputation point
2021-11-26T09:49:30.497+00:00

Need to Reduce Data disk size of Linux VM on azure

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,165 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.
573 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Manu Philip 16,986 Reputation points MVP
    2021-11-26T14:20:17.1+00:00

    Shrinking the size of Azure Managed disks (Data disks) are not supported presently. However, you can go for following options

    1. Export the data disk as vhd and shrink the exported VHD. Create a new managed disk from the VHD and create a new VM from the new managed disk.
    2. Attach a new disk to the vm with the required size and copy the data from the existing disk to the new disk. Finally, delete the existing disk
    0 comments No comments

  2. Sumarigo-MSFT 43,801 Reputation points Microsoft Employee
    2021-11-26T16:36:34.523+00:00

    @kumar b Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    You can't reduce the size of a disk, so you have to attach another disk and copy the content over using Azcopy, robocopy or other method.

    152991-image.png

    At the moment, we cannot directly shrink or downsize the azure managed disks. Azure does not support the operation. For more details, please refer to the Faqs for more information.

    If we want to downsize the azure disk. We need to export the disk as vhd then shrink the exported VHD. At last, create a new managed disk from the VHD and create a new VM from the new managed disk. For more details, please refer to here

    Please let us know if you have any further queries. I’m happy to assist you further.

    ----------

    Please do not forget to 152919-image.png and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments