Why would the amount of data in a zfs send stream "fluctuate"? I would expect send of a specific snapshot to always produce exactly the same data!
The test data below was created through something like dd if=/dev/zero of=filename bs=1024 count=1000
The snapshots were taken at intervals between creating the test files. I then repeatedly sent the data to /dev/null using command-history to re-run the command again and again rapidly. No cheating - the snapshots were taken prior to the test and no amount of "writing" to the file system should affect what goes on in an incremental send, or so I would imagine.
sol10-primary:/TST> # ls -l
total 1007
-rw-r--r-- 1 root root 102400 Mar 4 12:01 data1
-rw-r--r-- 1 root root 102400 Mar 4 11:49 data2
-rw-r--r-- 1 root root 30 Mar 4 11:48 data3
-rw-r--r-- 1 root root 102400 Mar 4 11:50 data4
-rw-r--r-- 1 root root 102400 Mar 4 11:52 data5
-rw-r--r-- 1 root root 102400 Mar 4 11:53 data6
sol10-primary:/TST> # rm data5
sol10-primary:/TST> # dd if=/dev/zero of=data5 bs=1024 count=100
100+0 records in
100+0 records out
sol10-primary:/TST> # zfs send -i s1 rpool/tst@s3 | dd bs=1024 > /dev/null
412+6 records in
412+6 records out
sol10-primary:/TST> # zfs send -i s1 rpool/tst@s3 | dd bs=1024 > /dev/null
412+5 records in
412+5 records out
sol10-primary:/TST> # zfs send -i s1 rpool/tst@s3 | dd bs=1024 > /dev/null
412+6 records in
412+6 records out
sol10-primary:/TST> # zfs send -i s1 rpool/tst@s3 | dd bs=1024 > /dev/null
402+32 records in
402+32 records out
sol10-primary:/TST> # zfs send -i s1 rpool/tst@s3 | dd bs=1024 > /dev/null
405+22 records in
405+22 records out
sol10-primary:/TST> # zfs send -i s1 rpool/tst@s3 | dd bs=1024 > /dev/null
412+6 records in
412+6 records out
sol10-primary:/TST> # zfs send -i s1 rpool/tst@s3 | dd bs=1024 > /dev/null
412+5 records in
412+5 records out
sol10-primary:/TST> # zfs list -o name,mountpoint,used,referenced,usedbychildren,usedbysnapshots -r rpool/tst
NAME MOUNTPOINT USED REFER USEDCHILD USEDSNAP
rpool/tst /TST 892K 532K 0 360K
rpool/tst@s1 - 20K 232K - -
rpool/tst@s2 - 20K 432K - -
rpool/tst@s3 - 120K 532K - -
Sometimes in the above I created a snapshot then dd-ed over an existing file, just to get something into the "USEDBYSNAPSHOTS" value.
This is basically pretty much an academic question, I suspect that the variance is within a very small limit, only noticed here because my test data is itself pretty small.
dd
with pipes, usewc -c
to see the size. – Stéphane Chazelas Mar 04 '13 at 11:11