Linux – Merge LVM Partition with unallocated Space

gpartedlinuxlvmpartitioning

I have a linux hard drive with three areas:

  • /dev/hda1 – ext3 boot partition (20 MB)
  • /dev/hda2 – lvm2 main partition (6 GB)
  • unpartitioned space – 12 GB

I would like to merge the unpartitioned space into the lvm2 partition known as /dev/hda2. I tried using GParted, but it does not support lvm2.

What commands or utilities could I use to add the unpartitioned space to hda2 without losing my existing data?

Best Answer

Put the unpartitioned space into its own partition, then use pvcreate then vgextend on it.

Related Question