Reply 80 of 85, by Serious Callers Only
Speaking of this i've tried to make a way to transfer windows 95 and 98 to a bigger or smaller disk (like certain universities are able to image a OS into a networked machine), but i've failed.
https://gist.github.com/99215a27097594d4e3f50bdc8f8fe8ad
I tried this, using the mtools package and parted, and i previously tried to use the 'non-free' version ms-sys tool (the commented part, of which i tried 2 variants, forcing it on the image file or forcing it on the first partition after mounting which requires sudo) to recreate the MBR, but nothing works.
Do you people have any idea how to work this, specifically clone a existing bootable win95/98 disk image into a larger or smaller new disk image? Normal drives ofc transfer fine with mtools using the trick of placing a 'custom config file' in a environment variable to mount the old image and the new image as mtools 'drives' and copying them over with permissions (this is needed because nuking the actual file is impolite and because there is no way to specify 2 hard disk images as source and destination in the mtools copy command otherwise, though there is a way for the destination hdd image).
I suspect the failure here is because the MBR or first sector must point to a specific hardcoded file or set of files which mtool mcopy doesn't allow to place precisely.
It's already useful, to transfer files to/into a smaller or larger disk image without using dosbox or windows fallible copy tools or using the native linux fat support (which doesn't preserve DOS attributes and requires root and skipping the MBR if any, which is complicated as heck), but it feels incomplete without the capability, though i might just bail out in bootable hard disks if it can't be made to work.
I'd also probably add the capability to copy over a linux dir into a new hard disk image, for the 'install in wine, run in dosbox' usecase to avoid all of the cases where the user has to understand how to natively mount a dosbox image even if i show how.
The script is linux only ofc.