DEMYSTIFYING AZURE DISKS: FROM CREATION TO INITIALIZATION
Tags: beginners, azure, disk, tutorial
Published: 2024-04-14 18:37:16


In Azure, Virtual Machines (VMs) utilize three types of disks. These are OS disks, Temporary disks and Data disks. Let's discuss the differences between them in detail.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6c6mx3wfb93cwrgnj1rh.jpeg)
### 1. OS Disks

This is the disk on which the operating system (OS) of the VM is domiciled. It contains the system files and other dependency files required for the OS to run.
OS disks are persistent and retain their data even when the VM is stopped. The size of the OS disk depends on the VM size and the OS disk size limit.

### 2. Temporary Disks

Temporary disks are also known as local temporary storage or ephemeral disks. They provide short-term storage for temporary data and are not persistent. 
They are created when the VM is started. They offer high-speed local storage, making them suitable for temporary caching and intermediate data processing. However, when a VM is stopped, data stored on temporary disks is lost making them unsuitable for storing critical or persistent data.

### 3. Data Disks

Data disks are additional disks attached to a VM. They used for storing user data, application files, databases and any other data that needs to persist beyond the lifetime of the VM.
Like OS disks, data disks are managed as Managed Disks, providing features such as redundancy, backups and simplified management.
They provide scalability as multiple data disks can be attached to a VM to increase storage capacity and performance.

## HOW TO CREATE A DATA DISK

1) Sign in to azure and navigate to your VM landing page

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

2) On the left pane of your VM landing page, locate settings and select 'Disks'

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

3) Under the Data Disk category, click on 'Create and attach a new disk'. Notice that a new entry is created.

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

4) Go on to give your disk a name and select a storage type. You can maintain other field as default value.

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

5) Apply changes and wait a minute for creation.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/84omeaoh4yese3f2ki0l.jpeg)

Thumbs Up! You just created a Data Disk!!

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

## INITIALIZING A DATA DISK

When you create a data disk and attach it to a VM in Azure, the disk is initially raw and needs to be initialized and formatted before it can be used to store data. Initializing and formatting the data disk prepares it for use by creating a file system and partition table on the disk.

1) In your windows VM, go to _File Explorer > This PC_ to view the available disk on the VM. Notice that although, you have added a data disc to your VM in azure, it is not visible yet.

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

2) Right click on the windows icon and select 'Disk Management'

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4nvlup2pycro1tujygb1.jpeg)

3) Click 'ok' on the pop up to initialize disk

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

4) Scroll down and locate the newly created disk. Right click and select 'New Simple Volume...'

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

5) Click on 'Next'.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7qsmqqtckm7vep25vbra.jpeg)

6) Assign a letter to to your drive and click on 'Next'. This takes you to the Format page

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

7) Give your drive a name, maintain the default format settings and click on 'Next'

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

8) Click on 'Finish' to complete the process

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

9) Return to _File Explorer > This PC_ to see your newly added disk.

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

Creating and initializing a data disk on Azure is a straightforward process that allows you to expand storage capacity and meet the data storage needs of your virtual machines. By following the steps outlined in this guide, you can attach a data disk to your Azure VM and initialize it for use in just a few simple steps.

Thank you for reading this guide on creating and initializing a data disk on Azure. I hope you found it helpful in your journey with Azure virtual machines and storage.

Temiloluwa Adediji