Initialize a Newly Added Disk
After you added a new blank virtual hard disk to the virtual machine configuration, it will be invisible to the operating system installed inside the virtual machine until the moment you initialize it.
Initializing the New Virtual Hard Disk in Windows
To initialize a new virtual hard disk in a Windows guest OS, you will need the Disk Management utility available. For example, in Windows 7 (or later) and Windows XP you can access this utility by doing the following:
- In Windows 7 (or later), click Start > Control Panel > System and Security > Administrative Tools > Computer Management > Storage > Disk Management .
- In Windows XP, click Start > Control Panel > Administrative Tools > Computer Management > Storage > Disk Management .
When you open the Disk Management utility, it automatically detects that a new hard disk was added to the configuration and launches the Initialize and Convert Disk wizard:
- In the introduction window, click Next .
- In the Select Disks to Initialize window, select the newly added disk and click Next .
- In the Select Disks to Convert window, select the newly added disk and click Finish .
The added disk will appear as a new disk in the Disk Management utility window, but its memory space will be unallocated. To allocate the disk memory, right-click this disk name in the Disk Management utility window and select New Simple Volume in Windows Vista or New Volume in Windows XP. The New Simple Volume Wizard / New Volume Wizard window will appear. Follow the steps of the wizard and create a new volume in the newly added disk.
After that your disk will become visible in Computer / My Computer and you will be able to use it as a data disk inside your virtual machine.
Initializing the New Virtual Hard Disk 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:
- Launch a terminal window.
-
To list the IDE disk devices present in your virtual machine configuration, enter:
fdisk /dev/hd*
-
By default, the second virtual hard disk appears as
/dev/hdc
in your Linux virtual machine. To work with this device, enter:fdisk /dev/hdc
-
To get detailed information about the disk, enter:
p
-
To create a new partition, enter:
n
-
To create the primary partition, enter:
p
-
Specify the partition number. By default, it is
1
. - Specify the first cylinder. If you want to create a single partition on this hard disk, use the default value.
- Specify the last cylinder. If you want to create a single partition on this hard disk, use the default value.
-
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
When the added virtual hard disk is formatted, you can mount it in the guest OS.
-
To create a mount point for the new virtual hard disk, enter:
mkdir /mnt/hdc1
-
To mount the new virtual hard disk to the specified mount point, enter:
mount /dev/hdc1 /mnt/hdc1
When you mounted the virtual hard disk, you can use its space in your virtual machine.