Create a partition size larger than 2TB on Linux

[Total: 4    Average: 5/5]

fdisk tool won’t create partitions larger than 2 TB. This is fine for desktop users, but on a production server you may need a large partition.

The way to solve this issue was to use GNU parted command with GPT (partition table).

In this article, we are going to Create a partition size larger than 2TB on Linux

Create 3TB partition size on Linux

Run gparted as follows, replace sda with your real disk name:

#parted /dev/sda

Sample outputs

GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)

Now type “mklabel gpt“, as you see below:

(parted) mklabel gpt

Output should be something like this:

Warning: The existing disk label on /dev/sda will be destroyed and all data on this disk will be lost. Do you want to continue? 
Yes/No? yes
(parted)

Now, let’s set default size unit to TB, type “unit TB” and press enter:

(parted) unit TB

Type: mkpart primary 0.00TB 3.00TB to create a 3TB partition:

(parted) mkpart primary 0.00TB 3.00TB

To print the current partitions, type p :

(parted) p
Sample outputs:

Disk /dev/sda: 3.00TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number  Start   End     Size    File system  Name     Flags
 1      0.00TB  3.00TB  3.00TB  ext4         primary

Now type quit to exit the gparted console.

(parted) quit

Now format the new patition:

#mkfs.ext4 /dev/sda1

Mount the new drive:

#mkdir /newdisk
#mount /dev/sda1 /newdisk

Now add that mount point to /etc/fstab, example:

/dev/sda1 /newdisk ext4 defaults 0 1

Now type df -h to see if the drive is mounted properly.