Thursday, October 3, 2019

How to format large (2TB+) drive on RHEL 6 and 7 Linux

This will work for USB drives, and internal drives too.

From https://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html

umount /dev/sdb
parted /dev/sdb # make sure it's sdb
mklabel gpt
unit TB
mkpart primary 0.00TB 4.00TB # Change 4 to whatever your drive size is
print
quit
mkfs.ext4 /dev/sdb1
mkdir /mnt/sdb1
mount /dev/sdb1 /mnt/sdb1
df -k # Verify the drive size is correct

(Edit: Previously I had a typo in the title and said 2GB+ instead of 2TB+)

2 comments:

The Rubber Pigeon said...

I'm thinking you mean 2TB and not 2GB in the title.:D

Matthew said...

Haha, yeah thanks. I'll correct it.