Posted by : at

Category : software

Today we will take a new drive in Ubuntu, and format and partition it. I will be doing this under a VM, because it is easy to add or delete drives.

Software used:

1. Adding a second drive

I started by adding a second drive to my Ubuntu VM.

2. Format and partitioning

Now that we’ve added the drive, we can boot into Ubuntu.

The following command will list all available drives.

 sudo fdisk -l

If all went well you should see 2 entries:

<a href=”” data-rel=”lightbox-image-0” data-rl_title=”” data-rl_caption=”” title=””>My helpful screenshot</a>

You should now identify the new drive. In my case it is /dev/sdb

Now, to format the drive:

 sudo cfdisk /dev/sdb

To check the results of our work again type

 sudo fdisk -l

<a href=”” data-rel=”lightbox-image-1” data-rl_title=”” data-rl_caption=”” title=””>My helpful screenshot</a>

3. Creating the filesystem

We will use the ext4 filesystem (the most common Linux filesystem today; if you want to learn more go here:

On the new drive (/dev/sdb in my case) you should see a partition (/dev/sdb1 in my case). Now we only need to format it. For this you can use the mkfs utility. To see all possible formatting options type


and press tab tab.

In our case we will use:

 sudo mkfs.ext4 /dev/sdb1

<a href=”” data-rel=”lightbox-image-2” data-rl_title=”” data-rl_caption=”” title=””>My helpful screenshot</a>

And we are done 🙂



If you want the new partition to be mounted at boot time, you can follow my tutorial here.

The saddle of a bike, the top of a mountain or the cockpit of a kayak are some of the places you might find me on this weekend. This world has much to offer, and I am fond of exploring it, either by travelling or reading. I am always on the lookout for parking spaces for my beautiful van/home Rusty. This blog presents some of my projects, adventures and mishaps.

Useful Links