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