Hey friends! In this post, I want to explain a basic but important concept in Azure: the difference between an OS disk and a data disk on a Virtual Machine.
If you’re managing Azure VMs, understanding this helps you plan storage, backups, performance, and even VM recovery better.
πΉ What is an OS Disk?
The OS disk is where the operating system is installed.
- When I create a new Azure VM, Azure automatically creates an OS disk using the image I select (like Windows Server).
- The OS disk acts like the C: drive on a Windows VM.
π§© Key Points:
- Itβs always required
- Created automatically with the VM
- Usually defaults to 127 GB (can be resized)
- Can be backed up, snapshotted, and restored
- Supports disk encryption
- Deleting the VM doesnβt delete the OS disk unless you choose so
πΈ What is a Data Disk?
A data disk is an additional disk I can attach to the VM for storing:
- Application data
- Logs
- Databases
- Large files or backups
It works just like adding a D:\ or E:\ drive on Windows
π§© Key Points:
- Optional β I attach them manually via Portal, CLI, or PowerShell
- Can add multiple data disks (based on VM size)
- Sizes: from 4 GB to 32 TB per disk
- Supports encryption and backup like OS disks
- Good for separating data from the OS
π οΈ Technical Comparison Table
| Feature | OS Disk | Data Disk |
|---|---|---|
| Required | β Yes | β Optional |
| Created Automatically | β Yes (with VM creation) | β No (manually attached) |
| Default Size | 127 GB | Custom (4 GB to 32 TB) |
| Max Disks Per VM | 1 | Varies by VM size (up to 64+) |
| Contains OS | β Yes | β No |
| Supports Backup | β Yes | β Yes |
| Performance Tier | Standard / Premium / Ultra | Same tiers available |
| Delete on VM Delete | Optional (toggle during delete) | Optional (toggle during detach) |
π¦ Use Cases
OS Disk:
- Run the OS and system files
- Boot the VM
- Store OS-level configurations
Data Disk:
- Store app data and logs
- Host databases (SQL Server, etc.)
- Use as mount points for software installs
π‘ Best Practices (From My Experience)
- Always separate application data from the OS β keep it on data disks
- Use Premium SSD or Ultra Disk for I/O intensive workloads (like databases)
- Use data disk snapshots before critical changes
- Donβt store important files on the OS disk unless you’re backing up the full VM
β Summary
To put it simply:
- The OS disk boots your VM
- The data disk powers your applications and stores your files
Use them wisely, and you’ll improve your VMβs performance, manageability, and disaster recovery strategy.