Re: Re-sparse a file-backed IO device + zfs

2016-12-13 Thread Adam Vande More
On Mon, Dec 12, 2016 at 7:20 PM, javocado  wrote:

> Hi,
>
> I'm setting up a bhyve wherein:
>
> host #  truncate -s 1T vol.file
> host #  du -ah vol.file
> 200Kvol.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
>

I think there used to be a utility called sparsify.



-- 
Adam
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


Re: Re-sparse a file-backed IO device + zfs

2016-12-12 Thread Karli Sjöberg

Den 13 dec. 2016 02:20 skrev javocado :
>
> Hi,
>
> I'm setting up a bhyve wherein:
>
> host #  truncate -s 1T vol.file
> host #  du -ah vol.file
> 200Kvol.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
> 100Gvol.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?

Wouldn't you have needed TRIM on the disk(s) inside the VM and it would have 
taken care of all this for you?

/K

> ___
> freebsd...@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-fs
> To unsubscribe, send any mail to "freebsd-fs-unsubscr...@freebsd.org"
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


Re-sparse a file-backed IO device + zfs

2016-12-12 Thread javocado
Hi,

I'm setting up a bhyve wherein:

host #  truncate -s 1T vol.file
host #  du -ah vol.file
200Kvol.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
100Gvol.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?
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"