Overview
The Variphy OVA leverages Logical Volume Management (lvm), which treats a collection of physical volumes (i.e. disk partitions) as a logical volume (i.e. the thing you mount and read/write files to/from). In order to add more storage capacity, instead of expanding an existing physical volume and then expanding the logical volume, you can create a new physical volume through VSphere and then add that physical volume to the logical volume within Ubuntu.
1. Take a snapshot of your existing environment.
2. Using vSphere edit your existing virtual machine and add/create a New Hard Disk.
When adding the new disk add only the additional space needed. For example if you currently have 100GB on your existing disk and I wish to increase to a total of 250 GB your new disk will be 150GB.
3. Add the new Hard Disk to the logical volume.
- SSH to the Virtual Machine and run the following commands.
- Become root user.
- sudo su -
- echo results to a psuedo file
- echo "- - -" > /sys/class/scsi_host/host2/scan
- Display the partitions
- fdisk -l (L not a one)
- You should expect to see the new partition.
- Take note of the new disk
- Become root user.
- Partition the New Disk. (Make sure your are running fdisk against the new disk in the previous step)
- fdisk /dev/sdb
- Command (m for help):n
- Select (default p): (
Hit enter you do not need to enter a value
) - Partition number (1-4, default 1): (
Hit enter you do not need to enter a value
) - First sector (2048-524287999, default 2048): (
Hit enter you do not need to enter a value
) - Last sector, +sectors or +size{K,M,G,T,P} (2048-524287999, default 524287999): (
Hit enter you do not need to enter a value
) - Command (m for help): t
- Hex code (type L to list all codes): 8e
- Command (m for help): w
- Check that the partition has been added to the new disk
- fdisk -l (L not a one)
- Add the New disk to the Logical Volume.
- vgdisplay (Make note of the VG Name)
- pvcreate /dev/sdb1
- vgextend system /dev/sdb1 (Replace system with the VG Name noted above)
- Add space to the current Logical Volume.
- lvdisplay | grep Path
- lvresize -l +100%free /dev/system/root
- Resize the filesystem.
- resize2fs /dev/system/root