Shrinking an .img to smallest size possible

0

Let's say I have a simple img, 5Gb in size. I mount it, and 'burn' an Windows 10 ISO on to it. Now, the ISO is only 4939528192 bytes in size, but I want the img to be as small as possible. Is there a way to automatically shrink the img file so that all the partitions contained are as small as possible using linux commands? I'm fine with having to complete the commands on the desktop.

Yes, I know I can just 'burn' ISOs straight to my media, except I can't because I'm using DriveDroid, which requires that I create an img of a set size before hand.

Matt M.

Posted 2019-06-19T05:11:38.787

Reputation: 163

1Just to avoid misunderstandings: how do you mount it, and 'burn' a Windows 10 ISO on to it? Do you copy the file to the mounted filesystem? or how? – Kamil Maciorowski – 2019-06-19T05:17:40.693

1No need to burn anything use 7Zip or other to unzip the ISO then zip it into IMG. Search for some product on Linux for it. – harrymc – 2019-06-19T08:48:48.223

@KamilMaciorowski I mount the img using drive droid, and then 'burn' the ISO with Rufus. – Matt M. – 2019-06-19T22:41:42.617

No answers