Create a Linux partition on a large drive

The usual linux tool (fdisk) used for creating partitions don’t let you create one greater than 2Tb. This is a problem with today’s large drives.

To create a partition larger than 2Tb we need to use gparted. Make sure youknow the device you want to be messing about with before you run these commands. fdisk -l  will give you a list of connected devices and their properties and should help you ID the right one.

Start gparted by running

parted /dev/sda

You’ll see:

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

Type (this step is important it is not just giving the device a label)

mklabel gpt

Then change our working units to TB

unit TB

Now adjust the following command based on how large you want your partition, you may be asked to confirm the partition filesystem (default: ext2) so just type what you want, I went for ‘ext4’:

mkpart primary 0.00TB 4.00TB

Type p  to see the new partition table. And quit  to exit gparted.

We still need to format the partition as we would have when using fdisk. So let’s run

mkfs.ext4 /dev/sda1

Note that linux reserves 5% of the drive space for ‘admin services’. This is a legacy feature and can still be useful on boot volumes etc which run your OS but for storage drives it is not necessary to reserve this space. Let’s ‘unreserve’ it with

tune2fs -m 0 /dev/sda1

You can now mount your device us usual…

mkdir /mnt/hard_drive

mount /dev/sda1 /mnt/hard_drive

and add this line to /etc/fstab if you want to mount persistently

/dev/sda1 /mnt/hard_drive ext4 defaults 0 1

To check the sizes of mounted devices you can run df -ah

Leave a Reply

(email optional)