Truncate? Sounds like a very manual and generically bad idea.
Manual yes, bad idea, no. Win32DiskImager is already a manual process.
Not using all of the possible space on the card is the only way to be 100% sure the image will safely fit on a target of the "same" size. I can't say how often it happens overall, but it was enough of a headache we got tired of fixing it after the fact and adopted the 90% rule for partitioned space long ago.
95% or even 99% is probably safe. The extra unused space will help with wear leveling and increase the life of the card in general, especially if approaching full usage of the partitioned space, so we stick with 90% max partitioned for SD and USB.
It's not necessary to physically truncate the image file. If sure the partitioned space will fit on the target (90% rule makes sure it will for "same" size cards), just use dd under Linux or Cygwin to write what it can of the image.
And if you get a "slightly larger" 32 GB card and it becomes the working one then are you not then going to have to find yet again a slightly larger chip for the next iteration?
If you take a 32GB image to a 64GB chip, will that always fit or the first time you Win32DiskImager Read it, will you get a 64GB IMG file?
That is exactly what it means. Win32DiskImager is a dumb tool and knows nothing of partition tables. It is a byte for byte copy of the
entire device. If you have a 2GB of partitioned space on a 128GB card, you will get a 128GB image, 126GB of which is garbage. The only way for Win32DiskImager to restore that image to less than a 128GB target is to truncate the file.
Unfortunately Win32DiskImager doesn't have an option (to my knowledge) to write what it can and stop. Even if it did, you have to ensure the partitioned space safely fits on the target (90% rule again).
dd is a better utlility to use for both read and write in my opinion. It's dumb too, but at least can be told how much to read or write.
Seems to me there has to be someone out there that has this licked? A way to format a microSD and restore backed up partitions (The small FAT and the larger EXT4)?.
We do - using these simple techniques.
For the PBX's and some other Pi uses, we also keep local nightly backups to an SD card in a USB reader - ready to swap and boot, and to an image file mounted remotely using a backup script based on the RasPBX image backup script - ready to burn and boot.
Seems I have come across folks saying that even identical part number chips can have some marked bad bits and so won't be perfectly the same size. How can we succeed?
"Same Part Number" doesn't mean anything, regardless of bad bits. Underlying chips can change with each production run.