Using the fdisk utility

In Linux, whenever we're working with hard disks, the chances are we will at some point in time have to partition a hard disk. Partitioning simply means separating the hard disk. This enables us to have varying sizes of partition and gives us the ability to satisfy various software installation requirements. Furthermore, when we partition a hard disk, each partition is treated as an entirely separate hard disk by the operating system. The fdisk (fixed disk or format disk) is a command-line based utility that can be used for manipulating a hard disk. With fdisk, you can view, create, delete, and change, among other things.

To start with, let's expose the hard disk within our Ubuntu distribution:

philip@ubuntu:~$ ls ...

Get CompTIA Linux+ Certification Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.