Easily increase storage size with LVM

Rob —  June 5, 2013 — 3 Comments

Your server needs more space eh? Throw another physical drive in there and let’s use that to increase the logical volume that needs more space! In this example, we are going to use a Citrix XenServer VPS running CentOS. We are going to increase the logical volume from 250gb to 300gb.

First, add the new storage to the machine. We used XenCenter to add a ‘virtual disk’ to the VPS. This step for you might be adding a new physical drive to the hardware machine. Either way, this step is the one where we put the new/blank storage somewhere so our Linux machine can see it…

Next, let’s see if the system can see the new storage:

Note: you’ll also see information about your current drives..

This tells us that Linux sees the storage but there is no partition table on it yet. let’s create a partition on the drive using fdisk, parted, cfdisk, etc.. and toggle it to type ‘8e’ (Linux LVM)

Now it should show up a little better in the fdisk -l command.

Next, create the physical volume on the new partition on the new drive:

Now, find out the volume group and logical volume names on your system. Make note of these..

We’ll assume that the information is:
Volume Group: test_vg
Logical Volume: test_lv

Now, use vgextend to add your new drive to the existing volume group:

You can see, by viewing ‘vgdisplay’ again, it will show you the added space:

Now, pull it across into the logical volume:

You’re almost home free! Now, vgdisplay shows the correct info and so does lvdisplay – but a simple df -h still shows the filesystem size has not changed. Let’s tell the filesystem to stretch out across the full logical volume:

And to see how it worked out:

It worked!

Related posts from Linux Brigade!

  • cPanel server – can’t send mail! If you are trying to send mail via webmail and it is not working out, you may have the answer right under your nose.  If you have CSF installed, it is likely blocking port 25.

    You may […]

  • CentOS 7 / RHEL 7 – Open portsCentOS 7 / RHEL 7 – Open ports One of the most common things I do on Linux machines is open ports to test software in a development environment.  In the past, that meant trying to remember (and Googling) cryptic […]
  • Understanding cron job timesUnderstanding cron job times Often, you’ll want to use cron to schedule daily, weekly, hourly (etc…) tasks on your linux system(s). cPanel has a little GUI for it, but since I don’t trust GUIs very often, I like […]
  • Install Ubuntu / Xubuntu from USBInstall Ubuntu / Xubuntu from USB Installing via USB is much better/easier than via cd/dvd simply because it’s not going to get scratched up, you can easily carry it around with you to loan to friends, etc..

    Let’s set […]

  • Untangle your networkUntangle your network Whether you’re the admin of your office network or your home network (or both), it’s always a good idea to have security and order in place. Untangle is software that you can install as […]

3 responses to Easily increase storage size with LVM

  1. Excellent article. Honestly, I didn’t know you could do this (to this extent) with LVM.

  2. Very helpful guide, thank you. I was just thinking about adding more space so I read this article at the perfect time.

Trackbacks and Pingbacks:

  1. Easily increase storage size with LVM | Webmaster Brigade - June 5, 2013

    […] Your server needs more space eh? Throw another physical drive in there and let’s use that to increase the logical volume that needs more space! In this example, we are going to use a Citrix XenServer VPS running CentOS. We are going to increase the logical volume from 250gb to 300gb. This is a great article by our sister site ‘Linux Brigade’ which is a Linux Blog. You can find the post here: http://www.linuxbrigade.com/easily-increase-storage-size-with-lvm/ […]

Leave a Reply to Chad McCullough Cancel reply

Text formatting is available via select HTML.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url=""> 

*