Using fdisk
The fdisk
program is used to manipulate the disk partition table. You can create, modify, and remove partitions with this utility.
Getting ready
You may follow along with these commands as long as you do not use the write table to disk action. However, just to be safe you may want to use a USB stick, or some other drive or system you don’t care about.
The syntax for the interactive version of fdisk
is fdisk <device-name>
. I will be using a 4GB USB stick, /dev/sdb
for this example. Remember that fdisk
works with the entire device, so you do not use a partition number when starting the command. We will perform these actions as root.
The following is a screenshot showing fdisk
on Fedora 18:
![](https://static.packt-cdn.com/products/9781782163008/graphics/3008OS_07_02.jpg)
How to do it...
Carry out the following steps for running fdisk
:
Start the command by running
fdisk
on the device:fdisk /dev/sdb
To display the Help menu:
enter an m
. It brings up the list of actions that can be performed on this device.To display the partition table:
enter a p
. A list of the...