Creating, Attaching, and Detaching Data Disks on a Windows 11 Virtual Machine in Microsoft Azure: A Comprehensive Guide
Tags: azure, virtualmachine, cloudcomputing, webdev
Published: 2024-04-15 03:50:23

**DISKIN MICROSOFT AZURE**

In Microsoft Azure, a disk is a virtualized storage device that can be attached to a virtual machine (VM) to provide persistent storage for data, applications, and the operating system. Azure offers different types of disks that vary in terms of performance, durability, and cost, allowing you to choose the most suitable storage solution for your VM's needs.

**HOW TO CREATE A DISK ON MICROSOFT AZURE WINDOWS 11 VIRTUAL MACHINE**

**STEP ONE**
Go to Microsoft Azure, click on the three bars highlighted.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/827986r6dap0gg5xldax.png)

**STEP TWO**
Select Virtual Machine.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w14vq96862p68snypi8g.png)

**STEP THREE**
Click on the Virtual Machine

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0kb1ppvm6zxxemzw0d4l.png)

**STEP THREE**
Locate disk and click on it.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ub89mzc9ufpy8rd2xsn4.png)

**STEP FOUR**
Click on create and attach new disk

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nw3k6zqnrgjm2in8w7a3.png)

**STEP FIVE**
At this stage, you are expected to select different options.

(a) Logical unit number; Logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.

(b) Disk Name: This is the name you give to the disk you are creating for your virtual machine.

(c) Storage type: This is the size capacity you want your disk should be depending on what you need the to do or the kind of project you have on ground.

Leave the rest on default.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pm3fjjivx7ouf10d6pek.png)

**STEP SIX**
Click on apply.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/poen09aoo0d2nslzxeua.png)

After you clicked on apply, you should have that notification come up.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/17sp971xt27xewhj5t96.png)

**STEP SEVEN**
Go to your virtual Machine... 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1id6a14tk4tunlqafrne.png)

**STEP EIGHT**
Go to file explorer

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d52xgqab9r16dungao1n.png)

**STEP NINE**
Go to search bar and search for disk management.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2tft0hsw5rmo55suhqqw.png)

**STEP TEN**
Go to the virtual machine, right click on the windows sign you see there and click disk management.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xjt1vxwhkk71980014kx.png)

After clicking that you should have the image below.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dn455r3htja44su05nrf.png)

**STEP ELEVEN**
Initialize the disk by clicking ok

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hbphitm2sasa9itq5pmm.png)

**STEP TWELVE**
Right click on disk two and click on new simple volume.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lcnhbh3eekv8s3fku7ip.png)

**STEP THIRTEEN**
Click next

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ncveqzlmxmu0aqd000yk.png)

Click next

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nw5a4jnjhypunn2jtiha.png)

Click next

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wehvw0wm8rzm3eshvh04.png)

Click next

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bw6aoo4elpbranmk9r8s.png)

Click Finish

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rhogbfx3mjrl08pqieen.png)

After these steps, you will notice the status of the disk will read "new volume F" "healthy basic data positioning" 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kqnhred7utjxlnooymae.png)

**STEP FOURTEEN**
Go to file explorer
You will notice a new volume has been added "new volume F"

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x8ifavvamx2tbxuw5hs9.png)

You can chose to rename it by clicking on more options.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xcw68272947n1y63zofd.png)

Click rename

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wffilm38r614wme820f1.png)

**HOW TO DETATCH DELETE AND DATA DISK FROM WINDOWS 11 VIRTUAL MACHINE**

**STEP ONE**
(a) Go to the virtual virtual machine and right click on the windows icon, click on disk management.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/imx0tgv6nyxwmiutcfdz.png)

(b) go to the disk options then right click and select offline.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9fobm8zf67zfpaxzz30o.png)

(c) go to the azure platform where we created the disk, click on the detach icon.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lajnx8expw5mmy1e5wnh.png)

Click apply

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/121xeg23oor3kofwdfve.png)

when you go to this pc on the virtual machine, you will discover that the disk "new volume F" is no more available this is to show that the operation was successful.


**DIFFERENCE BETWEEN OS DISK, DATA DISK AND TEMPORARY DISK**

In Microsoft Azure, virtual machines (VMs) can use different types of disks for various purposes. Here is a summary of the differences between OS disks, data disks, and temporary disks:

**(a) OS Disk:** The OS disk contains the operating system and system files needed to boot and run the VM.
It is typically attached as the boot volume (often as the C: drive on Windows or / on Linux).
OS disks are persistent, meaning data on them remains intact even if the VM is stopped or restarted.
They can be either Premium SSD, Standard SSD, or Standard HDD, depending on performance and cost requirements.

**(b) Data Disk:** Data disks are additional disks that can be attached to a VM to provide extra storage space.
They are used for storing application data, databases, logs, or other persistent data.
Data disks are also persistent, so data on them remains intact even if the VM is stopped or restarted.
Like OS disks, data disks can be either Premium SSD, Standard SSD, or Standard HDD, depending on the desired performance and cost.
Temporary Disk:

**(c) temporary disk:** also known as a "local disk" or "ephemeral disk," is a local storage space located on the VM's physical host.
It is typically used for transient data such as temporary files, caches, or swap files.
Temporary disks are not persistent, so data on them is lost when the VM is stopped or deallocated.
They are designed for high-speed access to support tasks requiring quick data reads and writes.

In summary, OS disks and data disks are persistent and suitable for storing important data and applications, while temporary disks are non-persistent and used for transient data requiring fast access.

Thank you