Partitioning in Linux [cfdisk]

Hi Fellows! My OS[Linux Mint] is near to crash because of my endless, inappropriate experiments. But what to do, My endless curiosity doesn’t leave My OS  alone.

            In this post I m going to demonstrate how to partition a Hard Disk/Flash Drive without any extra tools. All you have to do is to enter some commands in CLI. I’m using My 1GB small old pen drive. And please make sure that you have chose the correct device. Else I don’t have to say what would happen!

            Open the terminal/konsole, then identify your device by giving,

fdisk -l             (I have done this in an early time in detail)

            My device is /dev/sda1.

cfdisk /dev/sda1 (cfdisk is the Curses based disk partition table manipulator for Linux)

then you l end with something like this,

fdisk /dev/sda1

cfdisk /dev/sda1

 In My example I m creating 2 partitions. And one of them is a swap area. Navigate to  New using arrow keys. Press enter. you l end up with the following result,


Creating a New Primary partition


 Press Enter.  Then give the Partition size you want.

assigning the size

Assigning The Partition Size

I gave 800MB for My 1st partition. Press Enter.

add partition at beginning of free space

Add Partition at Beginning of Free Space

Select Beginning. It will create the partition at the beginning. Or if you want it at the end select End.As I done the fist partition(sda1p1), I have created another partition named sda1p2.

created two partitions

Two Partitions are Created

With the arrow keys navigate to Type. Then press Enter.

selecting a file system

Selecting a File System


 Check this out. you get a big list with a variety of file systems. I want mine as Linux Extended. I went step forward by pressing a key. Then gave the corresponding number for Linux Extended.

entering the filr system type

Entering The Filr System Type


 Following the same steps, I set the other partition’s file system as swap. Finally select Write and press Enter.

write partition table to disk
Write Partition Table to Disk

Its good to go! We are done with partitioning. 





3 Responses to “Partitioning in Linux [cfdisk]”

  1. chanux Says:

    Nice step by step tutorial. May I add something

    command to list mounted file systems

    command to find recently plugged devices
    $dmesg | tail

    list plugged usb devices

    hope this helps. And of course you should unmount device before you format/partition.

  2. Debian Linux Web Install II: Partioning and Formatting the Hard Drive. - Says:

    […] gently; my personal favorite, Slackware, does not. It asks you to use either Linux fdisk or Linux cfdisk to do it manually. Being used to DOS fdisk, that bothered me […]

  3. Learning the Basic Linux Commands and Partitioning a USB « 8layertech Says:

    […] partitioning ended. On to the second day, I tried searching once more for cfdisk command and found this site (You can also check it out to learn how to partition your disk drive).  I tried partitioning again […]

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

%d bloggers like this: