Well. I guess I didn't. It was an image that was supposed to be for a Windows 95 hard drive for a VM I'm using. I just would like to know how to shrink its size so I can put it inside an application I'm making for portabilityHow did you create this file?
This sounds complicated. Sorry, I forgot to mention I could use WSL. Is there a simpler way to decrease the .img file's size that way?Incomplete solution (haven't tested backup of mbr myself):
Ok - the hard step for a non-Linux user is to backup the MBR. some sources on web:
- Get Gparted (bootable iso file, 32bit variant).
- Attach the ISO-file to the VM (should boot from it without user need to manually alter boot order)
- Make copy/backup of the img file!
- When Gparted is running, use that to manually shrink size of the partition. This will probably not alter the img file itself as it reflect the size of a physical disk, so further steps is required.
- In VM (when no OS runs) - create a new img file. This must be big enough so that the OS can actually run.
- Get a clone tool - I tend to use Clonezilla (32bit preferably in your case) (also bootable iso file)
- Boot VM where Clonezilla is attached to CD drive and BOTH img files attached to VM.
- Start the process of cloning from one partition to another (boot sector not included)
https://tecadmin.net/drive-and-partition-backup-examples-with-dd-command/ See bottom of the page.
Other online suggestion goes toward using the UBCD toolkit to restore MBR, if this works for W95, I don't know.
A Win95 HDD image should absolutely not be "2GB"I have a .img file that has about 100mb of files in it, but the total size of it is 2gb. How can I shrink its size in Windows down to ~100mb?
I realize that. I got it from this guide: https://www.vogons.org/viewtopic.php?t=17324. I'm running Windows 95 on DOSBoxA Win95 HDD image should absolutely not be "2GB"
2GB drives did not exist at that time.
Something is wrong, with either the source, or your unpacking process.
OK, so what actual problem are you running in to?I realize that. I got it from this guide: https://www.vogons.org/viewtopic.php?t=17324. I'm running Windows 95 on DOSBox
I'm simply trying to shrink the size of the .img file to less that 2GB, so it can be more portable for this application I'm making. I think it would be silly to have to download a 2GB file that could be a lot lessOK, so what actual problem are you running in to?
So it is 2GB at the place where you get it from?I'm simply trying to shrink the size of the .img file to less that 2GB, so it can be more portable for this application I'm making. I think it would be silly to have to download a 2GB file that could be a lot less
Yes. I know, but there has to be something I can do, right?So it is 2GB at the place where you get it from?
You can't just arbitrarily 'shrink' that to smaller.
Especially down to a mythical 100MB.
You need to determine why it is ending up as 2GB.Yes. I know, but there has to be something I can do, right?
Awesome. When I got to ghost, I just pressed disk, then to disk, and it worked perfectly. Thanks!You can make a second disk image with dosbox-x you just have to go to the "DOS" menu, and select "Create blank disk image…" it is limited to some pre set sizes with the smallest being 250Mb.
If you want better control of the size you will need to download bochs and learn how to use bximage.
After you have your second image you mount it to D, or whatever letter you like, then you run fdisk to create a primary main partition on that image.
Lastly you would use a cloning tool like norton ghost to copy everything over and then the second image would be the same as the first other than the size.