Skip to main content
Notice removed Draw attention by CommunityBot
Bounty Ended with no winning answer by CommunityBot
Notice added Draw attention by pipe
Bounty Started worth 50 reputation by pipe
Tweeted twitter.com/StackUnix/status/978916388474621952
edited title
Link
ceremcem
  • 2.5k
  • 1
  • 30
  • 61

How to estimate the size of a btrfs send stream?

Source Link
ceremcem
  • 2.5k
  • 1
  • 30
  • 61

How to estimate the size of btrfs send stream?

I want to calculate the size of btrfs send stream in order to take an appropriate action.

For now, I can get the size with the following code:

exec 5>&1 size=$(btrfs send -v -p $ref_snapshot $src | pv -f 2>&1 > /dev/null | tee >(cat - >&5) ) echo "Calculated size is: $(echo $size | awk '{print $1}')" 

Problem is that this process take too long (32 minutes for 119GiB, for example), so it can't be considered useful.

Is there any way to get the stream size (or a close estimation) in a quicker way?