Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Oct 2014 10:16:33 -0400
From:      Allan Jude <allanjude@freebsd.org>
To:        freebsd-virtualization@freebsd.org
Subject:   Re: can a bhyve instance be resized? adding another virtual disk?
Message-ID:  <543E81C1.7060706@freebsd.org>
In-Reply-To: <20141015115638.GA72800@potato.growveg.org>
References:  <20141015115638.GA72800@potato.growveg.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--ipGuK4bPgF6kOwbMPasVvT6dTNit9iDx0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

On 2014-10-15 07:56, freebsd-lists@potato.growveg.org wrote:
> Hello list,
>=20
> Can a bhyve instance be resized? I'm talking about the disk.=20
> 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 truncat=
e.
> What about if the guest OS isn't freebsd, and they use say ext2 or 3? W=
ill
> ext3 start yelling at me because I've resized it?
>=20
> What if they just want another disk? How does one refer to a=20
> newly created virtual disk from a guest? How is it mounted to the guest=
?
>=20
> thanks
>=20

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.h=
tml


--=20
Allan Jude


--ipGuK4bPgF6kOwbMPasVvT6dTNit9iDx0
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (MingW32)

iQIcBAEBAgAGBQJUPoHEAAoJEJrBFpNRJZKfmTwQAKxwT6hyCSMwdFDAFlA2Z9YN
WCe2fM3r6t1DaKw0/rwr7+eWzte7+yEKQQ9t0TH1OvwQNDuXxn4lJkVTZmJv+V9u
Xnz8fyhrhHoXl7jtauY2c06cZs5YZWf3dc9C5OeUM5d3o1ixfqCK4SO836LEXfM/
gy5NJLrHphGKnukzsPFxGk1+frwGScIZQ1SNdTDFnCMIvPGRCmUArC//lB7q2mst
1Zc7hnL0sGbUbuvNltP/HZIjHhvRYGqo133kHmd3z6YrEuHus1heAXQruPjdCar2
2SJ5wEaDTQsG0uU/dBxLRso8ZNgfOQHDhNOi5JhD6UhVfkVxH03mhu832ugN2ALj
izVeUE77gNK7ZKkwDCtwsJ/b97GXyrjC0QG7nTTbaalbjaT0bWuA3FPW+oF52O8l
IJ1pz2ITEqqC43f/fcjsMiHAqePAdK2jiy6OyC4vo5kVCS1Hw0SaBRJ72Mkbtbp0
fEqnsyBksm5G4tCN8QYdygiMvjSKH6iILTQuJMXX2Ld4dAQc8OG4SeekP+dcnZ8W
YIwZYbq80z4D9dUN1aQGhgyZ0WdCROQ9fMpwM6cM9ysQSF7UkDWxnd8Lduh1WnGX
Obq/2OFQ7r2i04kn6vvp4byYcW7uyPGXvi8bv78pBfxIom/mkB9CDFC40Nn0znyv
Rg3sWlLacicgcv6YV6pv
=a5ez
-----END PGP SIGNATURE-----

--ipGuK4bPgF6kOwbMPasVvT6dTNit9iDx0--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?543E81C1.7060706>