How to add space to a ext3 lvm online

Logical Volumes are great you can add disk space without unmounting disk.  With ext3 you can expand that space without a downtime.  It’s easy.

 

Assume you add a new disk called /dev/sdg and you partition it into a single partition to keep the blocked lined up with your storage system. Now you have /dev/sdg1

Make it into pv’s

 

pvcreate /dev/sdg1

 

Now add it to your current logical volume called storage with the following command

 

vgextend storage /dev/sdg1

 

Use vgdisplay to show how many pv’s are used and now many are free… using the next command we need to add them together..

 

lvextend -l number_of_pvs /dev/storage/storage

 

Now you need to expand the ext3 which can take some time:

 

resize2fs /dev/storage/storage

 

And wait …

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.