On 09/21/2012 01:34 AM, Jason Usher wrote:
> I have a ZFS filesystem with compression turned on. Does the "used" property
> show me the actual data size, or the compressed data size ? If it shows me
> the compressed size, where can I see the actual data size ?
It shows the allocated number of bytes used by the filesystem, i.e.
after compression. To get the uncompressed size, multiply "used" by
"compressratio" (so for example if used=65G and compressratio=2.00x,
then your decompressed size is 2.00 x 65G = 130G).
> I also wonder about checking status of dedupe - I created my pool without
> dedupe, and continue to NOT enable dedupe - from zpool history, we see:
> zpool create -f -O atime=off -O setuid=off -O exec=off -m /mnt/pool pool
> raidz3 da0 da1 da2 da3 da4 da5 da6 da7 da8 da9 da10 da11
> Later, I enabled dedup for just a single filesystem on this pool:
> zfs set dedup=on pool/dataset
> and now, I see in 'zpool list' a value for dedupratio:
> pool dedupratio 1.65x -
> Why do I see a value here ? Isn't dedupe still OFF for the pool as a whole ?
> I do NOT want to enable dedupe for the entire pool.
That's because dedup operates at the block level, not the filesystem
object level, i.e. it kicks into effect once the data passes through the
filesystem layers and gets subdivided into disk blocks. The point is
that de-duplication (in a sense) allows you to de-duplicate blocks
across multiple filesystems. Take for instance the following example:
Here ZFS will try to deduplicate the blocks in fsA not only in regards
to other blocks in fsA, but also in regards to fsC.
> Also, why do I not see any dedupe stats for the individual filesystem ? I
> see compressratio, and I see dedup=on, but I don't see any dedupratio for the
> filesystem itself...
Because, as explained above, once deduplication for a particular block
is requested (that's controlled by the dedup setting in the particular
filesystem where the block originated), the dedup mechanism will try to
look for matching blocks across all blocks in all filesystems on the
given pool that have dedup enabled, not only in the originating
filesystem. This is to improve efficiency.
> Did turning on dedupe for a single filesystem turn it on for the entire pool ?
In a sense, yes. The dedup machinery is pool-wide, but only writes from
filesystems which have dedup enabled enter it. The rest simply pass it
by and work as usual.
zfs-discuss mailing list