HOW TO ATTACH A DATA DISK TO A VIRTUAL MACHINE AND INITIALIZE IT FOR USE
This step-by-step article describes the different types of Disks of a virtual machine (VM) and shows how to attach a new managed data disk to a Windows 11 virtual machine (VM), using the Azure portal. Types of Data Disks - Ultra disks: designed to meet the demand of mission-critical applications requiring extremely low latency(easily accessible / fast response time) and high IOPS(Input/Output Operations Per second) - Standard HDD : Cost-effective, suitable for low I/O Workloads - Standard SSD : Balance between cost and performance - Premium SDD : High-performance, suitable for high I/O workloads. There are three main disk roles in Azure namely OS Disk, the Data Disk and the Temporary Disk - OS DISK : The operating system (OS) disk is the primary disk for the VM. It contains the OS and is used to boot the VM. It is created automatically when you deploy a VM. - Data disks : used to store application data, databases, logs, or other files. They are separate from the OS disk and allow for scalable storage. You can attach multiple data disks to a VM, depending on its size (e.g., the number of data disks varies with VM SKU). - The Temporary Disk : provides non-persistent storage for temporary data, such as swap files, page files, or application caches. For Windows VMs, it appears as the D: drive. Attaching a Data Disk to your Windows Virtual Machine i) Sign in to your Azure portal and Create a Windows Virtual Machine You can refer to my previous post on How to create a Windows Virtual Machine in Azure ii) Navigate to the left pane of your VM Dashboard, Click "Settings" dropdown and select "Disks" iii) Scroll down the Disks page and select "Create and attach a new Disk" iv) Name your new Data disk, Ignore the other information as the default and Apply accordingly Notice how the Operating System Disk and the Data Disk are two different disks Initializing a Data Disk in a Windows Virtual Machine When you attach a new data disk to your Windows virtual machine (VM), it’s not immediately ready for use. You need to initialize and format the disk to start using it for storing data. In this guide, we’ll walk you through the simple steps to prepare a data disk in a Windows environment. Steps to Initialize and Use a Data Disk in a Windows VM 1. Connect and Log Into Your Windows Virtual Machine Click "Connect" on your VM page, download the RDP File, and proceed to log into your Windows Virtual Machine Enter your VM’s IP address or hostname, along with your login credentials. 2. Open Disk Management Once logged in: Right-click the Start button (or press Win + X). Select Disk Management from the menu. 3. Initialize the New Disk When Disk Management opens: A pop-up window may prompt you to initialize the newly attached disk. If you don’t see this prompt, locate the disk manually: Look for the disk labeled Unknown and Not Initialized. Right-click the new disk and select Initialize Disk. Choose a partition style: GPT (GUID Partition Table) : Recommended for modern systems and larger disks. MBR (Master Boot Record) : Use for compatibility with older systems. Click OK to complete the initialization. 4. Create and Format a New Volume Scroll down and Locate the initialized disk’s Unallocated space. Right-click the unallocated space and select "New Simple Volume". Follow the New Simple Volume Wizard: Assign a volume size (use the default to allocate the entire disk). Choose a drive letter (e.g., D: or E:). Select a file system: NTFS: Recommended for most use cases. exFAT: Useful for cross-platform compatibility. Optionally, add a volume label (e.g., "DataDisk"). Click Finish to format the disk and create the volume. In the new volume highlighted Blue, you can see that our new volume has been initialized. To confirm Initialization , Double Click on your new data disk highlighted Blue 6. Verify the Disk Once the process is complete: Open File Explorer. You should see the new disk with the assigned drive letter and label. The disk is now ready for use! Best Practices for Managing Data Disks Back Up Your Data: Regularly back up critical files to protect against accidental loss. Monitor Disk Performance: Use built-in tools like Performance Monitor to ensure optimal disk usage. Resize When Needed: In cloud environments, you can easily resize data disks to accommodate growing storage needs. Conclusion Initializing and formatting a data disk in a Windows virtual machine is quick and easy. By following these steps, you can prepare your disk for use, ensuring your VM has the storage it needs to run efficiently. Properly managing your data disks will improve organization, performance, and scalability.
This step-by-step article describes the different types of Disks of a virtual machine (VM) and shows how to attach a new managed data disk to a Windows 11 virtual machine (VM), using the Azure portal.
Types of Data Disks
- Ultra disks: designed to meet the demand of mission-critical applications requiring extremely low latency(easily accessible / fast response time) and high IOPS(Input/Output Operations Per second)
- Standard HDD : Cost-effective, suitable for low I/O Workloads
- Standard SSD : Balance between cost and performance
- Premium SDD : High-performance, suitable for high I/O workloads.
There are three main disk roles in Azure namely OS Disk, the Data Disk and the Temporary Disk
- OS DISK : The operating system (OS) disk is the primary disk for the VM. It contains the OS and is used to boot the VM. It is created automatically when you deploy a VM.
- Data disks : used to store application data, databases, logs, or other files. They are separate from the OS disk and allow for scalable storage. You can attach multiple data disks to a VM, depending on its size (e.g., the number of data disks varies with VM SKU).
- The Temporary Disk : provides non-persistent storage for temporary data, such as swap files, page files, or application caches. For Windows VMs, it appears as the D: drive.
Attaching a Data Disk to your Windows Virtual Machine
i) Sign in to your Azure portal and Create a Windows Virtual Machine
- You can refer to my previous post on How to create a Windows Virtual Machine in Azure
ii) Navigate to the left pane of your VM Dashboard, Click "Settings" dropdown and select "Disks"
iii) Scroll down the Disks page and select "Create and attach a new Disk"
iv) Name your new Data disk, Ignore the other information as the default and Apply accordingly
- Notice how the Operating System Disk and the Data Disk are two different disks
Initializing a Data Disk in a Windows Virtual Machine
When you attach a new data disk to your Windows virtual machine (VM), it’s not immediately ready for use. You need to initialize and format the disk to start using it for storing data. In this guide, we’ll walk you through the simple steps to prepare a data disk in a Windows environment.
Steps to Initialize and Use a Data Disk in a Windows VM
1. Connect and Log Into Your Windows Virtual Machine
Click "Connect" on your VM page, download the RDP File, and proceed to log into your Windows Virtual Machine
Enter your VM’s IP address or hostname, along with your login credentials.
2. Open Disk Management
Once logged in:
Right-click the Start button (or press Win + X).
Select Disk Management from the menu.
3. Initialize the New Disk
When Disk Management opens:
A pop-up window may prompt you to initialize the newly attached disk.
If you don’t see this prompt, locate the disk manually:
Look for the disk labeled Unknown and Not Initialized.
Right-click the new disk and select Initialize Disk.
Choose a partition style:
GPT (GUID Partition Table)
: Recommended for modern systems and larger disks.MBR (Master Boot Record)
: Use for compatibility with older systems.
Click OK to complete the initialization.
4. Create and Format a New Volume
Scroll down and Locate the initialized disk’s Unallocated space.
Right-click the unallocated space and select "New Simple Volume".
Follow the New Simple Volume Wizard:
Assign a volume size (use the default to allocate the entire disk).
- Choose a drive letter (e.g., D: or E:).
- Select a file system:
NTFS: Recommended for most use cases.
exFAT: Useful for cross-platform compatibility.
Optionally, add a volume label (e.g., "DataDisk").
Click Finish to format the disk and create the volume.
- In the new volume highlighted Blue, you can see that our new volume has been initialized.
- To confirm Initialization , Double Click on your new data disk highlighted Blue
6. Verify the Disk
Once the process is complete:
Open File Explorer.
You should see the new disk with the assigned drive letter and label.
The disk is now ready for use!
Best Practices for Managing Data Disks
Back Up Your Data:
Regularly back up critical files to protect against accidental loss.Monitor Disk Performance:
Use built-in tools like Performance Monitor to ensure optimal disk usage.Resize When Needed:
In cloud environments, you can easily resize data disks to accommodate growing storage needs.
Conclusion
Initializing and formatting a data disk in a Windows virtual machine is quick and easy. By following these steps, you can prepare your disk for use, ensuring your VM has the storage it needs to run efficiently. Properly managing your data disks will improve organization, performance, and scalability.