Skip to content

NKCODE TECH GEEK ZONE

  • RSS - Posts
Menu
  • Home
  • Cloud
    • Azure
    • Alibaba
    • AWS
  • Hardware
  • Linux
  • Network
  • Security
  • Windows Client / Servers
    • SQL
    • Windows Client OS
      • Windows 10
    • Windows Servers
      • Windows 2008R2
      • Windows Server 2012R2
      • Windows Server 2016
      • Windows Server 2019
  • VMWARE
  • Free Tools
  • About Me
    • Disclaimer
Menu

Increase the size of the OS disk and data disk in an Azure VM

Posted on October 20, 2018

Eexpand the existing OS disk and the data disk. how can we do it with the PowerShell script.

In this requirement, need to increase the C drive to 256 GB and H drive to 128 GB managed disk. As you can see below the disks are almost full.

login to your Azure Subscription.

the following PowerShell commands to store the VM and resource-related information in the variable and later stop the VM.

In this step, you need to store the OS disk details in a variable called $disk and assign the size to 256 GB and update the configuration with the Update-AzureRmDisk command as you can see below

Same steps we need to repeat for the data disk as well where we stored the disk related information in a variable called $disk1, please note DataDisk[0] means the disk which is attached to LUN no. 0

Once it’s done you can start the Azure VM

You can find that the disk size increase is reflecting in the portal.

Now you can log in to windows and go run and type compmgmt.msc, from there go to disk management and click on C drive and click on extend the volume in the drop-down menu.

Once you click on that the extend volume wizard will open and it will extend the volume, the below screenshot is showing this step for the data disk.

In next step click on finish to complete the wizard.

Now should be able to see the extra space in your disks now.

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to email a link to a friend (Opens in new window) Email

Like this:

Like Loading...

Related

Welcome to Teck Geek Zone

Alibaba & Azure Cloud with a free trial worth $200-1200 USD Click below Cloud Providers

  • Securing Your Cloud Environment with Alibaba Cloud Firewall
  • 🚢 Sailing into the Data Age: How Cloud and IoT are Revolutionizing the Marine Industry
  • What is Azure Grafana? A Comprehensive Guide to Monitoring and Visualization
  • 🔐 How to Enable Virtualization-Based Security (VBS) for Windows Workloads in VMware Cloud Foundation and vSphere
  • Microsoft’s Azure SRE Agent: AI-Powered Reliability Engineering

Categories

  • Cloud (186)
    • Alibaba (39)
    • AWS (39)
    • Azure (114)
  • Free Tools (5)
  • Hardware (17)
  • Linux (13)
  • Network (28)
  • Security (21)
  • VMWARE (54)
  • Windows OS (44)
    • Windows 10 (7)
  • Windows Servers (69)
    • SQL (3)
    • Windows 2008R2 (7)
    • Windows Server 2012R2 (15)
    • Windows Server 2016 (20)
    • Windows Server 2019 (10)

Subscribe to our newsletter

©2025 NKCODE TECH GEEK ZONE | Design: Newspaperly WordPress Theme
 

Loading Comments...
 

    %d