Restoration Progress % Issue

USB Image Tool support forum
Post Reply
Lewpy
Posts: 4
Joined: Wed May 01, 2013 7:48 pm

Restoration Progress % Issue

Post by Lewpy »

I have two identical 8GB USB memory sticks.
I took a Device Mode backup of one of them this morning, using the .img.gz format.
Now when I try to restore the image to the other memory stick, the progress bar goes beyond 100% :o
I let it go up to 200% before stopping it, but I am not sure if the restoration process was a success.
I will take uncompressed Device Mode backups of each stick and compare them.
Lewpy
Posts: 4
Joined: Wed May 01, 2013 7:48 pm

Re: Restoration Progress % Issue

Post by Lewpy »

I left it running again, and this time it completed the restoration at a point somewhere over 200% 8-)
So I had just cut it off a bit early before.
Still a bit curious as to how it calculates the % progress number.
The Compressed image is 5.86 GB (6,298,122,495 bytes)
The Uncompressed image is 7.46 GB (8,019,509,248 bytes)
So not a 2:1 ratio there.

I will backup the restored USB stick, and run a binary compare on the uncompressed files :)
Lewpy
Posts: 4
Joined: Wed May 01, 2013 7:48 pm

Re: Restoration Progress % Issue

Post by Lewpy »

Both files are identical, so it did correctly complete the restoration process :D
I forgot to mention this is with the [currently] latest version 1.61
Alex
Site Admin
Posts: 267
Joined: Fri Jul 29, 2011 11:59 pm

Re: Restoration Progress % Issue

Post by Alex »

Thanks for reporting. I will take a look at this. Maybe there is something wrong with my progress calculation, because gz file format only stores file size up to 4Gb, as the field is to small to hold larger values.
Lewpy
Posts: 4
Joined: Wed May 01, 2013 7:48 pm

Re: Restoration Progress % Issue

Post by Lewpy »

Ah, yes, I do have the "ignore 4GB gzip check" option enabled :oops:
AntiqueTech
Posts: 6
Joined: Mon Sep 29, 2014 3:14 pm

Re: Restoration Progress % Issue

Post by AntiqueTech »

Any update on this? I am using the command line version and consistently getting 216% as my final completion percentage. I have used versions 1.58 and 1.69 with the same results. I have seen this when restoring to 8 GB and 16 GB flash drives. The command line I am using in 1.69 is:

usbitcmd r <dev#> file.img.gz /g /d /s /i /b:2048

The gzip file size is 5.34 GB (5,736,902,439 bytes). The resulting flash drive used space is 7.02 GB (7,541,682,176 bytes).

I get the same results without the /s option and without the /i option. I also get the same results regardless of the value for /b.
Alex
Site Admin
Posts: 267
Joined: Fri Jul 29, 2011 11:59 pm

Re: Restoration Progress % Issue

Post by Alex »

I'm afraid, there will be no real solution to this issue. Because the gzip file format only contains a 32 bit value for the uncomressed file size, all images larger than 4 GiB have an invalid size information stored in the gzip file. As uncompression is done on-the-fly during restore, there is no chance to say how large the uncompressed image will be. Because of that, the percentage value can be inaccurate. The only option would be to calculate based on the maximum device size, but this will lead to completion values below 100%, when restoring smaller images to larger flash drives.
AntiqueTech
Posts: 6
Joined: Mon Sep 29, 2014 3:14 pm

Re: Restoration Progress % Issue

Post by AntiqueTech »

Thank you for the clear explanation.
Post Reply