fdisk problems with partitions over 2TB

Partitioned a 4.2TB volume with fdisk, created a file system and all I got for was a lousy 2TB. WTF? fdisk man page explains:

fdisk  doesn’t  understand  GUID  Partition Table (GPT) and it is not designed for large 
partitions. In particular case use more advanced GNU parted(8).

Ok, parted it is then..

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# aptitude install parted
# parted /dev/xvde
 
(parted) mklabel gpt
(parted) mkpart primary 0 -1
(parted) print
 
Model: Xen Virtual Block Device (xvd)
Disk /dev/xvde: 4548GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
 
Number  Start   End     Size    File system  Name     Flags
1       17.4kB  4548GB  4548GB               primary  
 
# mkfs.xfs /dev/xvde1 -f
# mount /dev/xvde1 /mnt/disk2
# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/xvda1            247G   58G  177G  25% /
tmpfs                 2.0G     0  2.0G   0% /lib/init/rw
udev                   10M   28K   10M   1% /dev
tmpfs                 2.0G  4.0K  2.0G   1% /dev/shm
/dev/xvdc1            2.0T  1.1T  939G  55% /mnt/disk1
/dev/xvde1            4.2T  4.2M  4.2T   1% /mnt/disk2

Leave a comment

NOTE: Enclose quotes in <blockquote></blockquote>. Enclose code in <pre lang="LANG"></pre> (where LANG is one of these).