On 2025-02-12 01:00, 04-psyche.tot...@icloud.com wrote:
Hi all,
I run a Debian VM on an openBSD system.
I need to increase the size of this VM.
I've increased the size of the disk image via qemu-img resize
disk.qcow2 +50G
Now, I need the VM OS to be resized as well.
I tried to resize the partition with fdisk, but this is not possible it
seems because this is the OS partition (fair enough).
I've then tried with growpart, but this failed as well.
Is it possible to resize the OS partition?
See some commands ran on the VM below:
$lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
vda 254:0 0 100G 0 disk
|-vda1 254:1 0 49G 0 part /
|-vda2 254:2 0 1K 0 part
`-vda5 254:5 0 975M 0 part [SWAP]
$sudo fdisk /dev/vda1
This disk is currently in use - repartitioning is probably a bad idea.
It's recommended to umount all file systems, and swapoff all swap
partitions on this disk.
The device contains 'ext4' signature and it will be removed by a write
command. See fdisk(8) man page and --wipe option for more details.
$sudo growpart /dev/vda 1 -v
/dev/vda1 : start= 2048, size= 102854656, type=83, bootable
/dev/vda2 : start= 102858750, size= 1996802, type=5
/dev/vda5 : start= 102858752, size= 1996800, type=82
max_end=102858749 tot=209715200 pt_end=102856703 pt_start=2048
pt_size=102854656
NOCHANGE: partition 1 could only be grown by 2046 [fudge=2048]
Hi,
You can't grow the first partition because you have two more partitions
after it (vda2 and vda5).
You have to delete the swap (vda5) and the logical partition (vda2),
then expand the vda1.
THen it is up to you if a new swap partition will be made (I would say
no :).
Best wishes,
Atanas