resizing the disk from the VM via parted

doktora

New Member
Jul 26, 2024
4
0
1
Hi,

I have a Debian VM. I resized the VM disk from the Proxmox UI and it shows the new size. However, when I use parted to try to resize it from the Debian installation, my partition table looks like this?

GNU Parted 3.5


Using /dev/sda


Welcome to GNU Parted! Type 'help' to view a list of commands.


(parted) print
Model: QEMU QEMU HARDDISK (scsi)
Disk /dev/sda: 64.4GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 33.3GB 33.3GB primary ext4 boot
2 33.3GB 34.4GB 1022MB extended
5 33.3GB 34.4GB 1022MB logical linux-swap(v1) swap

Can someone help me. Why is the primary over the first 32GB? Should I remove extended and upsize the primary? But then swap is in the way. Can I do this from inside the VM? Or are there any instructions on booting an existing VM with gparted - I could not find how to do this either.
 
Yes, the swap is in the way and because the drive uses MBR (instead of GPT) there can only be one primary partition and the rest (the swap in your case) is inside the extended partition. You could delete and recreate it but the UUID would change and your VM appears to be running a very old version (or was created by an old version).
I would think it would be much easier to boot the VM from a GParted Live ISO which gives you a graphical interface to grow the extended partition, move the swap partition and shrink the extended partition in order to grow the primary and ext4 filesystem in one go.
Either way, make sure to have a tested and working backup (or clone)!

EDIT: None of this is specific to Proxmox and you would do the same steps for a physical machine, therefore parition resizing guides on the internet do apply if you need some examples.
 
Last edited:
Thanks, that's what I thought. But I have no idea where to start in terms of starting a VM from a different boot agent. Any pointers?
Thanks for the quick response!
 
Thanks, that's what I thought. But I have no idea where to start in terms of starting a VM from a different boot agent. Any pointers?
How did you install an operating system on the VM? Usually people put an ISO into the virtual optical drive and change the Boot order (or press ESC and select booting from the virtual DVD). I don't really feel like writing a manual with screenshots just for that basic task, sorry. I'm sure there are YouTube videos about installing an operating system on a VM, which cover most of those steps.
 
I guess I'm asking something obvious. Yes I know how to do it on hardware, but I'm new to Proxmox. I guess there is an F1 equivalent to select the boot source in Proxmox and point it to an iso image in storage. I'll find out how it's done. Thanks!
 
I guess there is an F1 equivalent to select the boot source in Proxmox and point it to an iso image in storage.
It's pressing ESC on the Proxmox boot logo screen of the VM.
You need to have a virtual CD/DVD drive on the VM (Hardware section of the GUI). Double-click it and select Use CD/DVD disc image file (iso) and select an ISO from a storage.
I assume you already know how to upload an ISO to a storage.
 
Yep. Thanks! GParted booting now. That's the pointer I needed. Learning as we go thanks to precise and succinct information from members like you!
 

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!