Initializing a Newly Added Hard Drive

After you add a new blank virtual hard drive to the virtual machine configuration, it remains invisible to the operating system unless you initialize it.

Initializing a New Virtual Hard Drive in Windows

To initialize a new hard drive in Windows 11, you will need to do the following:

  1. Open the start menu by clicking on the Windows logo and choose Settings.

  2. On the left, choose System and scroll to the Storage menu item.

  3. Under Storage management, expand the Advanced storage settings sub-menu and select Disks & volumes.

  4. Find the new virtual hard drive from the list and click Initialize.

In older versions of Windows, you can initialize a new drive by locating the Disk Management utility in the Control Panel, launching the Initialize and Convert Disk wizard, and creating a new volume on that disk afterwards.

Initializing a New Virtual Hard Drive in Linux

Initializing a new virtual hard disk in a Linux guest OS comprises two steps: (1) allocating the virtual hard disk space and (2) mounting this disk in the guest OS.

To allocate the space, you need to create a new partition on this virtual hard disk using the fdisk utility:

Note: To use the fdisk utility, you need the root privileges.

  1. Launch a terminal window.

  2. To list the IDE devices present in your virtual machine configuration, enter:

    fdisk /dev/hd*

  3. By default, the second virtual hard drive appears as /dev/hdc in your Linux virtual machine. To work with this device, enter:

    fdisk /dev/hdc

  4. To get detailed information about the drive, enter:

    p

  5. To create a new partition, enter:

    n

  6. To create the primary partition, enter:

    p

  7. Specify the partition number. By default, it is 1.

  8. Specify the first cylinder. If you want to create a single partition on this hard drive, use the default value.

  9. Specify the last cylinder. If you want to create a single partition on this hard drive, use the default value.

  10. To create a partition with the specified settings, enter:

    w

When you allocated the space on the newly added virtual hard disk, you should format it by entering the following command in the terminal:

mkfs -t <FileSystem> /dev/hdc1

Note: <FileSystem> stands for the file system you want to use on this disk. It is recommended to use ext3 or ext2.

When the added virtual hard disk is formatted, you can mount it in the guest OS.

  1. To create a mount point for the new virtual hard disk, enter:

    mkdir /mnt/hdc1

  2. To mount the new virtual hard disk to the specified mount point, enter:

    mount /dev/hdc1 /mnt/hdc1

Once you have mounted the virtual hard drive, you can use its space in your virtual machine.