On 2023-05-06 11:54 am, Hannu Vuolasaho wrote:
Hello,

I made a silly mistake when I set up my VM and my disk image is too
small for my next operation.

My plan is to give the new image to the VM, run a minimal install on
it so I get the boot loader installed. Also disklabel will be good.
...
Is this a good way to skin this cat? Or is there a better way to do it?

It's fine, but I took it a different route recently, for a VM that I've
been using for a year or two but realized I needed more space.  It
wasn't that hard to resize.  However, it is worth calling out that
recreating a VM can be a good way to find out what you need, and don't
need, on it.

If you go for the resize, you'll need the qemu-img tool from the qemu
package in order to make sure the disk image is in qcow2 format (you
can convert from a raw image if necessary), and then change its size.
From there you can do partition and filesystem manipulation from within
the VM.

If you need to do something more complicated than add filesystems or
grow the last partition, you should probably add more disk images or
consider starting from a fresh install.

Matthew

Reply via email to