Partitioning a new disk using fdisk

I’ve just added a new disk to my Linux Virtual Machine hosted on VMware and now I want to partition it. I’ve received 20 Gb of disk space and I’ll create two 10 Gb partitions on the drive. To achieve these results I’ll use the fdisk command.
You will need to identify the newly added disk, if you have problems seeing it than maybe you need to force a device discovery operation described here.
Once you’ve identified the new disk run the following command:
fdisk /dev/sdb
Now press “p” to view the disk partition table:
Fdisk to view the disk partition table
To create a new partition press “n” and select “p” for the primary partition. Once you’ve selected the first primary partition (1), the wizard will prompt you for the first and last cylinder of the new partition. You can use the default start cylinder and the +10G for the last one. Now follow the same procedure to create a second partition, but make sure to select the second primary partition (2). We know that the disk has 20Gb so you can directly use the default first and last cylinders:
fdisk command in Linux
Now verify the partition table by pressing “p“. You should be able to see the two partitions created on the disk. In the end make sure to press “w” to write changes made on the disk:
Creating a new partition on a Linux machine

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s