ComTech: IT Support Stirling

How to format a hard drive on Ubuntu 12.04 using Fdisk

ComTech: IT Support Stirling

Today I will show you how to format a hard disk using Fdisk.  Fdisk comes already installed on most modern Linux distributions by default.

For the purpose of this tutorial I will be using Fdisk on Ubuntu 12.04 to format a 16Gb USB penstick with the ntfs file system.

First we need to see what our 16Gb USB penstick is mounted as so open up a terminal and type:

sudo fdisk -l

and type your password when prompted.  You should get a screenshot similar to the one below.

In this case my 16Gb USB penstick is mounted at /dev/sdc1.

Next type:

sudo fdisk /dev/sdc1

and you should get the command prompt shown below.

Now we need to check the existing partitions on the penstick so type:


to get the screenshot below.

Now we know what is on the drive it is time to delete it so type:


You will then be asked for the partition number (1-4).  In my case I have 4 partitions on the disk and I need to delete them all.  So I will type 1 and this will erase the 1st partition only.  I would then be left with partitions 2 – 4 and to remove these I would repeat the procedure until all the partitions have been erased.

We now need to set up the new partition so in your terminal type:


Because this is the first partition on the drive type:


You will now be asked for a partition number.  Choose 1 and then press return.  When asked to specify the First Sector choose the default by pressing Return.  Again accept the default Last Sector by pressing Return.

Now that the partition parameters have been specified we need to write them to the hard drive and we do that by typing:


All that is left to do is to make the filesystem on the hard drive and to do that we type:

sudo mkfs -t ntfs /dev/sdc1

Next time I will show you how to accomplish the same task using GParted (for those who like a GUI).

About the Author


Hi I’m Chris Wakefield the owner of ComTech IT Support. I provide Windows, Mac and Linux based IT Support to small businesses in Stirling, Alloa and Falkirk.

Follow @Comtech247 on Twitter


5 thoughts on “How to format a hard drive on Ubuntu 12.04 using Fdisk

  1. Heber I already had a disk mounted at /dev/sdc (can be seen from screenshot). You are right about the whole new partition table but I prefer to do it manually (old habit!!).

  2. Hi Chris,

    /dev/sdc1 is the first partition, not the whole disk. Shouldn’t it be “fdisk /dev/sdc” instead? This way you will probably see a valid partition table as well.
    Instead of deleting all partitions manually, you could create a whole new partition table with “o” (not zero).
    After creating the new partition it is wise to change the filesystem id. Default fdisk makes a partition with fileystem id 83 (Linux), use “t” to change this to “7” if you are going to format it as a ntfs filesystem.


Leave a comment

Your email address will not be published.


Get every new post delivered to your Inbox

Join other followers

WordPress SEO fine-tune by Meta SEO Pack from Poradnik Webmastera
WP Like Button Plugin by Free WordPress Templates