Skip to content

Instantly share code, notes, and snippets.

@ptzagk
Forked from rahmancloud/upload-size-bytes.md
Created September 7, 2022 15:53
Show Gist options
  • Save ptzagk/7604d3113e13ffd6e31f54af11524a57 to your computer and use it in GitHub Desktop.
Save ptzagk/7604d3113e13ffd6e31f54af11524a57 to your computer and use it in GitHub Desktop.
The upload size in bytes # - 512 bytes for the VHD footer (# in this case) must be a multiple of MiB.
$ wc -c os_disk.vhdx
5272240128 os_disk.vhdx

The vhd file size needs to be a number divisible by 1024.

5272240128 / 1025 / 1024 / 1024 = 4.91015625

4.91015625 is not divisible by 1024. We are going to round the number to 5.

5 * 1024 * 1024 * 1024 = 5368709120

And add 512 bytes for the VHD footer.

5368709120 + 512 = 5368709632

Reference: Reddit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment