Enlarging the max size of a dynamically allocated Opnsense VM

Started by thebraz, March 13, 2024, 05:19:09 PM

Previous topic - Next topic
Hi,

I have a virtualbox Opnsense VM whose VDI size has been defined as dynamically allocated till a defined max size.

Now I'd like to increase the max size; tried using the CloneVDI program using the option to increase the size but this leads (seen through "gpart show") to a corrupt ada0 GPT.

Could you please give me advices on how to resize it properly?

Thanks in advance

Since I solved the thing using the following steps, could be useful for someone else:

I) From the Hypervisor tools adjust the disk size to what you want
II) Boot opnsense in single-user mode
III) use "gpart show" ---> it should report a corrupt ada0
IV) Fix ada0 with "gpart recover ada0"
V) Now "gpart show" shows a correct ada0 and free space after freebsd-ufs (which in my case has id = 3)
VI) Do the resize of the freebsd partition "gpart resize -i 3 ada0"
VII) "gpart show" shows a resized freebsd-ufs
VIII) "growfs /dev/gpt/rootfs" resize the filesystem
IX) Optional: you can make an "fsck" just to be sure
X) "exit" so the system go in multi-user mode

Best Wishes