TechTarget.com/whatis

https://www.techtarget.com/whatis/definition/FDISK

FDISK

By Rahul Awati

What is FDISK?

FDISK is a disk utility included in all versions of MS-DOS, Windows and Linux for formatting or partitioning a hard disk drive, or to delete different portions of it. FDISK is an external utility. It is most commonly used to prepare and partition a hard drive.

Most modern personal computers include drives that are already partitioned and loaded with the operating system (OS) and other software. However, FDISK can be used to create more partitions when you want to change something. It is also used to set up a computer as a dual boot system, with one OS (Windows for example) in one partition and different OS (Linux for example ) in another.

Disk partitioning is also commonly used on local area network (LAN) servers, where different sets of users share different files and applications. The maximum partition size in the first version of DOS to use FDISK was a miniscule 16 MB.

FDISK command in DOS and Linux

Various FDISK commands are used in MS-DOS and Windows computers to create, delete, resize, change and move partitions on the hard drive. For example, FDISK [/STATUS] /X configures a hard disk for use with MS-DOS. Other MS-DOS FDISK commands include the following:

In Linux, the FDISK utility facilitates the creation of up to four primary partitions. The partition naming scheme follows the /dev/xxyN form:

Some of its common commands include the following:

FDISK to manipulate partition tables in Linux

On Linux computers, FDISK provides an interactive interface to manipulate partition tables on a hard disk. The syntax is as follows:

# fdisk [device_name] 
Command (m for help):

The following chart lists the most common FDISK commands to manipulate partition tables:

Command Purpose
fdisk -d Delete a partition
fdisk -m Print the available (FDISK) commands
fdisk -n Add a new partition
fdisk -p Print the partition table
fdisk -w Write the table to the hard drive

Partition tables and script files

The FDISK script file is an external file to quickly create (or delete) partitions on a hard disk. The file is generated using the Edit fdisk.scr command. It is then executed using the fdisk < fdisk.scr command. The script is applied to in-memory partition tables and is compatible with numerous libfdisk applications, including cfdisk(8) and sfdisk(8). It is possible to write the current in-memory disk layout to the script file.

Information about the division of a hard disk into logical partitions is recorded in a partition table. This table usually resides in sector 0 of the disk. After the DISK script is applied to the partition table, the table can be modified before it is written to the device. FDISK understands many types of partition tables, including the following:

Advantages and limitations of FDISK

FDISK is a powerful utility when there is a need to divide hard drive space into multiple logical drives (partitions). The utility helps to protect data by hiding partitions from other users. It can be used as a boot manager to use more than one OS in the computer.

Repartitioning a hard disk drive using FDISK requires a cautionary approach, especially if the drive contains important data. This is because repartitioning wipes out all data. That's why it's crucial to first back up everything to another storage medium before running FDISK.

Another limitation of FDISK is that you can't move applications from one partition to another without uninstalling and reinstalling the software. It's also not possible to delete or create new partitions without going through the entire FDISK and formatting process again. One way to get around this limitation is to use special partitioning software instead of FDISK. These applications allow you to do the following:

Partitioning software can also be used as a boot manager to install and use more than one OS easily. The software also eliminates the need for a BIOS upgrade in older computers.

See how to use Diskpart to create, delete, clean or extend disk partitions.

04 May 2023

All Rights Reserved, Copyright 1999 - 2025, TechTarget | Read our Privacy Statement