[SOLVED] Expanding ext4 partition VM disk is on ZFS

muekno

Member
Dec 15, 2023
164
11
18
Situation, I created a Debian 12 VM, so far so fine, it works
No I like to expand sda1 containing \
So I increased the VM disk from 16 Gb to 21 Gb, I can see the new size under Hardware
I can see the new unused space online and offline in gparted
Bildschirmfoto 2024-04-22 um 13.38.42.png

Code:
root@deb12:~# fdisk -l
Disk /dev/sda: 21 GiB, 22548578304 bytes, 44040192 sectors
Disk model: QEMU HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0474cae2

Device     Boot    Start      End  Sectors  Size Id Type
/dev/sda1  *        2048 31553535 31551488   15G 83 Linux
/dev/sda2       31555582 33552383  1996802  975M  5 Extended
/dev/sda5       31555584 33552383  1996800  975M 82 Linux swap / Solari

But I cant add the new space to sda1.
Ok I understand the free space is at the end and there are sda2 and sd5 between

So I used gparted to offline move sda2 and sda5 to the end and make free space behind sda1, but gparted would not to
I tried everything from here https://pve.proxmox.com/wiki/Resize_disks, I did Google research for hours but found nothing new.

I tried the same on local-lvm, same game. Tried with a SUSE SLES 15. SP4 too (on ZFS)

The three are just quick test installations, the final target is to expand a 500 Gb Debian 11 VM I imported from ESXi.

Need some help or link to a working article/tutorial
Thank you

Sorry to have so many posts with questions but I am new to PROXMOX
 
do a ' swapoff -a; swapon -s; free -h ' and make sure the swap is not in active use. Then you should be able to delete the sda2 Extended partition entirely and expand the root FS with gparted or commandline.

I recommend redoing swap as a swapfile on root so you don't run into this in the future, or allocate a swap partition on a completely separate virtual disk.

It's also a good idea to give a 64-bit OS a bit more room to breathe in, especially with package updates. 21-31GB (maybe even 40GB) for ext4 or XFS root is a better idea to start with, depending on what packages you're installing; then you shouldn't have to mess with resizing.

Reinstalling fresh with the proper disk sizing is also an option as long as you haven't customized the install.
 
Thank you, yes thats is it, deleting or moving the swap, so the free space is direct behind the root partition and the root partition can expanded. I was blind
Regards
Rainer
 
  • Like
Reactions: Kingneutron

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!