How to change VPS disk size manually
In VMmanager you can enlarge the VPS disk size. Currently, it is not possible to enlarge disk size on the RBD storage. To enlarge the disk size on File and NFS storages, you need to have libvirt 0.9.10 and later
Note
You cannot reduce the disk size
Changing the parameters in VMmanager
Navigate to Management→ Virtual machines → Disks→ Edit and enlarge the disk size in the Disk size field, decrease the disk priority in Boot priority (the larger value corresponds to the lower priority). Decreasing the priority is needed for booting from the rescue disk.
Connection a rescue-disk
Rescue-disk is needed for Linux and FreeBSD.
Execute the commands to download the rescue-disk:
Linux
cd /nfsshare/iso/
wget -O rescue.iso "http://sourceforge.net/projects/systemrescuecd/files/sysresccd-x86/6.1.8/systemrescuecd-amd64-6.1.8.iso/download"
FreeBSD
cd /nfsshare/iso/
wget -O rescueFree.iso "ftp://ftp2.ru.freebsd.org/pub/FreeBSD/ISO-IMAGES-amd64/9.2/FreeBSD-9.2-RELEASE-amd64-bootonly.iso"
Connect the ISO-image to the virtual machine in Management → Virtual machines → Disks → ISO.
Enlarging disk size on different systems
FreeBSD
Boot from rescueFree.iso - LiveCD FreeBSD. Then select:
Log in as root and execute the commands:
gpart recover /dev/<vtbd0>
gpart resize -i3 /dev/<vtbd0>
growfs /dev/<vtbd0p3>
<vtbd0> — the disk with the section to be enlarged.
<vtbd0p3> — the section to be enlarged.
Disable the ISO-image and restart the virtual machine.
Linux ext2/ext3/ext4
Boot from rescue.iso — LiveCD Linux. Select "SystemRescueCd: default boot options":
Log in as root and execute the command:
fdisk /dev/vda
Enter the commands one after another. the comments are given after #. The commands consist of one symbol:
d # Delete the section (the data won't be deleted)
3 # Section number
n # New section
e # (extended) <default> <default>
n # New sectopm
l # (logical)
w # Write the new section to the disk
3 — the number of the section to be enlarged.
Fdisk will select the correct first and last section, you will only double-press Enter.
w # specify the new section table on the disk
Run the disk check:
e2fsck -f /dev/vda3
vda3 — the section to be enlarged.
Enlarge the file system:
resize2fs /dev/vda3
vda3 — the section to be enlarged.
Disable the ISO-image and reboot the virtual machine.
Windows
Reboot the virtual machine. Go to Server Manager in Disk Management. Select the disk and double-click Extend Volume:
Confirm the Wizard steps to enlarge the disk space.