본문 바로가기

UNL

Add a virtual disk to the UNetlab VM

1. Add a big virtual disk to the UNetLab VM, I suggest at least 40GB. 

2. Power on the VM:

fdisk -l | grep "contain a valid partition table"


3. Disk /dev/sdb doesn’t contain a valid partition table. The new added disk is /dev/sdb. Let’s configure it for LVM and expand the volume group:

4. Change partition type to 8e

echo -e "n\np\n1\n\n\n\t\n8e\nw\n" | fdisk /dev/sdb > /dev/null


5. Create physical volume

pvcreate /dev/sdb1


6. Extend the volume group rootvg

vgextend rootvg /dev/sdb1


7. If you want 10G only

lvextend -L +10G /dev/rootvg/rootvol 


If you want all free space

lvextend -l 100%FREE /dev/rootvg/rootvol


8. The lv have done resize

resize2fs /dev/rootvg/rootvol