Imaging Virtual Appliance - Extending HD - VirtualBox

fwlogovblogo

Imaging Appliance - Resize HD

For VirtualBox

The following steps will help you resize the virtual hard drive for the FileWave Imaging Appliance running on Oracle VirtualBox.


1. Power off the virtual machine. 
2. Open a command command prompt or terminal and extend the vmdk using the following commands ( replace source.vmdk with the path to your vbox vmdk, and "NUMBER OF MEGABYTES" according to the FULL size that you want the hard drive to be ) :

"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" clonehd "source.vmdk" "cloned.vdi" --format vdi 
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd "cloned.vdi" --resize (NUMBER OF MEGABYTES)
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" clonehd "cloned.vdi" "resized.vmdk" --format vmdk

vbox1


3. Rename the original vmdk file to "vagrant-centos-6.4-x86_64-disk1.OLD" and rename resized.vmdk to the original "vagrant-centos-6.4-x86_64-disk1"

vbox4



vbox5
4. Start the virtual machine and login. 
vbox6

5. Create a new primary partition on the free space with the following command: 
cfdisk /dev/sda

vbox7

6. Highlight the "Free Space" and select "New" and hit Enter to create a new partition. 


vbox8

7. Select "Primary" and hit Enter to make the partition primary. 

vbox9

8. At the "Size" prompt hit Enter to use the maximum free space. 
vbox10

9. Highlight the newly created primary Linux partition and select "Type" and hit Enter. 

vbox11

10. Hit Enter to see all partition types and type "8E" and hit Enter. 

vbox12

11. To save these changes, select "Write", hit Enter, type "yes", and hit Enter again.

vbox13


vbox14

12. Now select "Quit" and hit Enter to exit cfdisk. 

13. Type "reboot" and hit Enter to restart the VM. 

vbox16

14. Run this command to convert the new partition to a physical volume: 
pvcreate /dev/sda3

15. Run this command to extend the physical volume: 
vgextend vg_vagrantcentos6 /dev/sda3

16. Run the following command to extend the Logical Volume: 
lvextend -L+#G /dev/mapper/vg_vagrantcentos6-lv_root 
Where # is the number of Free space in GB available. 
17. Run the following command to expand the ext3 filesystem online, inside of the Logical Volume: 
resize2fs /dev/mapper/vg_vagrantcentos6-lv_root 
All Done!