Saturday, 17 November 2012

HOWTO: Partition a drive over 2TB

I just got a 3TB hard drive but when I partitioned it the way I normally do with fdisk it was only recognised as 2TB.

Here's how to do it using parted (as root);

# parted /dev/sdb     # Substitute with the drive device you are trying to partition
> mklabel gpt         # A gpt partition table is needed for partitions over 2TB
> mkpart pri 1 -1     # Makes a new primary partition using the whole disk
 
Now you can format the partition the usual way. Here is an ext4 example;
 
mkfs -t ext4 /dev/sdb1

No comments: