Increase size of root Tumbleweed in Virtual Box

I installed tumbleweed in a Vbox on on a 20Gb virtual disk. I accepted the default partitioning in BTFRS format. So now I have a 800Mb boot, a root partition occupying the vast majority of the VDI an finally a swap partition of 3Gb.
I wanted now to extend the VDI, and i could increase to vdi to 30Gb in Virtual Box. But nothing happens in tumbleweed. I installed gparted in tumbleweed and there I see the vdi, but the root and swapped are locked. I googled and found some CLI functions for BTFRS, but nothing could be changed. Is there a way to get around this. I thought deleting the swap and then resizing the root, but the lock seems to prevent the deletion of the swap. ANy idea???

I use qemu/libvirt vm but there must be similar things you can do with Vbox to alter partition setup of vm. In libvirt, you set your vm boot profile to temporarily boot to a gparted iso rather than it’s hard drive. You can then manipulate your disk partitions as you wish. The partitions should be unlocked upon booting to gparted. Vbox must have a similar function to alter boot list available.

To expand the size of the whole disk(s) you need external vm ware program.

tom kosvic

I strongly doubt that re. KVM/qemu, since that is/can be done in other ways. In the case of btrfs one can

  • grow the image with sudo qemu-img resize /path/to/image.qcow2 +20G and then
  • grow the btrfs partition from within the running VM with sudo growpart /dev/vda <partition number>, mind the space between vda and
  • grow the fs with sudo btrfs filesystem resize max /

I assume you’re referring to “VMware” , which is NOT the same product as VirtualBox (which the OP is using).

Reading through your post, you’ve managed to increase the VDI size as desired, which has given you unallocated space at the end of the virtual disk.

In your case the swap partition is probably after the Btrfs root partition, so the new free space isn’t directly adjacent to it. Also, GParted can’t modify a mounted root filesystem.

I recall doing something similar by turning swap off and removing the partition, then extending the root partition to the desired size, creating a new swap partition in the remaining space, and turning swap back on. (That could be done from the live system.)

On a modern system using systemd, a swap partition can also be automatically discovered without an /etc/fstab entry, provided it has the appropriate GPT partition type. If you have an existing swap entry in /etc/fstab, remove or update (with correct UUID) it as appropriate.

Before doing any partition changes though, I’d take a snapshot/backup of the VM.

You made me think again about Gparted and I got my problem fixed by running a Gparted live iso from within my tumbleweed VBox. Removed swap, extended root leaving some space at the end and adding a swap in the remaining unallocated space.
I run then tumbleweed and got the additional spae available.
Tx for your input.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.