CentOS 7: Large (over 2TB) Partition then LVM it


I always forget how to do this, I usually spend more time looking for the guide I used last time than the just a basic guide!!

Use parted to create the partition

parted /dev/sda
mklabel gpt
unit TB
mkpart primary 0 100%

Create Physical LVM Volume

# pvcreate /dev/sda1
Physical volume "/dev/sda1" successfully created
# pvdisplay

Create Volume Group

# vgcreate largevolume /dev/sda1
Volume group "largevolume" successfully created
# vgdisplay

Create Volume(s)
# lvcreate --name volume1 --size 7500G largevolume
Logical volume "volume1" created.
# lvdisplay

use 100%

lvextend -l +100%FREE largevolume/volume1

Format Volume(s)

# mkfs.xfs /dev/largevolume/largevolume