fdisk Information

fdisk is a Linux program that only works with MBR partitions. parted is another partitioning program that works on MBR and GPT partitions.

Type man fdisk in a command window to see all the options for fdisk.

Open a command window as an administrator in order to run fdisk.

fdisk can only be used interactively.

The following can be issued in interactive mode, after typing fdisk device in a command window, where device is the device name for a hard disk, like /dev/sdb.

Useful commands

m
Show a menu of commands.
o
Create a new, empty partition table. All previous partitions will be destroyed.
p
Print the partition table.
d
Delete a partition. You will be prompted for the partion number.
n
Creates a new partition. You will be prompted for the partition type, partition number, start sector and end sector. It is best to start partiions on a Mebibyte boundary, which is a multiple of 2048 sectors.
q
Exit without saving changes.
w
Write changes to disk and exit program.