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!

  • Learn the CSF command line options You have CSF installed and use the GUI to do most things.  (If you don’t have it installed yet, you can read our article on how to install csf).  BUT – knowing the csf (ConfigServer […]
  • Can’t afford a full time Linux admin?Can’t afford a full time Linux admin? If you’re just starting out, it’s tough being able to afford full time Linux support.  Why not employ Hosting Support Services instead?  We’re Red Hat certified, fluent with Red […]
  • Install XenServer via usb flash driveInstall XenServer via usb flash drive USB Flash drives are getting cheaper and cheaper lately. I just picked up few at staples – 16GB flash drives for just under $8. I like to use them to install Linux – I always seem to […]
  • Change main hostname and IP of WHM/cPanel machineChange main hostname and IP of WHM/cPanel machine One thing you’ll probably run into sometime is changing the hostname and IP address of a cPanel machine.. whether you’re cloning it for a quick start or if you’ve taken it over.. moving it […]
  • LFD: Excessive resource usage If you run the CSF/LFD firewall on your server then you’ve no doubt seen the emails complaining about high resource usage for various accounts. This small tutorial will show you how to […]

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

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=""> 

*