Format VM disks

Format a disk on a VM running Windows

When you format a disk on the guest OS of a VM, select Perform a quick format.

Figure-1 Performing a quick format

 

Format a disk on a VM running Linux

Use a root user account to log in to Linux, because some commands for formating disks require root privileges.

To format a newly added disk on a VM running CentOS 7, for example:

  1. Execute the fdisk -l command to display all recognized disks and their partitions. Verify that the newly added disk is recognized by CentOS 7.

  1. Identify the name of the newly added disk, for example, /dev/sdb.

  1. Execute the fdisk /dev/sdb command to create partitions on the disk. To obtain help information, enter the m command. To create a partition, enter the n comand. Configure the parameters as instructed.

To use the whole disk as a partition, do not enter the last sector for the partition.

  1. Execute the mkfs.ext4 /dev/sdb1 command to format the partitions. In this example, the ext4 file system is used. To use another file system, replace ext4 with the corresponding command.