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


Leave a Comment:


Search

Categories

android x 1
apache x 1
apple x 4
backup x 2
cygwin x 1
dns x 1
dos x 1
drupal x 3
ftp x 1
iis x 1
imap x 1
linux x 22
mail x 4
mysql x 3
oracle x 1
pop3 x 1
print x 2
proxy x 1
rsync x 1
shell x 8
smtp x 1
squid x 1
ssh x 1
storage x 2
web x 3
windows x 15

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!