Partitioning and formatting large hard disk drives

written by Admin


Posted on 2013-02-14


Problem

What is the best procedure for partitionig and formatting an HDD larger than 2Tb?

Solution

fdisk is not suitable for partitioning HDDs bigger than 2TeraBytes.
You must use parted - or gparted - which has EFI/GPT partition tables support for drive partitioning (a 3Tb SATA secondary disk as sdb in this example):
#parted /dev/sdb
(parted) mklabel gpt
(parted) mkpart primary 0.00TB 3.00TB
(parted) quit

Then format your new partition, and check the block size: it must be 4096 bytes, not 512.
#mkfs.ext4 /dev/sdb1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
[..]

Than create the mount-point and put the UUID of the partition in /etc/fstab:
#blkid
/dev/sda1: UUID="680de625-e15b-48a2-a3b1-8ed0e1f8bd9c" TYPE="ext4"
/dev/sdb1: UUID="7b9e6476-3b90-48f4-a15f-c33dbea0034e" TYPE="ext4"

#cat "UUID=7b9e6476-3b90-48f4-a15f-c33dbea0034e /mnt/disk ext4 discard,noatime,defaults 0 0" >> /etc/fstab

Feedback


Comments

Leave a Comment:

Search

Welcome

We need collaboration and a real boost from our community: write us an email for every trick you find!

This website is a sysadmin swiss-knife for every-day Windows, Linux and Mac administration and troubleshooting

Our database grows if YOU send us your tips and trick as soon as you find them every day!