Releasing deleted blocks from a sparse ZVOL

Eric Borisch eborisch at gmail.com
Mon May 14 20:37:46 UTC 2018


I've had success in a similar config by attaching the zvol as 'ahci-hd',
which shows up as a 'BHYVE SATA DISK' in a BSD guest. With such a guest
(running a zpool on the attached device):

kstat.zfs.misc.zio_trim.failed: 0
kstat.zfs.misc.zio_trim.unsupported: 0
kstat.zfs.misc.zio_trim.success: 179883
kstat.zfs.misc.zio_trim.bytes: 13126696960

Also working with a linux guest.

I see the expected tracking of the 'logicalreferenced' size in the host
with the ALLOC size in the guest (allowing for upward bias due to using 32k
sector sizes on my zvols).

Note that TRIM and UNMAP are two extremely similar but distinct (used for
SATA & SCSI, respectively) commands. Both are commonly referred to as
'trim' by layers above the device drivers.

  - Eric


More information about the freebsd-fs mailing list