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
  • local area network (LAN)

    A local area network (LAN) is a group of computers and peripheral devices that are connected together within a distinct ...

  • TCP/IP

    TCP/IP stands for Transmission Control Protocol/Internet Protocol and is a suite of communication protocols used to interconnect ...

  • firewall as a service (FWaaS)

    Firewall as a service (FWaaS), also known as a cloud firewall, is a service that provides cloud-based network traffic analysis ...

Security
  • identity management (ID management)

    Identity management (ID management) is the organizational process for ensuring individuals have the appropriate access to ...

  • fraud detection

    Fraud detection is a set of activities undertaken to prevent money or property from being obtained through false pretenses.

  • single sign-on (SSO)

    Single sign-on (SSO) is a session and user authentication service that permits a user to use one set of login credentials -- for ...

CIO
  • IT budget

    IT budget is the amount of money spent on an organization's information technology systems and services. It includes compensation...

  • project scope

    Project scope is the part of project planning that involves determining and documenting a list of specific project goals, ...

  • core competencies

    For any organization, its core competencies refer to the capabilities, knowledge, skills and resources that constitute its '...

HRSoftware
  • recruitment management system (RMS)

    A recruitment management system (RMS) is a set of tools designed to manage the employee recruiting and hiring process. It might ...

  • core HR (core human resources)

    Core HR (core human resources) is an umbrella term that refers to the basic tasks and functions of an HR department as it manages...

  • HR service delivery

    HR service delivery is a term used to explain how an organization's human resources department offers services to and interacts ...

Customer Experience
  • martech (marketing technology)

    Martech (marketing technology) refers to the integration of software tools, platforms, and applications designed to streamline ...

  • transactional marketing

    Transactional marketing is a business strategy that focuses on single, point-of-sale transactions.

  • customer profiling

    Customer profiling is the detailed and systematic process of constructing a clear portrait of a company's ideal customer by ...

Close