Increase the disksize

kumarullal

Renowned Member
Jun 17, 2009
184
0
81
LA, USA
Hi I have setup a centos Linux machine with all the applications setup just the way I want it. I am taking regular backups of the images on a daily basis.
My problem is that the disc size on that VM is only 40GB.
How Can I increase the disc size to 250 GB using the same VM. (Everything else remaining just the same)
The idea is avoid going through the process of recreating a new VM of 250 GM and re installing and configuring all the application as I has set previously.
Thanks in advance.
 
Hi I have setup a centos Linux machine with all the applications setup just the way I want it. I am taking regular backups of the images on a daily basis.
My problem is that the disc size on that VM is only 40GB.
How Can I increase the disc size to 250 GB using the same VM. (Everything else remaining just the same)
The idea is avoid going through the process of recreating a new VM of 250 GM and re installing and configuring all the application as I has set previously.
Thanks in advance.

if your VM is a container: just change the disk size on the Proxmox VE web interface - very easy and a good example about the benefits of using container virtualization instead of full.

if you have a KVM VM: some manual work.
you need to expand the disk as a first step and second, you need to expand the partitions inside your VM. just google for this, here is a first link.
 
Thanks for your reply.
The link that you sent me was to convert in VMDK file format. I did not quite understand. Can you explain step by step?
Thanks
 
Lets say you have a 4G image named 'test.qcow2'

First, convert it to 'raw' format:

# qemu-img convert test.qcow2 test.raw

Then create a second 'raw' image with the required size:

# qemu-img create -f raw test-new.raw 8G

The copy the data to the new image

# dd if=test.raw of=test-new.raw

And finaly convert the new image back to qcow2 (not really needed, because you can also use raw images)

# qemu-img convert test-new.raw test-new.qcow2

hope that helps.

- Dietmar
 
I followed your instructions, but here was the problem.
Step 1.
qemu-img convert test.qcow2 test.raw -ok
Converted 10 raw disk showing 10G (which is correct.)

Step 2
qemu-img create -f raw test-new.raw 8G - ok
Created another disk with 8 G

Here is the prblom
Step 3
dd if=test.raw of=test-new.raw (-copies test.raw to test-new.raw instead of adding the 2 files.)
When I run # ls -l

Instead of getting test-new.raw 18G , I get
test.raw 10 G and test-new.raw also 10 G
That means instead of adding the 2 files, it simply copies test.raw to test-new.raw, therefore the saize for both files, test.raw and test-new.raw is the same, 10G. So there is no increase in disk size.
So there is something missing.
Any ideas?
Thanks in advance.
 
Last edited:
qemu-img create -f raw test-new.raw 8G - ok
Created another disk with 8 G

The idead is that you create an empty image with the size you need (i posted just an example). So if you want 18GB, create an image with 18G in step 2:

Step2:

qemu-img create -f raw test-new.raw 18G
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!