Creating And Managing Disks, Partitions, and Volumes in Linux

How To Create A New Partition On a Disk

Do you need to allocate disk space on your hard drive for specific tasks and functions? In this step by step tutorial we will walk through how you can separate the disk space on your hard drives to make more efficient use.

There are a few different tools you can use to do this but we will use fdisk. This tutorial will assume you are using an MBR partitioning scheme.

First, let’s run the lsblk command to view your active disks and partitions.
lsblk.png
As you can see here, on my system I have two disks and the second disk (/dev/vdb) has no partitions yet.

Our first command is fdisk /dev/vdb (Note: your device name might be different, for example if you have a physical disk the device name may be something like /dev/sdb.)
Untitled
Inside fdisk we can print our current partitions by typing p
lsblk
Now hit n to create a new partition
Press enter (unless you want to make it an extended partition, then press e)
lsblk

Select the partition number and set the size of the partition

Now if you need to set the type of the partition press t the enter the type you want (press L to view the list of types)

Press W to write (save & create) the partition

Now run the partprobe to activate the changes.

We can verify our new partition by using lsblk

fdisk -l will also confirm our new partition

Leave a Reply

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

WordPress.com Logo

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: