User`s guide
Configuring a Virtual Machine 226
Creating a New Partition in Linux
In most Linux systems, you can use the fdisk utility to create a new partition and to do other
disk management operations.
Note: To be able to execute the commands necessary to create a new partition on Linux, you
must have the root privileges.
As a tool with a text interface, fdisk requires typing the commands on the fdisk command
line. The following fdisk commands may be helpful:
Options Description
m
Displays the available commands.
p
Displays the list of existing partitions on your hda drive. Unpartitioned space is
not listed.
n
Creates a new partition.
q
Exits fdisk without saving your changes.
l
Lists partition types.
w
Writes changes to the partition table.
To create a new partition on Linux
1 Start a terminal.
2 Start fdisk using the following command:
/sbin/fdisk /dev/hda
where /dev/hda stands for the hard drive that you want to partition.
3 In fdisk, to create a new partition, type the following command:
n
When prompted to specify the Partition type, type p to create a primary partition or e to
create an extended one. There may be up to four primary partitions. If you want to create
more than four partitions, make the last partition extended, and it will be a container for
other logical partitions.
When prompted for the Number, in most cases, type 3 because a typical Linux virtual
machine has two partitions by default.
When prompted for the Start cylinder, type a starting cylinder number or press Return to
use the first cylinder available.
When prompted for the Last cylinder, press Return to allocate all the available space or
specify the size of a new partition in cylinders if you do not want to use all the available
space.
By default, fdisk creates a partition with a System ID of 83. If you’re unsure of the
partition’s System ID, use the
l
command to check it.
4 Use the
w