Browse Definitions :
Definition

FDISK

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.

Disk partitioning illustration.
What disk partitioning looks like.

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:

  • fdisk /mbr rewrites the master boot record.
  • fdisk 1/pri:100 creates a 100 MB partition on the hard drive.
  • fdisk 1/log:250 creates a logical drive of size 250 MB.
  • fdisk /status shows the current status of the hard drive (or drives).
  • fdisk /q prevents the FDISK utility from automatically booting the system after exiting.
  • fdisk < fdisk.scr executes an external script file (which is created using the DOS edit command) to quickly create (or delete) hard disk partitions.

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

  • /dev is the directory where all files live.
  • xx indicates the device type (which contains the partition).
  • y indicates which device the partition is on.
  • N is the partition number.

Some of its common commands include the following:

  • $ sudo fdisk -l to view details of available disk partitions.
  • $ sudo fdisk -l /dev/sda to view the partitions on a specific disk.
  • $ sudo fdisk /dev/sda to create a hard disk partition.
  • $ sudo fdisk -s /dev/sda to view the partition size.

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:

  • GPT. It uses 64-bit logical block addresses and checksums for partitions and allows an unlimited number of partitions.
  • MBR (DOS-type). It can describe an unlimited number of partitions, with primary partitions numbered from 1 to 4 and logical partitions numbered from 5.
  • IRIX (SGI-type). It can describe 16 partitions, where the ninth is labeled "volume header" and the 11th is an entire volume partition.
  • BSD (Sun-type). It can describe eight partitions, the third of which is a whole disk partition.

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:

  • Create, delete and resize partitions without losing your data.
  • Move applications from one partition to another without uninstalling and reinstalling the application.
  • Hide partitions to protect data from other users.

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.

This was last updated in May 2023

Continue Reading About FDISK

Networking
  • subnet (subnetwork)

    A subnet, or subnetwork, is a segmented piece of a larger network. More specifically, subnets are a logical partition of an IP ...

  • Transmission Control Protocol (TCP)

    Transmission Control Protocol (TCP) is a standard protocol on the internet that ensures the reliable transmission of data between...

  • secure access service edge (SASE)

    Secure access service edge (SASE), pronounced sassy, is a cloud architecture model that bundles together network and cloud-native...

Security
  • cyber attack

    A cyber attack is any malicious attempt to gain unauthorized access to a computer, computing system or computer network with the ...

  • digital signature

    A digital signature is a mathematical technique used to validate the authenticity and integrity of a digital document, message or...

  • What is security information and event management (SIEM)?

    Security information and event management (SIEM) is an approach to security management that combines security information ...

CIO
  • product development (new product development)

    Product development -- also called new product management -- is a series of steps that includes the conceptualization, design, ...

  • innovation culture

    Innovation culture is the work environment that leaders cultivate to nurture unorthodox thinking and its application.

  • technology addiction

    Technology addiction is an impulse control disorder that involves the obsessive use of mobile devices, the internet or video ...

HRSoftware
  • organizational network analysis (ONA)

    Organizational network analysis (ONA) is a quantitative method for modeling and analyzing how communications, information, ...

  • HireVue

    HireVue is an enterprise video interviewing technology provider of a platform that lets recruiters and hiring managers screen ...

  • Human Resource Certification Institute (HRCI)

    Human Resource Certification Institute (HRCI) is a U.S.-based credentialing organization offering certifications to HR ...

Customer Experience
  • contact center agent (call center agent)

    A contact center agent is a person who handles incoming or outgoing customer communications for an organization.

  • contact center management

    Contact center management is the process of overseeing contact center operations with the goal of providing an outstanding ...

  • digital marketing

    Digital marketing is the promotion and marketing of goods and services to consumers through digital channels and electronic ...

Close