can a bhyve instance be resized? adding another virtual disk?

Allan Jude allanjude at freebsd.org
Wed Oct 15 14:16:34 UTC 2014


On 2014-10-15 07:56, freebsd-lists at potato.growveg.org wrote:
> Hello list,
> 
> Can a bhyve instance be resized? I'm talking about the disk. 
> Say your end user needs more diskspace. They have 32GB. They need 64GB.
> How do you do it? I presume one has to stop the guest, then use truncate.
> What about if the guest OS isn't freebsd, and they use say ext2 or 3? Will
> ext3 start yelling at me because I've resized it?
> 
> What if they just want another disk? How does one refer to a 
> newly created virtual disk from a guest? How is it mounted to the guest?
> 
> thanks
> 

It works much the same as doing it in any VM

1. Shutdown VM
2. Resize the backing disk (expand the file, zvol, whatever)
3. Boot the VM
4. Recover the partition table (GPT's backup copy of the partition table
is in the last sector of the drive, which is now in a different place)
5. Resize the partition (gpart resize for FreeBSD, if you do not specify
a size it will expand to all available space)
6. Resize the file system (growfs for UFS on FreeBSD, lvm or whatever
for linux)

You might have to reboot an extra time between step 5 and 6.

The instructions for everything you do inside the VM (steps 4 - 6) are
set out in more detail with example output in the handbook:

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/disks-growing.html


-- 
Allan Jude

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-virtualization/attachments/20141015/0cc1db9b/attachment.sig>


More information about the freebsd-virtualization mailing list