Wednesday, 13 March 2013

How to Increase the virtual box disk size of an existing linux virtual machine

Many people find difficulty in increasing size of existing virtual machine but trust me after reading this blog you will find it very easy. follow the steps as given below.

Initially Just make sure that your virtual machine is not running at the time you are making changes in that.

1. Right click on the virtual machine you want to increase the size and go to setting menu.

Settings Menu
2. Now go to Storage option where you can find the option to add new hard disk in the virtual machine.

Storage Option
3. Click on Add hard disk for creating the new storage disk.

Create disk option
here you can chose an preexisting disk also, I have created a new disk for extending the storage space of my virtual machine.

4. Choose the drive file type among the given options i have choosen *.vdi format for the hard drive.


Drive File Type
  4. Choose the Storage type on your physical hard drive, in most cases it is dynamically allocated.

Storage Type
5. Now choose the Size of your hard drive and you can also give a name to the hard drive.

Storage Size
6. Click on create and your hard disk will be created and you can see the one extra hard drive is created in your virtual machine.


As the Hard disk is created now the process is not completed you cant use that space directly in your machine you have to mount this drive in your desired directory.

Use following set of commands in the terminal of your linux machine to mount the created hard drive.

  • By Using fdisk command you can see all the existing partition of the disk in your system.
As you can see there is one new extended disk for which no valid partition exists so now first we need to make the partition for the new hard drive.



Now as the partition is created successfully now you need to make the file system by using mkfs command on the particular partition.


After creating the file system now you are ready to mount the disk on your desired directory .
I have mounted my drive on the data directory in the current folder you can choose according to your need.


That is all now you can see the mounted disk in your desired directory.

Thanks
Contact for any other queries. 

1 comment: