Newbie help needed (resize VM disk)

erodrigues

New Member
Oct 31, 2021
5
1
3
43
I use Nextcloud (NextcloudPi) natively running in a old i7 gen3 laptop but now I am moving everything to a PVE i7 gen10 machine.

I started a test VM with Debian 10 with just a few GB thinking to expand later but now I need to increase the size of the partition and I can't find the solution to increase my sda1 partition to max :( here is my output:

I was able to use the Proxmox UI to change the size using the resize option in Hardware > Hard disk ... i understand that this is not automatically reflected in the VM and there are aditional steps to take inside the VM.

I can't find any solution which works :(

Thanks in advance to anyone who can shed some light to this newbie who is loving Proxmox o_O

Code:
root@nextcloudpi:/# lsblk /dev/sda
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0  816G  0 disk
├─sda1   8:1    0   15G  0 part /
├─sda2   8:2    0    1K  0 part
└─sda5   8:5    0  975M  0 part [SWAP]

Code:
root@nextcloudpi:/# fdisk -l /dev/sda
Disk /dev/sda: 816 GiB, 876173328384 bytes, 1711276032 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: 0x90a50d67

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 / Solaris

Code:
root@nextcloudpi:/# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            2.9G     0  2.9G   0% /dev
tmpfs           597M  8.2M  588M   2% /run
/dev/sda1        15G   14G  316M  98% /
tmpfs           3.0G     0  3.0G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           3.0G     0  3.0G   0% /sys/fs/cgroup
tmpfs           597M     0  597M   0% /run/user/0
tmpfs           597M     0  597M   0% /run/user/1000
 
Hi,

hope I understand you correct. You resized the disk in proxmox web interface and now want to resize the partition of this disk in your virtual machine?

My way is perhaps not the best one but I do such task with GParted Live iso. I mount the iso file for the vm and boot from that. In GParted you can than change partition size, move partition and so on with an easy GUI. I tried this with different guest os. Normally it works well but it is important to make a backup before you do this! Use the Proxmox backup function to come back if something goes wrong.
 
  • Like
Reactions: erodrigues
Hi,

hope I understand you correct. You resized the disk in proxmox web interface and now want to resize the partition of this disk in your virtual machine?

My way is perhaps not the best one but I do such task with GParted Live iso. I mount the iso file for the vm and boot from that. In GParted you can than change partition size, move partition and so on with an easy GUI. I tried this with different guest os. Normally it works well but it is important to make a backup before you do this! Use the Proxmox backup function to come back if something goes wrong.
That is a great idea! :)

I will give it a try and let you know how it goes.

Thanks a million
 
@BJ78945

It worked like a charm with a little bit of "side effects" ... :p

I ended up having to delete the extended partition and the linux swap part partition which was in "front" of sda1. Them extended sda1 and left 1GB left of free space.

On that free space, created a linux swap partition, no extended to keep it simple.

Now the boot takes longer and I have a "error" message with "a start job is running for /dev/disk/by-uuid/xxxxxxxxxxxxxxx

I edited the file /etc/fstab since my swap was sda5 and now is sda2 and the UUID has changed .. I replaced the UUID and no more error message, but the boot up is no longer as fast as it was... BUT, my main problem is gone :)
 
  • Like
Reactions: vendo232
@BJ78945

It worked like a charm with a little bit of "side effects" ... :p

I ended up having to delete the extended partition and the linux swap part partition which was in "front" of sda1. Them extended sda1 and left 1GB left of free space.

On that free space, created a linux swap partition, no extended to keep it simple.

Now the boot takes longer and I have a "error" message with "a start job is running for /dev/disk/by-uuid/xxxxxxxxxxxxxxx

I edited the file /etc/fstab since my swap was sda5 and now is sda2 and the UUID has changed .. I replaced the UUID and no more error message, but the boot up is no longer as fast as it was... BUT, my main problem is gone :)
I was in the same situation with Debian VM and had to do the same thing. Your post helped me a lot.
 

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!