Have you ever wished to have an extra hard disk to save your files? Well, there is a new feature in Windows that will let you create a virtual hard disk. Don’t know about it? Don’t worry! Here I will show you how to create a virtual hard disk using Diskpart command line mode on Windows PC.
You need to know some basic commands to achieve this, and this will create a virtual hard disk of .vhd format which is about 3MB in size. Let us discuss the steps in detail.
Steps To Create A Virtual Hard Disk Using Diskpart:
Step 1: To get started, open up the command prompt window as an administrator. To do that, go to start and type cmd in the search box. When the cmd icon appears, right-click on it and select “Run As Administrator” from the context menu.
Step 2: Now the command prompt will open up in elevated mode. Click “Yes” if prompted for a User Account Control.
Step 3: To get into the disk partition mode, from the command prompt type “diskpart” and hit Enter.
Step 4: To create a virtual hard drive you need to type the command given below:
create vdisk file=F:\install.vhd maximum=15000
This command will create a new virtual hard disk of 15 GB, and the .vhd file will be stored in the F partition of my windows, and the name of the file will be install.vhd. You can replace the Drive, File Name, and the size as per your wish.
Step 5: We can also add the type of the hard disk with the above command. To add the type, append the command with “type=fixed” or “type=expandable“. But the default type here is fixed since we didn’t mention it in the command.
Step 6: On successful creation, you may find the install.vhd file with 15 GB of size on the selected drive as shown below.
Step 7: To begin using it, you have to attach the vdisk to your system. To attach the virtual disk, you need to select the created virtual disk. The following command will help you to select the virtual hard disk.
select vdisk file=F:\install.vhd
Type the command and hit enter. This command will select the install.vhd that is stored on the F drive.
Step 8: Now to attach the selected virtual disk, type “attach vdisk” and hit Enter.
Step 9: To check the details of the attached virtual disk, type “detail vdisk” and hit enter.
Step 10: To start using the disk, you need to create partitions on the disk. Before creating the partition, make sure that the disk is initialized. To initialize the disk, type “convert mbr” and hit enter. This command will convert the virtual hard disk to primary disk format with the MBR (master boot record) partition.
Step 11: And to create a partition, type “create partition primary“. If you wish to specify the size you can append the command with “size=the required size“; else the whole unallocated space will be used to create the partition.
Step 12: Now to format the partition, type “format fs=ntfs label=”install” quick” and hit enter. In this command, NTFS refers the file system, and the disk will be labeled as install with quick formatting option.
Step 13: To assign a drive letter to the new partition, type “assign letter=g“.
Note: Make sure to select an unassigned drive letter here.
Step 14: If you have enabled the auto play option, the pop-up will appear which will let you open the new virtual hard disk.
That’s it. You have successfully created a virtual hard drive on your Windows PC. You can now start using the virtual hard disk.
You can also create a Virtual Hard Disk using command prompt window. We have a separate article in which we show How To Create A Virtual Hard Drive In Windows.
If you encounter any issues while following this tutorial, do let me know using the comments section below.