How to Increase Disk Space Size of container in OpenVZ

In this article I will show how you can increase diskspace size of your container in OpenVZ.

You can increase the disk size via command line using vzctl command. OpenVZ containers have two storage related limits.

  • Disk space – This is the amount of space which can be used by the container, usually measured in gigabytes.
  • Inodes – The total number of inodes and the space reserved for these inodes is set when the filesystem is first created. This loosely translates to the number of files which can be stored on the filesystem.

You can use the vzctl command to apply the new limits immediately to a running container without restarting VM/Container.

First of all check DISKSPACE and DISKINODES to assign your VM from configuration file /etc/vz/conf/103.conf, here I used 103 for VMID as a example.

Increase Disk Space Size of container in OpenVZ

Run the below command to increase the disk space size of container.

In this example I am going to increase disk space size from 30GB to 40GB.

#vzctl set 103 --diskspace 40G:41G --save

Now I am also going to increase Inodes using below command. Check your inodes usage if required increased it using belwo command.

#vzctl set 103 --diskinodes 6000000:6800300 --save

Now Follow the below command to check the disk space size of container.

#vzctl exec 103 df -h

Alternately, login to the container and performed a df -h to view the disk usage.

# vzctl enter 103
# df -h
Thank you! for visiting LookLinux.

If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website To become an author at LookLinux Submit Article. Stay connected to Facebook.

About the author


Santosh Prasad

Hi! I'm Santosh and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

Leave a Comment