Linux - The fdisk command

Ask a question

Linux - The fdisk command

The Linux fdisk utility allows you to create partitions on your hard drive in the same way as its MS-DOS counterpart. It should be noted that the Linux version of fdisk is more complicated to use than MS-DOS version, so it is advisable to create partitions from MS-DOS (create a system disk in order to format the DOS partition and install DOS kernel after installing Linux)
  • Partitioning with fdisk will lead to the lost of all data on the concerned disk.
  • To invoke the utility use the fdisk command. When no argument is added, fdisk will select the first drive it finds.
  • Pass the device name as an argument to select the drive/partition of your choice (e.g the second hard drive will be selected):
    • fdisk /dev/hdb

The naming conventtion for hard disks

Under Linux, the name of the storage devices varies depending on whether they are SCSI or IDE drives.
  • For IDE drives, the first is named hda, the second one is named hdb .
  • For SCSI disks, the first will be called sda, the second one is named sdb .

fdisk Commands

ddelete partition
llist the partition types
mPrint current menu
ncreating a new partition
pDisplay partitions
qexit fdisk without saving settings
tchange the partition type
vCheck the partition table
wSave changes and exit fdisk

Original document published on
Jean-François Pillou

Jean-François Pillou - Founder of CCM
Better known as Jeff, Jean-François Pillou is the founder of He is also CEO of CCM Benchmark and digital director at the Figaro Group.

Learn more about the CCM team