Friday, December 26, 2014

Extending CentOS disk space (adding more lvm)

How to extend filesystem capacity in hadoop data node?

First, attach your new hard drive to your PC (or add virtual hard drive if you are running on VirtualBox)

Mount gParted ISO on your CentOS node.
Boot with gParted.

Create partition table for new hard drive:
Device > Create Partition Table>  GPT is recommended

Create new partition: "lvm2 pv" is recommended

Boot CentOs
Stop hadoop services on node.

fdisk -l

vgextend vg_hadoop2 /dev/sdb1


lvextend -L+8.48G /dev/vg_hadoop2/lv_root

resize2fs -F /dev/vg_hadoop2/lv_root

df -h

That's it