CentOS / RHEL : How to create new LVM based swap partition

Let see an example of increasing existing swap space by adding new LVM based swap. The example here uses the disk /dev/sdc for creating a new volume group and swap volume under it. Since we are going to use this disk, any data, if exists on it, will be lost.

As root user perform the following tasks:
1. Add the disk /dev/sdc as the physical volume.

# pvcreate /dev/sdc

2. Create volume group named ‘swap_vg’ ( You may add the disk in an existing volume group if you have one. In the example here, I am creating a new volume group.)