Solved (kinda) Shrinking .img files

Xavier

Orochi's Acolyte
20 Year Member
Joined
Apr 25, 2002
Posts
5,134
I made a .img file using Win32Diskimager the actual info on the disk is about 3.5gb. The .img file ended up being 8gb the same size as the disk I put it on. I bought another disk and it's not the exact same size it's about 6 megs smaller and so it wont fit.

Googled it and the only answers I could find were that I need to go into Linux and follow these books worth of instructions. It'd almost be simpler to reinstall the system on a 4gb disk and make an image from that.

This is 2016 and can't believe this is the same way they're being made and there isn't a simpler solution.

Guess this is why Mame it's own chd files.
 
Last edited:

skate323k137

Professional College Dropout
10 Year Member
Joined
Jan 7, 2013
Posts
4,210
If you're imaging an entire partition or disk, the image doesn't care about the underlying file system usage. It doesn't even care what file system it's formatted as. It has to copy the entire allocation of blocks, because it doesn't give a fuck what blocks are or are not used.

In some cases you could resize the source partition down from 8gb to 4gb and then take an image of that.

If storage is an issue of course you could zip the img file itself to transport it, but you'd have to extract it to use it.
 
Last edited:

Xavier

Orochi's Acolyte
20 Year Member
Joined
Apr 25, 2002
Posts
5,134
In some cases you could resize the source partition down from 8gb to 4gb and then take an image of that.

If storage is an issue of course you could zip the img file itself to transport it, but you'd have to extract it to use it.

I've tried resizing the source partition down and it still made an image of the entire disk, maybe I'm missing a step. Think I left the unused space as allocated.

The problem is I'm trying to put it on another disk and they aren't the same exact size. Even the same make model from the same manufacturer are all different sizes with small variances of just a few megs. That 2-6 megs less won't fly.
 

skate323k137

Professional College Dropout
10 Year Member
Joined
Jan 7, 2013
Posts
4,210
I've tried resizing the source partition down and it still made an image of the entire disk, maybe I'm missing a step. Think I left the unused space as allocated.

The problem is I'm trying to put it on another disk and they aren't the same exact size. Even the same make model from the same manufacturer are all different sizes with small variances of just a few megs. That 2-6 megs less won't fly.

Yeah that makes sense.

I do everything in linux so I probably won't be of help with Win32Diskimager.

With linux if you just need an image of the first partition, and then copy to a whole disk, you would just do

dd if=/dev/sdb1 of=/some/file.img

then

dd if=/some/file.img of=/dev/sdc

Where sdb is old disk, and sdc is new disk. sdb1 represents the first partition on sdb. However if you need MBR or info outside of the first partition itself, that's not going to fly.
 

Xavier

Orochi's Acolyte
20 Year Member
Joined
Apr 25, 2002
Posts
5,134
Yeah that makes sense.

I do everything in linux so I probably won't be of help with Win32Diskimager.

With linux if you just need an image of the first partition, and then copy to a whole disk, you would just do

dd if=/dev/sdb1 of=/some/file.img

then

dd if=/some/file.img of=/dev/sdc

Where sdb is old disk, and sdc is new disk. sdb1 represents the first partition on sdb. However if you need MBR or info outside of the first partition itself, that's not going to fly.

I meant I deleted the space and left it unallocated damned spell check. I believe I also reformatted the other partition and made it another drive usable in windows and that didn't work either.

Yeah it's a Windows system so I'm sure there's a MBR in there. So the commands you just listed won't work for that?
 

Xavier

Orochi's Acolyte
20 Year Member
Joined
Apr 25, 2002
Posts
5,134
You know what, I'm just gonna buy 16gb cards, they only cost a few bucks more.
Sometimes I get so obsessed with making things work. Spent a good part of a day trying to force this when I could have been doing other things.

Thanks for the help bro.
 
Last edited:

skate323k137

Professional College Dropout
10 Year Member
Joined
Jan 7, 2013
Posts
4,210
Good way to go. Copy the image to a bigger target, and resize up once it's on there if you need to. Glad to "help" lol
 
Top