From owner-freebsd-virtualization@freebsd.org Tue Dec 13 01:20:25 2016 Return-Path: Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C85AC74B1B; Tue, 13 Dec 2016 01:20:25 +0000 (UTC) (envelope-from javocado@gmail.com) Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD7321D86; Tue, 13 Dec 2016 01:20:24 +0000 (UTC) (envelope-from javocado@gmail.com) Received: by mail-wm0-x229.google.com with SMTP id a197so87424807wmd.0; Mon, 12 Dec 2016 17:20:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=ks5P72YneuHYn5HRAzWlTvlPEI4cfDr1xsM7fBaghwQ=; b=XrZYRe8AsrdpHn6ssu6xKdbY2Cadb0hREIFkxI6Qgi17+qnAT40KDrkaqvwGr4+umi xf9Sk3rc502vu04Xlu4Q2nbV1fpOKxF5dJvqX1ClZ6Wru/qi27gQ6j1FNs7sMFqQd0TW dvT+1S5qjT8zwLV96Vh/oUQWS2kxrwhxGShYD93nM6b/D9/iouu5sVXEHxKxRZfJeX90 /yo+Vd0zsrPgHepyTq+mib7X5IT7hTNq658J6doCVwzolHuLkA0nrMNUujEB13vG5kzC NI63Eqnucba1QIewAtuhsLFafIdPkXAWNhy6nPim9BH0nJ1jSXc3388/gBzbYwDZD2Nc W0aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ks5P72YneuHYn5HRAzWlTvlPEI4cfDr1xsM7fBaghwQ=; b=LUHdUH/NYY5TOVSd/moljcaSHYwHURY0rw1BS8FHKPsIpAJtPb7XUMC0ZCNrl2suRV csJQvE2I+O3LYVTt+TV1oG/3IznpM48CY2XRDl4xLoFPU7NzysF/nnul86ReNWWhCCFz O2uz/9e7g/syWrwm9Xz6hy+r0hoJ76HjlhfAOg554xM0nGU6bjnWFj7uApj/SaYpcoIM waky9PqJy8ZRPSlj9GCz+gVksw0ZOk696tvszBa5JRaeQqkNElBXTP/iBCDOslkrV7/7 AgPKeIAZfGrEPGfowax89X0qImI+5g5srmpc6Hj34pLQGKk8sADOdsGNESndiQRLg7QI vF2Q== X-Gm-Message-State: AKaTC00qxDcq8AizXXUhxeda18PYykcQy+GWHBierxDmTGQfuJouQq/E7m/UW/IfNXmUaucpwO0fLo+arFuLig== X-Received: by 10.46.77.17 with SMTP id a17mr40522055ljb.34.1481592021762; Mon, 12 Dec 2016 17:20:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.114.25.165 with HTTP; Mon, 12 Dec 2016 17:20:21 -0800 (PST) From: javocado Date: Mon, 12 Dec 2016 17:20:21 -0800 Message-ID: Subject: Re-sparse a file-backed IO device + zfs To: freebsd-virtualization@freebsd.org, freebsd-questions@freebsd.org, FreeBSD Filesystems Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Dec 2016 01:20:25 -0000 Hi, I'm setting up a bhyve wherein: host # truncate -s 1T vol.file host # du -ah vol.file 200K vol.file host # /usr/sbin/bhyve ... -s 4,ahci-hd,vol.file ... Then inside the bhyve I create a zpool (ada0 = vol.file): bhyve # zpool create -O devices=off -O atime=off -O compression=on -m /mnt/data1 data1 ada0 And I put a bunch of stuff in the zpool ... and the vol.file grows in size: host # du -ah vol.file 100G vol.file Then I remove the files from the zpool and the zpool usage returns to 0 but of course the vol.file size does not shrink, the data is still there (but not referenced?) Normally I'd just write zeros to a file inside the zpool until the pool fills up, then maybe cp --sparse vol.file for good measure, but with compression on in the zpool the zeroing doesn't really fill up space or seem to overwrite anything. In my testing the zero file grew larger than 100G with no change to vol.file I did not let it run forever, however. Any other ideas how to scrub off or clear out deleted data from a zpool and/or this kind of file-backed device?