On 5/6/23 12:54, 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.

After that I remove all the files and mount the old VM image to
another part of the tree.

Rest is just a dump and restore operation. And checking the /etc/fstab

Is this a good way to skin this cat? Or is there a better way to do it?

Not enough information to give an absolute answer, but on minimal thought,
I can think of a few ways to deal with a space problem on a VM:

0) Just start over
* Advantage: Disk space probably wasn't your only error in setup.  Good
time to fix those other issues, too.  Practice in config.
* Disadvantage: Opportunity to make NEW errors! :)

1) build a new VM, restore from your backup to the new VM.
* Advantage: tests your backup and restoration process.  If your routine
backup/restore process doesn't get you through this, you have a problem.
You still have your old VM untouched.
* Disadvantage: More or less end up with where you started, but more
space.

2) Add additional virtual disks to your VM.  Copy partitions to new disk,
delete partitions on old disk, growfs partitions on old disk to use space
of partitions, etc.
* Advantage: you really learn disk manipulation, can sometimes be done
with minimal downtime.
* Disadvantage: you can really screw stuff up, too, leading to option #0


2a) Enlarge the existing virtual disk, use the additional space as with
option #2 above.

3) Dang, I thought I had another option here, but I'm blanking on what
it was.
Advantage: someone else can put their thoughts in.
Disadvantage: do you really want to trust someone this forgetful?

Nick.

Reply via email to