On Mon, Apr 14, 2008 at 09:59:48AM -0400, Luke Scharf wrote:
> Stuart Anderson wrote:
> >As an artificial test, I created a filesystem with compression enabled
> >and ran "mkfile 1g" and the reported compressratio for that filesystem
> >is 1.00x even though this 1GB file only uses only 1kB.
> >  
> 
> ZFS seems to treat files filled with zeroes as sparse files, regardless 
> of whether or not compression is enabled.  Try "dd if=/dev/urandom 
> of=1g.dat bs=1024 count=1048576" to create a file that won't exhibit 
> this behavior.  Creating this file is a lot slower than writing zeroes 
> (mostly due to the speed of the urandom device), but ZFS won't treat it 
> like a sparse file, and it won't compress very well either.

However, I am still trying to reconcile the compression ratio as
reported by compressratio vs the ratio of file sizes to disk blocks
used (whether or not ZFS is creating sparse files).

Regarding sparse files, I recently found that the builtin heuristic
for auto detecting and creating sparse files in the GNU cp program
"works" on ZFS filesystems. In particular, if you use GNU cp to copy
a file from ZFS and it has a string of null characters in it (whether
or not it is stored as a sparse file) the output file (regardless of
the destination filesystem type) will be a sparse file. I have not seen
this behavior for copying such files from other source filesystems.

Thanks.

-- 
Stuart Anderson  [EMAIL PROTECTED]
http://www.ligo.caltech.edu/~anderson
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to