Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Jul 2020 10:21:09 -0400
From:      Allan Jude <allanjude@freebsd.org>
To:        freebsd-virtualization@freebsd.org
Subject:   Re: zfs compression of a volume
Message-ID:  <d38fdfe3-840a-14cb-71cf-6f5232f80559@freebsd.org>
In-Reply-To: <20200715140444.GA72748@bastion.zyxst.net>
References:  <20200715140444.GA72748@bastion.zyxst.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2020-07-15 10:04, tech-lists wrote:
> Hi,
> 
> If a zfs-backed bhyve instance is created, and compression is not set,
> if the
> instance is turned off, then compression set on the host for the volume
> (and
> then the bhyve instance is started), is the instance compressed in its
> entirety at that time, or just data subsequently added to it?
> 
> thanks,

When you change the compression setting on any ZFS dataset (filesystem
or volume), it only applies to blocks that are written (or overwritten)
after that point.

You do not need to stop the bhyve to change the compression setting.

If you want to recompress the entire volume:

1) stop the bhyve
2) snapshot the volume
3) create a new volume, with compression enabled
4) zfs send -e oldvolume@snapshot | zfs recv -F newvolume
5) start the bhyve using the new volume
6) (optional) destroy the old volume


-- 
Allan Jude



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d38fdfe3-840a-14cb-71cf-6f5232f80559>