When you search questions - "Which of the following commands can be used to create partitions on either an mbr or gpt hard disk?" You will see four options - gdisk, cfsck, fdisk, parted. The correct answer is "parted." Read on to see how to use parted command and figure out the difference between the other three command lines.

1. Fdisk
2. Gdisk
3. Parted
4. cfsck

1. Fdisk

What is fdisk?

fdisk is a command-line utility for managing disk partitions in Linux. It allows you to create, delete, and resize partitions and set various partition attributes. fdisk also provides a convenient way to view information about existing partitions. Typically, fdisk is used to create or modify partitions on a new or unused disk. However, fdisk can also be used to modify existing partitions, though this should be done with caution to avoid data loss. When used without any arguments, fdisk will provide a list of all available disks and their associated partitions. fdisk can also be invoked with the -l argument to display detailed information about a specific disk or partition. For example, the command fdisk -l /dev/sda will provide detailed information about the first hard disk on the system. Use fdisk carefully, as it can damage your data if misused. Consult the fdisk documentation for more information about using this powerful tool.

How to Create Partition with fdisk Command (On Linux)?

Step 1. Enter sudo fdisk -I command to list the existing partitions on your system.

Step 2. Type sudo fdisk /dev/sda to access command mode.

fdisk create partition - 1

Step 3. Use single letter commands to add a new partition. (e.g. like n command.)

Type n first - create a new partition

Select partition number

type first sector as 3622912 and last sector as +2GB.

fdisk create partition - 2

Step 4. Continue to type the w command to write the changes on disk.

Step 5. Run sudo fdisk -l to check partition is created.

2. Gdisk

What Is gdisk?

gdisk is a free, open-source command-line utility designed for managing disk partitions. It can create, resize, delete, and format partitions and convert between the various partitioning schemes. gdisk also supports dynamic disks and GUID partition tables (GPTs), the newer standard for disk partitioning. gdisk is similar to the fdisk utility, but gdisk offers more options and flexibility. gdisk is available for Windows, Linux, and macOS. gdisk is developed by Rod Smith.

Gdisk, aka GPT fdisk, enables to create partitions on a GPT hard drive. So gdisk can not create partition on MBR hard disk.

How to Use gdisk to Create GPT Partitions in Linux?

Note: The following steps will erase all saved data. Please make a backup if you need it.

Step 1. Enter sudo gdisk /dev/sdb.

Step 2. Type n to create a new partition.

P.S. If you want to manage partitions (not just create partitions), you can type the question mark to get a list of all commands.

Some commonly used command lines:

c - Change partition name

d - Delete partition

p - Print partition table

I - Check partition type

q - Quit utility but not saving changes

t - Change the type code of partitions

w - Write the table to disk and exit

3. Parted

parted is a disk partitioning and partition resizing program. It is used for creating, deleting, resizing, checking, and copying partitions. parted can be used to create both primary and secondary partitions. parted is also capable of resizing NTFS partitions without losing any data. parted is available for GNU/Linux, BSD, macOS, and Windows. parted is free software licensed under the GNU General Public License (GPL).

How to Create A Partition Using Parted Command?

Step 1. List the existing partitions by running the following command - sudo parted -I

parted command - 1

Step 2. Enter sudo parted /dev/sdb to open hard disk that you want to manage partitions.

parted command - 2

Step 3. Enter mklabel * to set partition table (* stands for the partition table type, such ad mklabel gpt.) Type Yes.

Step 4. Run print command to check the partition table.

Step 5. Create partition - mkpart primary ext4 1MB 1855MB. Type print to verify information.

parted command - 3

Step 6. Enter quit command to save changes.

4. cfsck

cfsck is a utility for checking the consistency of a file system in Unix. It is often used to repair file systems after an unclean shutdown, such as a power failure. cfsck scans the file system and tries to recover any lost or damaged data. It can also fix some common problems, such as incorrect file permissions. cfsck should only be used on unmounted file systems, as it may cause further damage to a mounted file system. cfsck is part of the e2fsprogs package and is included in most Linux distributions.

This command is not related to creating partitions, so you can skip this command.

More Easier Solution: Use Partition Creator Software

If you tend to create partition on the Windows computer, EaseUS Partition Master Free is your best choice instead of disk management or diskpart. All operations will complete in easy steps. Trust this hassle-free software.

Download free disk manager:

Free Download 

Windows 11/10/8/7100% Secure

Step 1. Launch EaseUS Partition Master. On the main window, right-click on the unallocated space on your hard drive or external storage device and select "Create".

Step 2. Adjust the partition size, file system (Choose the file system based on your need), label, etc. for the new partition and click "OK" to continue.

Step 3. Click on the "Execute 1 Task(s)" button and create a new partition by clicking "Apply".

Watch the following video tutorial and learn how to create a partition in NTFS, FAT, or EXT file system.

Was This Page Helpful?

Updated by Oliver

Oliver is an EaseUS professional writer who dares explore new areas. With a passion for solving tech issues with straightforward guides for common users, Oliver keeps honing his writing craft by developing in-depth solutions for disk and partition management, computer boot-up issues, file transfer, etc.

Read full bio

Written by Tracy King

Tracy became a member of the EaseUS content team in 2013. Being a technical writer for over 10 years, she is enthusiastic about sharing tips to assist readers in resolving complex issues in disk management, file transfer, PC & Mac performance optimization, etc., like an expert.

Read full bio