How to Add a New Disk to LVM on CentOS (parted, pvcreate, vgcreate, lvcreate)

You can create an LVM physical volume directly on a raw block device, but I avoid it. It can cause confusion later about what the disk is used for, and it can break some of LVM’s auto-discovery if its configuration files are missing. Instead, I put a single LVM partition on each disk first.

1. Partition the Disk with parted

This creates a GPT label with one partition spanning the whole drive and sets the LVM flag. The 1M start offset ensures proper alignment. mkpart requires a filesystem type, but it doesn’t actually create a filesystem (a long-standing parted quirk).

parted /dev/sdb
mklabel GPT
mkpart primary ext2 1M 100%
set 1 lvm on
quit

2. Create the Physical Volume, Volume Group, and Logical Volume

pvcreate /dev/sdb1
pvdisplay
vgcreate vg_name /dev/sdb1 /dev/sdc1 /dev/sdd1
vgdisplay
lvcreate --extents 100%FREE -n lv_name vg_name
lvdisplay

The vgcreate example combines three prepared disks (sdb1, sdc1, sdd1) into one volume group. Replace vg_name and lv_name with your own names.

3. Create the Filesystem and Check It

mkfs.xfs -f /dev/mapper/vg_name-lv_name
df -ah

To grow an existing volume instead, see how to extend an LVM logical volume on CentOS.