Date: Mon, 12 Dec 2016 20:25:18 -0500 From: Shawn Webb <shawn.webb@hardenedbsd.org> To: javocado <javocado@gmail.com> Cc: freebsd-virtualization@freebsd.org, freebsd-questions@freebsd.org, FreeBSD Filesystems <freebsd-fs@freebsd.org> Subject: Re: Re-sparse a file-backed IO device + zfs Message-ID: <20161213012518.GA77233@mutt-hardenedbsd> In-Reply-To: <CAP1HOmQ6zXOqeD=DYe0rtnR6TkzyndLZHyutgynBXWNMVuiksA@mail.gmail.com> References: <CAP1HOmQ6zXOqeD=DYe0rtnR6TkzyndLZHyutgynBXWNMVuiksA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On Mon, Dec 12, 2016 at 05:20:21PM -0800, javocado wrote: > 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? Instead of dd'ing /dev/zero, try /dev/random. All zeros compress extremely well, [pseudo-]random data does (or, ideally, should) not. -- Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYT038AAoJEGqEZY9SRW7u1g0P/impDd7fVDSFcO5i/3wlf8M6 8tUs1sg53pJYSNDtEbIfiSODiJDwaXl4+Kdp7o4WbFP68HCzhHPr/qKB4GTyhSPD CgQRa9Jj90E+B7+/zSTba/b5axa30mfSeoVc0Ma1+id/Yq7J+rVEa951eXGCaE/5 bmkrPnWHilYfdRJLY2npVoVwjC44vxn3f1GlD06rrwTV+JCMaw6f7k6hkuAh9trg UyoCJftEH1hzcpyAWYVS4Wn+t/6bXFICKv+tpwDwm+epVkf6tIKvNNFEYxE+TFik PhTk5+i7Lz/12bR6Vh/hKiYKKxHa2rtYSA49TDBMeInOa5yCGQ6f98/Nz/MKc8d9 LUXUSovnVLZkMVObUK31dPF9TuZESK3SGRUTN6CzDArRIcl63xqRWevuv6Hk46Je vurBhvtN89ROzd/BZ10rISuGv+TlyY5MvykggZ7v1obB7nkukFnGQ3PKwmL2DHP5 h1AMc+NFQOU6ym/qcMVDqX/BBuzFBvkgLzZyOjh5wPNsq1ScuBBYO7yFBBwzcQRl rDLviLKBsUNsjHtOF38evqcbGYl19th92o6q4pWiE6hriO/WnaI6yI5WtfPHV7ta oefL87gBeb98YegBF2cCMmE+e0kulJta8qFZQC5bLcIQoBF8Nk9fBfMHUYiGlBxZ /iLIWlsGHOIQt86ev4Nt =wvAw -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20161213012518.GA77233>
