Resize disk of VM

filip.havlicek

New Member
Nov 7, 2014
4
0
1
Hello!


I would like to ask you, how to resize VM disk size. I tried it through a web interface, but the change is not reflected, even after restarting the VM.

My settings (links to screenshots are here, because I cannot post links or images).
pastebin.com/raw.php?i=qpCHcqxQ


I have to do some additional steps? On host machine or VM?

Thanks
 
Hello!


I would like to ask you, how to resize VM disk size. I tried it through a web interface, but the change is not reflected, even after restarting the VM.

My settings (links to screenshots are here, because I cannot post links or images).
pastebin.com/raw.php?i=qpCHcqxQ


I have to do some additional steps? On host machine or VM?

Thanks
Hi,
if your guest-os don't support hotplug you must stop and start the VM (reboot is not enough).

After that, the VM see an bigger disk, but with an partition layout like before. Depends on your part-layout and storage (lvm?) who you you use the bigger disk.

udo
 
Thanks for your reply. My VM's OS is Debian. I tried Stop and Start VM and I still can not use bigger hd size. So whats steps I need to do? My settings are in first post, if you need some more information, please tell me.
 
Sorry I dont understand you, which partition layout you mean? In my first post I have images with fdisk table, vg/lv table. You can only send me a link to some tutorial which use layout like me, I'm not asking you for me to solve this problem.
 
Sorry I dont understand you, which partition layout you mean? In my first post I have images with fdisk table, vg/lv table. You can only send me a link to some tutorial which use layout like me, I'm not asking you for me to solve this problem.

Hi,
look at your pastebin links...

after stop/start the VM, you should see the old partition-layout inside the VM, but /dev/sda should be 43GB!

In your case there are different possibilities... the better way, but need mor knowledge, is swithing to lvm inside the VM.
Easier is following:

1. have an valid backup!!
2. disable swap (swapoff -a)
3. comment the swap-entry in /etc/fstab
4. start "fdisk /dev/sda"
5. remove all partitions!
6. create partition 1 again - be sure to have the same start like before (2048) and use app. 40GB as space
7. mark partition 1 as bootable (a)
8. create a second partition at the end of the disk and change the type to 82
9. write the partition table - normaly you get an warning that the kernel hold the old one in mem.
10. reboot
11. create the swapspace new "mkswap -f /dev/sda2"
12. change the swap-entry in /etc/fstab (device-path or "uuid /dev/sda2")
13. look if swap-entry is right with "swapon -a"
14. extend your filesystem on sda1 with "resize2fs /dev/sda1" if your filesystem ist ext3/4

If all work, you should change your disk-type to virtio (vda instead of sda), because it's a little bit faster.


Udo
 

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!