DEV Community

Cover image for How To Add A Data Disk To A Virtual Machine
Ahmed Emmanuel Oluwaseyi
Ahmed Emmanuel Oluwaseyi

Posted on

How To Add A Data Disk To A Virtual Machine

A data disk in Azure is a virtualized storage device that you attach to an Azure virtual machine (VM) to store application data, files, databases, or other persistent data. Unlike the OS disk—which holds the operating system—a data disk is used solely for data storage and can be managed independently.

Key Points

  • Persistence: Data disks provide persistent storage that remains available even if the VM is stopped or restarted.

  • Scalability: You can attach multiple data disks to a VM to meet your storage requirements.

  • Performance Options: Data disks come in various types (such as Standard HDD, Standard SSD, and Premium SSD) that offer different performance levels to match your workload needs.

  • Flexibility: They can be detached and reattached to other VMs if needed, making it easier to manage data and scale resources.

This separation of storage helps optimize performance and reliability by isolating the operating system from the data storage workload.

We have to create a virtual machine first on Azure portal, learn more about how to create a virtual machine in my previous videos https://dev.to/sheyitex/creating-a-windows-vitual-machine-in-azure-48m1

virtual machine

On the VM creation page we will select Disk tab
disk
By default, windows already selected a disk for us
windows disk
We can start our disk creation below, but i will want to run through the VM first, before I will add a new disk
create
select the monitoring tab and disable diagnostic
monitoring
come to Tags tab and select add tags, give it a name then review and create
Tags
We will go to resource on the VM we create, go to the settings tab an select disk, once we select disk we will see that there are no values in the data disk section, its empty...
we will click on the + create and attach a new disk tab
create
give the disk a name, select storage type and size then proceed to apply
disk
creating disk
we have our data disk created, but we cannot access it, to gain access to the disk we will close this lab at the top right corner X, and we will have to connect to back to the virtual machine,
close page
connect to the virtual machine, stretch the idle time to the maximum so it will not log you out when you are working on the VM and select Save
vm
edit
Now we will click on connect
connect
select native rdp, wait for it to configure and click on download
native RDP
Download and open
put in your credentials and proceed;
Image description
vm
on the window bar type in Data disk management this will pop up with the description below
management
Select OK88
Image description
The new disk is still **unallocated
because we are yet to format the disk
unallocated disk
click next
next
The data disk is now ready for use
data disk

Thank you for reading through..

Top comments (0)