Mount a Data Disk to your VM
Tags: webdev, azure, aws, hagital
Published: 2023-08-30 12:20:35

**WHY MOUNT A DISK ON AZURE WINDOWS VIRTUAL MACHINE?**

Mounting a disk on an Azure Windows virtual machine serves several purposes:

1. Increased Storage
2. Separation of Data
3. Performance Improvement
4. Data Redundancy
5. Backup and Restore
6. Scaling and Load Balancing
7. Application Specific Needs
8. Compliance and Governance

Overall, mounting a disk on an Azure Windows virtual machine provides flexibility to manage storage, scalability, performance and customization options for managing your data and applications effectively according to your specific needs, whether it's for personal projects, business applications, or other use cases.

A more detailed practical approach on how to mount a disk on an Azure Windows 11 Virtual machine is well explained below as we cover these key vital steps.

PREREQUISITE

1). Get a PC with online access.

2). Microsoft Azure account - If you don't have an Azure paid subscription, create a Free Account before you begin.

3). Spin up a virtual machine. you can follow my [write up on how to create a virtual machine] (https://dev.to/samuel_olo75614/steps-to-creating-azure-virtual-machines-18am) to do this, if you have no idea.

Now when you create a virtual machine on the Azure portal, it comes with the OS disk as shown below. It is necessary to add a data disk to the VM to have space to work with.

To check the disk attached to the VM, go to the disk tab in the VM and you will observe that only the OS disk is attached by default here is 127GiB.

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

To create a Data Disk, click on "Create and attach a new disk."
Input the specification you want for the disk and click on save.

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

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

The next step is to add the specified disk to the virtual machine and enable it for use.

Remote desktop (RDP) into the machine and check the disk-enabled in the virtual machine. You will observe that the 128GiB disk created in the Azure portal is not present in the virtual machine.

To RDP, click on connect from the overview page, then Native RDP into your VM.

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

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

Download RDP file.

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

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

Now go to your download folder, right click on the file and connect.

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

Connect.

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

Enter username and password that you used when creating your VM.

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

Click yes.

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

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

Click next follow through like you do to your new windows till you get to your VM desktop page.

You are in.

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

Now Check you VM disk space. You will discover that the 128GiB you mounted isn't there yet. 

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

Now we take up the following steps to mount it:

In the search tab of your Virtual machine desktop page search "Create and format hard disk partition" then click.

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

Navigate to the new mounted disk, to initialize the disk before the logical disk manager can access it. “Disk 2”.

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

Select the new disk 2 as unallocated/unhealthy and needs to be treated/formatted before it can be usage/accessed.

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

Select Disk 2, Right click and select New simple volume.

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

Welcome to the new simple volume wizard. Select Next.

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

Specify the volume size and Next.

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

Assign Drive letter or path. Select F or any letter you desire and Next.

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

Format partition. Select NTFS for a file system type and Next.

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

Click finish.

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

Newly mounted DISK [Disk 2on drive F] have been formatted successfully and it's healthy for usage.

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

As confirmation checks. Navigate to the launched Azure Windows 11 Virtual Machine and check for the Disk.

The F drive for the data disk is now ready to be used on the virtual machine.

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

SUMMARY
We have been able to do the following.
1). RDP into the Virtual Machine.
2). Add a Data Disk.
3). Initialize the Disk and make it useable.

Thank you for reading my article till the end. I hope you learned something special today. If you enjoyed this article then please share to your friends and if you have suggestions or thoughts to share with me then please write in the comment box.