6

Consider the following command and the output:

zfs send -Pvi \
    tank/vms/langara@zfsnap-2016-05-11_00.00.00--1w \
    tank/vms/langara@zfsnap-2016-05-13_00.00.00--1w \
        | dd  > /dev/null

Run 1:

incremental   zfsnap-2016-05-11_00.00.00--1w tank/vms/langara@zfsnap-2016-05-13_00.00.00--1w    4903284160
size 4903284160
17:29:42   1244483472  tank/vms/langara@zfsnap-2016-05-13_00.00.00--1w
17:29:43   2487508120  tank/vms/langara@zfsnap-2016-05-13_00.00.00--1w
17:29:44   3741453864  tank/vms/langara@zfsnap-2016-05-13_00.00.00--1w
9582310+895 records in
9582799+1 records out
4906393272 bytes (4.9 GB) copied, 3.94883 s, 1.2 GB/s

Run 2:

incremental   zfsnap-2016-05-11_00.00.00--1w tank/vms/langara@zfsnap-2016-05-13_00.00.00--1w    4903284160
size 4903284160
17:30:07   1209666712  tank/vms/langara@zfsnap-2016-05-13_00.00.00--1w
17:30:08   2411042632  tank/vms/langara@zfsnap-2016-05-13_00.00.00--1w
17:30:09   3632274072  tank/vms/langara@zfsnap-2016-05-13_00.00.00--1w
17:30:10   4853372344  tank/vms/langara@zfsnap-2016-05-13_00.00.00--1w
9582450+654 records in
9582799+1 records out
4906393272 bytes (4.9 GB) copied, 4.05346 s, 1.2 GB/s

Run without the -P option:

total estimated size is 4.57G
TIME        SENT   SNAPSHOT
17:36:23   1.11G   tank/vms/langara@zfsnap-2016-05-13_00.00.00--1w
17:36:24   2.25G   tank/vms/langara@zfsnap-2016-05-13_00.00.00--1w
17:36:25   3.39G   tank/vms/langara@zfsnap-2016-05-13_00.00.00--1w
17:36:26   4.50G   tank/vms/langara@zfsnap-2016-05-13_00.00.00--1w
9582443+679 records in
9582799+1 records out
4906393272 bytes (4.9 GB) copied, 4.01077 s, 1.2 GB/s

I have 4 related questions.

  1. Is the initial size listed with the -P switch an estimate? I assume it's the same as without the -P switch, but missing the clarification that it's an estimate.
  2. Is there any way to have zfs send output the actual stream size once the send is complete?
  3. Is there any way to figure out the stream size estimated by zfs send by using existing ZFS properties or is a dry-run send the only way?
  4. Is there anything like logicalwritten (NOTE: not a real property) that would give me the same information as the written property, but using uncompressed sizes?
Ryan J
  • 355
  • 4
  • 11

1 Answers1

2
  1. I would judge from the man page description Print machine-parsable verbose information about the stream package generated that it is the same information, only in a better format (for example, bytes instead of conversion to KB/MB/GB). Also, from your example 4903284160/1024^3~=4.566, rounded up to 4.57, which checks out.
  2. Have a look at this Oracle documentation, it may be helpful:

    Use the following dry-run syntax to estimate the size of the snapshot stream but not send it.
    # zfs send -rnv tank/source@snap1
    estimated stream size: 10.0G
    
    You can monitor the progress of the send stream by inserting the pv command between the zfs send and the zfs receive commands. [...] When the snapshot stream is completely received, the progress monitor identifies the total size received. For example:
    # zfs send tank/source@snap1 | pv |zfs recv pond/target
    10GB 0:01:55 [88.5MG/s] [       <=>   ]
    

    Solaris 11.3 also introduced some new monitoring capabilities of send/recv, something similar might be adopted by illumos/OpenZFS in the future.

  3. The estimated size is already there, did you mean the real size? It is not possible to get the real size unfortunately, for details see this thread.
  4. Maybe logicalused? From the FreeBSD manpage of zfs (illumos also has the property, but the man page is missing the description):

    logicalused
    
    The amount of space that is "logically" consumed by this dataset and
    all its descendents.  See the used property.  The logical space
    ignores the effect of the compression and copies properties, giving a
    quantity closer to the  amount of data that applications see.
    
user121391
  • 2,502
  • 13
  • 31