From LedHed's Wiki
Jump to: navigation, search
(Created page with "== Overview == Down and dirty on how to add storage to an existing LVM and grow the filesystem. == Steps == Add physical storage to the server, this can be physical or virt...")
 
(No difference)

Latest revision as of 22:35, 8 September 2016

Overview

Down and dirty on how to add storage to an existing LVM and grow the filesystem.


Steps

Add physical storage to the server, this can be physical or virtual.

Prepare the new storage with fdisk

Find the new storage

fdisk -l

Lets assume its /dev/sdb

Now lets create a new partition

fdisk /dev/sdb
n   <-- New Partition
p   <-- Primary
1   <-- First Partition
t   <-- Change Volume Type
8e  <-- Set type to Linux LVM
w   <-- Write changes to partition table

This creates /dev/sdb1

Add new partition to Volume Group

pvcreate /dev/sdb1

Get LVM Info

lvdisplay

Extent the Volume Group

vgextend VG_NAME /dev/sdb1

VG_NAME can be obtained from lvdisplay

Extend the Logical Volume

lvextend -l +100%FREE LV_PATH

LV_PATH can be obtained from lvdisplay

Grow the filesystem

resize2fs LV_PATH


Wait for resize2fs to complete and you're done.


Reference

https://access.redhat.com/solutions/24770

http://www.tecmint.com/extend-and-reduce-lvms-in-linux/

https://www.centos.org/docs/5/html/Cluster_Logical_Volume_Manager/lv_extend.html