I’ve created a HortonWorks HDP Sandbox on Azure for testing.
The initial OS disk size is about 48GB, which is too small to hold my files in HDFS for testing.
I find out a way to extend the OS disk to simply increase the HDFS capacity.
Basically it’s create a new LVM partition then add this partition to existing LVM OS logic volume group.
- Attache a disk in Azure portal to the HDP virtual machine.
- Create new partition (/dev/sdc1) on that disk (/dev/sdc) and assign partition id ‘8e’, which is LVM partition.
- Use ‘vgdisplay’ to find volume group name, it’s ;vg_sandbox’ on HortonWorks sandbox.
- Use ‘vgextend’ to extend ‘vg_sandbox’ with the newly created ‘/dev/sda3’.
- Use ‘lvdisplay’ to find logical volume name, it’s “lv_root”, path is ‘/dev/vg_sandbox/lv_root’.
- Use ‘lvextend –L +xxxG /dev/vg_sandbox/lv_root’ to extend size of the logical volume. xxxG is the free space in volumn group ‘vg_sandbox’, which can be find using vgdisplay.
- Use ‘resize2fs /dev/vg_sandbox/lv_root’ to resize the partition online, this step takes some time.