Adding more disk space with LVM2

I've always known that virtualizing things can make management of all types of resources easier. Recently, I had the most pleasant experience adding disk space to a virtual machine. Of course, if you use LVM, this can happen just as easily with real physical disks, but for me, I was able to do this without restarting my machine.

Issue: I'm out of disk space on my root partition.
Solution: The root partition is created on a logical volume with LVM2. Just add another disk, extend the volume group, and then extend the logical volume.

  2. # Added new physical partition /dev/sda3
  3. # create a physical volume out of it
  4. > pvcreate /dev/sda3
  5. # Now, add it to the volume group that my logical volume is on
  6. > vgextend VolGroup00 /dev/sda3
  7. # Now that the volume group has more disk space, the logical volume can grow
  8. > lvextend -L+11G /dev/VolGroup00/LogVol00
  9. # Ok, last of all, I want to filesystem to recognize that more space is available
  10. > fsadm resize /dev/VolGroup00/LogVol00
  11. # sweet, I have more space now
  12. > df -h

All that was done without having to take the system off line. Linux makes life easy sometimes doesn't it!

1 Response to “Adding more disk space with LVM2”


    Dude this was exactly the answer I was looking for, Thank You