Azure Managed Disks are the storage behind most Azure virtual machines, and they are designed to be resized and snapshotted without managing storage accounts by hand. A Linux VM that runs out of disk space does not need a rebuild; you can enlarge the managed disk, expand the partition and filesystem from inside the VM, and keep the same VM, IP address, and configuration. Azure Managed Disks also support snapshots, so you can capture a point-in-time copy before a risky upgrade or data migration.
This guide shows how to resize a data disk on a Linux VM with the Azure CLI, expand the filesystem inside the VM, and create and restore from a snapshot. The examples use a standard managed disk attached to an Ubuntu VM, and the same steps apply to other Linux distributions with minor differences in filesystem tools.
Prerequisites for Azure Managed Disks
You need an Azure subscription, the Azure CLI installed and logged in with az login, a resource group containing a Linux VM, and a data disk attached to that VM. Identify the disk name and resource group first with az disk list --output table. You should also know which filesystem is on the disk and whether it is mounted, because the resize steps differ slightly for a mounted data disk versus an OS disk.
Before any resize, take a snapshot. That is not optional advice; a resize is normally safe, but a snapshot gives you a rollback point if the filesystem expansion goes wrong. Note the current disk size, the VM size limits, and whether the disk is Standard SSD, Premium SSD, or Ultra Disk, because performance tiers and maximum sizes differ by disk type.
Step 1: Create a Snapshot of Azure Managed Disks
Create a snapshot with the Azure CLI by referencing the source disk ID. Snapshots are stored as managed resources in the same subscription, and you can choose standard or zone-redundant storage for the snapshot depending on how important the copy is. For a pre-change safety copy, standard storage is usually sufficient.
az snapshot create --resource-group my-rg --name mydisk-snapshot-20261104 --source mydisk --sku Standard_LRS
Wait for the snapshot to complete before you proceed. Check its status with az snapshot show --resource-group my-rg --name mydisk-snapshot-20261104 --query provisioningState and continue only when it reports Succeeded. A snapshot that is still creating does not yet protect you, and starting a risky change during snapshot creation adds unnecessary uncertainty.
To restore from a snapshot later, create a new managed disk from it with az disk create --resource-group my-rg --name mydisk-restored --source mydisk-snapshot-20261104, then attach that disk to a VM or swap it in place of the original. Test the restore procedure on a non-production VM at least once, because a snapshot you have never restored is a hope, not a backup.
Step 2: Resize Azure Managed Disks from the CLI
For a data disk, stop the VM first if you want the safest path, although Azure supports resizing many data disks while the VM is running depending on the disk and VM configuration. The command below resizes a data disk to 256 GiB. Replace the resource group, disk name, and size with your own values, and choose a size that fits within the limits for your disk type.
az vm deallocate --resource-group my-rg --name my-vm
az disk update --resource-group my-rg --name mydisk --size-gb 256
az vm start --resource-group my-rg --name my-vm

Deallocating the VM before the resize is the conservative choice and avoids surprises with disks that do not support live resize. If your VM must stay online, check the Azure documentation for your specific disk type and VM size before attempting a live resize, and test the procedure on a staging VM first. After the resize, Azure reports the new size, but the filesystem inside the VM still sees the old size until you expand it.
Step 3: Expand the Filesystem Inside the Linux VM
Log in to the VM and confirm the disk device and partition layout with lsblk and df -h. For a typical data disk with one partition and an ext4 or XFS filesystem, expand the partition with growpart from the cloud-utils package, then resize the filesystem. The commands below assume the disk is /dev/sdc with partition /dev/sdc1; adjust the device names to your actual layout.
sudo apt update && sudo apt install -y cloud-guest-utils
sudo growpart /dev/sdc 1
sudo resize2fs /dev/sdc1
df -h /mnt/data
For XFS, use sudo xfs_growfs /mnt/data instead of resize2fs, because XFS has its own grow command and resize2fs does not apply to it. For LVM volumes, the steps are different again: extend the physical volume, then the logical volume, then the filesystem. Always confirm the filesystem type with df -T before you run a resize command, because running the wrong tool is how a simple resize becomes data loss.
Verify the new size with df -h and write a test file to confirm the filesystem is writable. If df still shows the old size, the partition was not expanded, the wrong device was resized, or the filesystem resize step was skipped. Work through those three checks in order before you retry anything.
Troubleshooting Azure Managed Disks
If the disk update fails, check that the new size is larger than the current size, because managed disks can only grow, not shrink, through this command. Also check that the VM size supports the disk type and that the subscription has enough quota in the region. A quota error looks like a disk error at first glance, so read the full Azure CLI error message before you retry.
If the filesystem does not expand, confirm that lsblk shows the larger disk, that growpart succeeded on the correct partition, and that you ran the filesystem-specific resize command. If the disk uses LVM, check pvs and lvs output, because the extra space may be sitting in the physical volume while the logical volume is still at the old size.
For related Azure topics, see our guides to Azure VM backup and snapshots and Azure VM scale sets for Linux. The official reference is the Azure Managed Disks overview.
Conclusion
Azure Managed Disks make storage growth a routine operation: snapshot first, resize the disk, expand the partition and filesystem, and verify with df -h. Keep snapshots for pre-change safety, remember that disks only grow through the resize command, and always match the filesystem tool to the filesystem type. With that routine in place, a full disk becomes a short maintenance task, not an emergency rebuild.