DEV Community

Cover image for Mount a Data Disk to your VM
Kehinde Oloye
Kehinde Oloye

Posted on

Mount a Data Disk to your VM

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 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

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

Image description

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

Image description

Download RDP file.

Image description

Image description

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

Image description

Connect.

Image description

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

Image description

Click yes.

Image description

Image description

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

You are in.

Image description

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

Image description

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

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

Image description

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

Image description

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

Image description

Welcome to the new simple volume wizard. Select Next.

Image description

Specify the volume size and Next.

Image description

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

Image description

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

Image description

Click finish.

Image description

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

Image description

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

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.

Top comments (0)