An Azure service that is used to provision Windows and Linux virtual machines.
Hello AnandUpadhyay
Yes, you can expand the size of virtual hard disks attached to an Azure virtual machine without data loss. However, there are a few important considerations:
- Shrinking disks is not supported and may result in data loss.
- Expanding disks is supported, but depending on the disk type, it may require downtime.
- Data Safety - Expanding a disk does not cause data loss. Shrinking is not supported and can lead to data corruption.
- Downtime Requirements
OS Disk: The VM must be deallocated before you can resize the OS disk.
Data Disk: If you use the “Expand without downtime” feature, you can resize without stopping the VM. Otherwise, deallocation is required.
- Post-Resize Step
After resizing the disk in Azure, you must extend the volume inside the operating system (Windows or Linux) to utilize the additional space.
Steps to perform - Stop or Deallocate the VM (required for OS disk, optional for data disk if not using online resize).
Resize the Disk in Azure Portal:
- Go to Disks under your VM > Select the disk you want to expand > Update the size and save and then Start the VM.
- Open Disk Management.
- Locate the disk and right-click the volume.
- Select Extend Volume and follow the wizard.
If your VM uses a spanned volume:
- Stop the VM.
- Resize each disk in the spanned set.
- Start the VM.
- Use Disk Management to extend the spanned volume to include the new space.
https://learn.microsoft.com/en-us/azure/virtual-machines/windows/expand-disks
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Thanks,
Manish Deshpande