Log In | Register | December 15, 2018

Share
 

Linux - March 17, 2011

Creating Linux Partitions Using fdisk

In this tutorial you will learn how to create new hard disk partitions using the fdisk utility. First thing to check is that you have available space available on your hard drive to partition. You also need to make sure that the number of partitions on the existing hard drive is not maxed. The max is 4 unless you are using extended partitions, but we’ll go over that in a different tutorial.

In my case, the hard drive that I will be partitioning is located on /dev/sda, “sd” standing for sata and “a” which stands for the first drive. If I added another sata hard drive as a slave, it would be located on /dev/sdb.

We first start by typing fdisk -l into our terminal. The -l flag lets the fdisk utility know to output the partition table.

fdiskl 300x117 Creating Linux Partitions Using fdisk

You will notice from the above screen shot that we already have 3 partitions created. So lets go ahead and create another one.

We do this by first typing fdisk /dev/sda

Running this command will then bring you to the next screen which prompts you for your command. Type m to see the list of options. See below.

fdiskm 300x250 Creating Linux Partitions Using fdisk

We choose n from the list in order to create a new partition. After typing n press enter and you will be brought to the next screen which will ask you to choose if you want to create an extended or primary partition. For this tutorial we will choose p for primary partition. Then type 4 on the next prompt since we will be creating a fourth partition. The following prompt will ask you at what cylinder you want this partition to start. Press enter to use the default.

fdiskcreatepartition 300x79 Creating Linux Partitions Using fdisk

The next prompt will ask you where the cylinder should end for your new partition. Lets create a 10GB partition by typing +10GB and then enter.

fdisklastcylinder 300x68 Creating Linux Partitions Using fdisk

You have successfully setup the partition template. You’re not done yet though. Last thing you need to do is type the command w to write your changes. If you do not write your changes, any of the things you modified will not take effect.

Post By: | FavoriteLoadingAdd to favorites

3 Comments

adventure camp
Sunday, March 27, 2011

I would love to find out more can you point me in the right direction to find more information?

Frank Perez
Monday, March 28, 2011

Using the man and info utilities within linux would be a good source.

Como hacer kegel ejercicios videos
Saturday, September 22, 2018

I do not even understand how I finished up right here, but
I thought this publish used to be good. I do not
know who you might be but definitely you’re going to a famous blogger should you aren’t already ;) Cheers!

Leave a Comment



Need Help? Ask a Question

Ask anything you want from how to questions to debug. We're here to help.

You Must Be Logged In To Post A Question.

Log In or Register