Create a LVM partition in Linux

This guide will outline all steps required to create a new LVM partition.

  1. Add a new drive on Linux machine ( drive could be physical or virtual)
  2. Run the following cmd to check if new drive is picked up by OS
    1. $ dmesg | grep blocks
    2. check for the size of disk and make sure it match the drive that was added
  3. Pick the device name from previous cmd – device name could be sdb or sdc etc depending on the number of drives you have in your system
  4. If sdc is the new drive that you have added follow the steps as below ( under root or sudo)
    1. fdisk /dev/sdc
      1. n (all default), t (choose 8e), p, w, q
    2. pvcreate /dev/sdc1
    3. vgcreate vg_tux-network /dev/sdc1
    4. lvcreate –name lv_data -l 100%FREE vg_tux-network
    5. mkfs.xfs /dev/vg_tux-network/lv_data

Good Luck!. As always make sure you have backups while modifying any partition data, and I take no responsibility in data loss.

0 Comments on Create a LVM partition in Linux

Leave a Comment

Your email address will not be published. Required fields are marked *

You Might Be Interested In