Virtualization

Initialize and format a virtual disk: How to add and remove a new virtual disk from a VM on VMware Workstation

VM-Disk

A virtual disk is a file (or a set of files) on the host system that appears as a physical disk drive to the guest operating system. Virtual hard disk files store information such as the operating system, program files, and data files and have a .vmdk extension. Virtual disks can be stored as files on the host computer or on a network file server. It does not matter whether the physical disk that holds the files is IDE or SCSI. A virtual IDE drive can be stored on an IDE drive or on a SCSI drive. In this article, we will show the steps to Initialize and format a virtual disk: How to add and remove a new virtual disk from a VM on VMware Workstation.

VMware Workstation Pro is the industry standard for running multiple operating systems as virtual machines (VMs) on a single Linux or Windows PC. This virtualization solution is similar to virtualBox, VMware Workstation Player, Hyper-V and Proxmox VE. You may want to see this old post: how to create and add a new virtual hard-disk to a Virtual Machine.

Reasons why you may want to add a new virtual hard drive

You are running out of hard disk space. You need an additional virtual hard disk as a dedicated virtual drive for backing up files in the virtual machine

Perhaps, you want a virtual disk which can be migrated to another virtual machine on a different location to transfer files and folder.

Add and remove a new virtual disk from a VM on VMware Workstation

Open the virtual machine settings editor as shown below. Right-click on the VM and click on settings. See how to extend a VM’s Hard Disk on VMware Workstation

Screenshot-2021-04-05-at-21.37.49

Add New Virtual Hard Disk

Click Add on the virtual machine settings window. Please see how to fix ESXI 6.7 ALARM: Seat disk exhaustion on 10.

Screenshot-2021-04-05-at-21.38.33

Here are some exciting guides: How to clone a server on VirtualBox, the virtual machine ran into a non-fatal problem as described below, we suggest that you take appropriate action to prevent the problem from recurring, how to solve VMware workstation .lck error, and the VM appears to be in use, how to create a VM (virtual machine) on VMware.

The Add Hardware Wizard guides you through the steps to create your virtual disk. Click on Next to continue

Screenshot-2021-04-05-at-21.39.11

Choose whether you want the virtual disk to be an IDE disk or a SCSI disk as shown below. I chose SCSI (recommended), then click on Next to continue

Screenshot-2021-04-05-at-21.39.53

Create a new virtual disk

On the Select a Disk window, click on “Create a new virtual disk” and click on Next to continue.

Screenshot-2021-04-05-at-21.40.15

Set the capacity for the new virtual disk.

Note: Allocating all the space at the time you create the virtual disk gives somewhat better performance, but it requires as much disk space as the size you specify for the virtual disk. You may also specify whether you want the virtual disk created as one large file or split into a set of files. You should split your virtual disk if it is stored on a file system that does not support files larger than 2GB.

I will choose the "store virtual disks as a single file" as shown below.
Screenshot-2021-04-05-at-21.41.01

Accept the default filename and location for the virtual disk file or change it, if you want to use a different name or location. To find a different folder, click Browse. If you want to specify a device node for your virtual disk, click Advanced.

On the advanced settings screen, you can also specify a disk mode. This is useful in certain special-purpose configurations in which you want to exclude disks from snapshots. 

As you can see below, I have accepted the default.
Screenshot-2021-04-05-at-21.41.38

As you can see below, the virtual disk is being created.

Screenshot-2021-04-05-at-21.41.54

As you can see on the Virtual Machine settings page, the New Hard disk appears.

Screenshot-2021-04-05-at-21.45.10

Initialize and format the new drive in Windows

To initialize and format the new drive in Windows, you will have to launch Computer Management. This can be launched via the Server Manager, Windows Search, etc. I will be showing you how to launch this via Windows Administrative Tools

"Control Panel\System and Security\Administrative Tools\Computer Management.lnk". Click on Computer Management
Screenshot-2021-04-05-at-21.58.58

Right-click the disk and select bring it Online. If you do not find the drive yet, please under “Actions" > Rescan Disks“. If you on working on a cloud platform such as AWS, you may have to rescan in order to see the attached disk.

Screenshot-2021-04-05-at-22.01.20

Initialize Disk

Right-click the disk to be initialized and then click Initialize Disk. Windows prompts you to initialize the disk before the Logical Disk Manager can access it.

Screenshot-2021-04-05-at-22.02.47

Select GPT, you may wish to select MBR. GPT is the abbreviation of GUID Partition Table, which is a standard for the layout of the partition table on a physical hard disk, using globally unique identifiers (GUID). MBR is another kind of partition table format. It is short for the master boot record. Comparatively, the MBR is older than the GPT

Screenshot-2021-04-05-at-22.03.29

Please see How to Add and Format a New Virtual Disk to an EC2 Instance, How to install Windows Server 2022 on VMware Workstation, how to Enable Hyper-V on a VMware Workstation, and How to fix “The security database on the server does not have a computer account for this workstation trust relation [Part 1].

Create a New Simple Volume

Right-click the unallocated space and click New Simple Volume.

Screenshot-2021-04-05-at-22.05.11

Click on Next to continue

Screenshot-2021-04-05-at-22.05.48

Enter the size of the partition (in MB) and click Next. I will leave it as default to use all available disk space.

Screenshot-2021-04-05-at-22.06.19

Select a drive letter and click Next.

Screenshot-2021-04-05-at-22.06.55

Select the file system type and volume label. For me as you can see below, I did not enter a Volume name. I recommend you do not do this in a live environment (Production).

Screenshot-2021-04-05-at-22.07.52

Click on Finish to complete the process.

Screenshot-2021-04-05-at-22.08.44

As you can see below, we have our newly created virtual disk available on our VM.

Screenshot-2021-04-05-at-22.11.54

Part B – Removed the attached Disk Drive

Use the virtual machine settings editor to disconnect a virtual disk from a virtual machine. Select a virtual machine and right-click on it. Select settings as shown below

You do not need to Power your VM of before dissociate a virtual disk. Please test this :)
Screenshot-2021-04-05-at-21.37.49

Please select the virtual disk you want to remove. When you are done, click on OK.

Screenshot-2021-04-05-at-22.13.33

As you can see, the virtual disk will be removed from your VM immediately.

FAQs on Initialize and format a virtual disk on VMware Workstation

How do I format a virtual disk in Linux?

You can use tools like mkfs or parted in the terminal. For example, to format a disk to ext4, you might use mkfs.ext4 /dev/sdX1 (replace /dev/sdX1 with your actual disk identifier).

Are there risks in initializing or formatting a virtual disk?

Initializing or formatting a virtual disk erases all data on it. Ensure you are working with the correct disk, back up important data, and proceed with caution.

What file system should I choose when formatting a virtual disk?

The choice of the file system depends on your requirements. For Windows, NTFS is commonly used, while Linux may use ext4. FAT32 is more universal for compatibility but has limitations on file size.

Can I format a virtual disk from the command line?

Yes, you can use command-line tools. In Windows, the diskpart command can be used for this purpose.

I hope you found this blog post helpful on the steps to Initialize and format a virtual disk: How to add and remove a new virtual disk from a VM on VMware Workstation. If you have any questions, please let me know in the comment session.

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x