zfsonlinux/zfs — Issue #548: Highly inefficient use of space on small files, even with other filesystems in zvols
Author: gentoofan
Created: 2012-02-02 03:21:17+00:00
State: open

I am using the latest GIT code, e29be02e46ba2470795c9ab12e6da12d58ff2e5a. I unpacked a copy of the portage-tree, which requires about 672M on ext4 with a 4K block size, on a ZFS dataset on a raidz2 pool that had ashift=12. It used about 1.5GB.

I then tried using zvolumes, and I had similar results. The storage requirements on the pool are consistently double that of the storage requirements of the actual hosted filesystems:

(df -h reported size) - (zfs list reported size)/(size provided at creation time) (mkfs. options)
743688 - 1.58G/1G - ext4 (normal, zvol) -E discard -N 1048576
688912 - 1.58G/1G - ext4 (extra options, zvol) -E discard -N 1048576 -I 128 -m 0 -O ^ext_attr,^resize_inode,^has_journal,^large_file,^huge_file,^dir_nlink,^extra_isize
687856 - 1.40G/1G - ext4 (extra options, zvol) -E discard -N 262144 -I 128 -m 0 -O ^ext_attr,^resize_inode,^has_journal,^large_file,^huge_file,^dir_nlink,^extra_isize
301684 - 607M/1G - reiserfs (default options, zvol)

I was surprised to see this. You can obtain a snapshot of the portage tree at the following site to verify my results from the following link:

http://mirrors.rit.edu/gentoo/snapshots/portage-latest.tar.xz

I am linking to the latest tarball rather than the current one, mostly because dated tarballs are not hosted particularly long. I expect that others can reproduce my findings regardless of whether or not the same exact snapshot is used.

Does anyone have any idea what is causing this?