Extend lvm mount point in 3 minutes

Follow the steps:

1) Add your new disk (Virtual disk or physical LUN)

2) Find them:

echo “- – -” > /sys/class/scsi_host/host0/scan

3) Do a partition (type 8e=> LVM)

fdisk /dev/sdb
n
p
default =1
default
t
8e
w

4) Create Physical Volume on partition

pvcreate /dev/sdb1

5) Add the PV to the Volume Group

vgdisplay # show your volume groups, I need to add sdb1 to fbmsvn01
vgextend fbmsvn01 /dev/sdb1

6) Add the new space on the VG to the Logical Volume(I add 5GB)

lvdisplay # shows your logical volumes , I need to extend /dev/fbmsvn01/var
lvextend -L+5G /dev/fbmsvn01/var

7) Resize the filesystem on the LV

resize2fs /dev/fbmsvn01/var # resize your partition, so it gets the new inodes. if it’s your root partition a backup may give you some peace.

8) done.

Extra documentation: http://www.cyberciti.biz/tips/vmware-add-a-new-hard-disk-without-rebooting-guest.html

Leave a Reply

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