Marks Blog
  • PowerDNS Admin
  • About
  • Simple Ticket System

LVM Extend HOWTO

August 30, 2010 by mark

Just a quick ‘howto extend an existing logical volume’ on a Linux box.

You will of course start by adding a new disk to the server. If this can be done online, you will need to run scsiadd -s (or rescan-scsi-bus from the scsitools package) to scan for new devices. Verify that the new disk is seen by the system and write down the device name.

Partition the new disk (/dev/sdc in this example)

fdisk /dev/sdc

> o create a new empty DOS partition table

> n add a new partition

> p make it primary

> 1 first primary partition

> default use pre-selected value

> default use pre-selected value

> t change partition type

> 8e make it a LVM partition

> w write changes to disk

Initialize the filesystem for LVM

pvcreate /dev/sdc1

Extend existing volume group (named debian in this example)

We will add the device we just prepared to our existing volume group. You can use the vgdisplay command to display the volumegroups.

vgextend debian /dev/sdc1

Extend the logical volume (/dev/debian/root in this example) with 20G

Running vgdisplay will display allocated and free space of the volumegroup. We are going to use free space to grow the logical volume. To get a list of logical volumes run lvdisplay

lvextend -L+20G /dev/debian/root

Resize the filesystem

The last thing we need is to resize the filesystem. This will work with ext3/ext4/xfs and some other filesystems. You need to check this. Some support online resize, others must be unmounted. We will resize an ext3 filesystem, which can be done online… yearh!

resize2fs /dev/debian/root

Posted in: Linux & Unix Tagged: extend, lvm, resize

Weather Station

Pages

  • About
  • PowerDNS Admin
  • Simple Ticket System

Affiliates

  • Danish Sensor Engineering
  • Mintr ApS
  • Nellemann Data

Social

  • BitBucket
  • GitHub
  • LinkedIn
  • Mastodon

Categories

  • Android
  • Automobile
  • Blog & Rantings
  • Development & Scripting
  • Grails
  • Linux & Unix
  • Mac OS X
  • Misc
  • No category
  • PowerDNS Admin
  • Puppet
  • Security Related
  • VirtualBox
  • Virtualization
  • VMware
  • Windows

Archives

  • January 2019
  • September 2017
  • January 2016
  • May 2015
  • March 2015
  • February 2015
  • December 2014
  • October 2014
  • September 2014
  • August 2014
  • June 2014
  • January 2014
  • July 2013
  • June 2013
  • February 2013
  • January 2013
  • December 2012
  • August 2012
  • May 2012
  • October 2011
  • April 2011
  • February 2011
  • January 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • March 2010
  • October 2009
  • September 2009
  • April 2009
  • January 2009
  • March 2008
  • January 2008
  • November 2007
  • January 2007
  • December 2006
  • November 2006
  • August 2006
  • June 2006
  • March 2006
  • October 2005
  • August 2005

Copyright © 2025 Marks Blog.

Mobile WordPress Theme by themehall.com