Page 1 of 1

Fixed size and already partitioned VHDs here!

Posted: Mon Aug 17, 2020 1:15 pm
by bootsector
So I was having several issues with VHD files created by VirtualBox. I've then followed the approach of using bximage for creating RAW bochs images, then cfdisk for creating a FAT16 bootable partition on them and finally qemu-img for converting from raw to vhd format.

Disk sizes available in zip package attached to this post are:

50MB
100MB
200MB
300MB
400MB
500MB
1GB
2GB

I've successfuly used the 50MB one to create a bootable Doom VHD based on FreeDOS, so I thought those would be useful to other people as well.

Cheers,

bootsector

Re: Fixed size and already partitioned VHDs here!

Posted: Mon Aug 17, 2020 1:25 pm
by Caldor
So these are fomatted images? I have had trouble compressing images, but I did have some data on them. They were Fat32 formatted though.

MiSTer seems to only support partitions and VHDs of up to 8gb... or a bit over 8000MB. Would be nice if such an image could be compressed effectively, as it clearly should not take up more than a few megabyte without data on it. I think I will experiment a bit since you got this working.

I create my VHDs using the Windows 10 disk manager and then I use FDISK from FreeDOS to partition them and format to format them.

Update: I compressed a raw 8032MB VHD (pretty sure you should not get issues with this size). I compressed it with 7zip and its 1.2mb.
8GB_Empty.7z
(1.18 MiB) Downloaded 485 times
This one is partitioned and formatted:
8GB_Fat32.7z
(1.18 MiB) Downloaded 447 times

Re: Fixed size and already partitioned VHDs here!

Posted: Mon Aug 17, 2020 1:35 pm
by ZigZag
When I ran fdisk on the latest release it seemed to support LBA. I was hoping that'd allow bigger VHD/HDD sizes.

Re: Fixed size and already partitioned VHDs here!

Posted: Mon Aug 17, 2020 1:38 pm
by uigiflip
seems to support only upto 8gb vhd

Re: Fixed size and already partitioned VHDs here!

Posted: Mon Aug 17, 2020 1:45 pm
by bootsector
Caldor wrote: Mon Aug 17, 2020 1:25 pm So these are fomatted images? I have had trouble compressing images, but I did have some data on them. They were Fat32 formatted though.

MiSTer seems to only support partitions and VHDs of up to 8gb... or a bit over 8000MB. Would be nice if such an image could be compressed effectively, as it clearly should not take up more than a few megabyte without data on it. I think I will experiment a bit since you got this working.

I create my VHDs using the Windows 10 disk manager and then I use FDISK from FreeDOS to partition them and format to format them.
These are only FAT16 partitioned. Not formatted.

Re: Fixed size and already partitioned VHDs here!

Posted: Mon Aug 17, 2020 2:04 pm
by Caldor
Ahh... I made a raw 8032MB VHD... I guess I should partition it as well then if that is not going to make the compressed file much bigger anyway.
ZigZag wrote: Mon Aug 17, 2020 1:35 pm When I ran fdisk on the latest release it seemed to support LBA. I was hoping that'd allow bigger VHD/HDD sizes.
uigiflip wrote: Mon Aug 17, 2020 1:38 pm seems to support only upto 8gb vhd
Yeah, pretty sure its a problem with the bios AO486 is using... or maybe its the core itself or a mix... but disks larger than 8000MB causes issues. I think all the sectors above 8064MB or close to that, wont work. So when I made a VHD that was exactly 8gb it means its 8192MB, which is about 100MB too big it seems, or 148mb? Well, does not seem much point to figure out the exact number, which is why I made my VHD 8032MB, just to ensure its within the supported capacity and wont get these bad sectors messing up the whole VHD.

Re: Fixed size and already partitioned VHDs here!

Posted: Mon Aug 17, 2020 3:59 pm
by Caldor
Ohh... found that a partioned and formatted empty VHD still compresses to being about 1mb compressed. I shared it in my first post.

Re: Fixed size and already partitioned VHDs here!

Posted: Mon Aug 17, 2020 5:33 pm
by bootsector
Caldor wrote: Mon Aug 17, 2020 3:59 pm Ohh... found that a partioned and formatted empty VHD still compresses to being about 1mb compressed. I shared it in my first post.
That's great! Thanks for sharing those!

Re: Fixed size and already partitioned VHDs here!

Posted: Tue Aug 18, 2020 12:56 am
by Fallon
I don’t get it. I copied one of these to mister, partitioned it in fdisk, formatted it on mister via msdos then copied it back to my windows 10 pc, added some games, copied it back to mister and the files cannot be seen on the vhd in mister.

I’m no dos expert, am I missing some setting when prepping the disk?

Re: Fixed size and already partitioned VHDs here!

Posted: Tue Aug 18, 2020 2:04 am
by Fallon
Fallon wrote: Tue Aug 18, 2020 12:56 am I don’t get it. I copied one of these to mister, partitioned it in fdisk, formatted it on mister via msdos then copied it back to my windows 10 pc, added some games, copied it back to mister and the files cannot be seen on the vhd in mister.

I’m no dos expert, am I missing some setting when prepping the disk?
* problem resolved, please ignore above post

Re: Fixed size and already partitioned VHDs here!

Posted: Tue Aug 18, 2020 6:26 am
by pgimeno
Caldor wrote: Mon Aug 17, 2020 3:59 pm Ohh... found that a partioned and formatted empty VHD still compresses to being about 1mb compressed. I shared it in my first post.
You can even recompress it for a ridiculous size.

Re: Fixed size and already partitioned VHDs here!

Posted: Tue Aug 18, 2020 3:20 pm
by Caldor
pgimeno wrote: Tue Aug 18, 2020 6:26 am
Caldor wrote: Mon Aug 17, 2020 3:59 pm Ohh... found that a partioned and formatted empty VHD still compresses to being about 1mb compressed. I shared it in my first post.
You can even recompress it for a ridiculous size.
woot? That works? I gotta try that.

It does work... pretty strange. I wonder if special 7zip settings would help making it this small in the first attempt. Maybe by increase the library or something.

Re: Fixed size and already partitioned VHDs here!

Posted: Wed Aug 19, 2020 4:48 am
by frozencities
Fallon wrote: Tue Aug 18, 2020 12:56 am I don’t get it. I copied one of these to mister, partitioned it in fdisk, formatted it on mister via msdos then copied it back to my windows 10 pc, added some games, copied it back to mister and the files cannot be seen on the vhd in mister.

I’m no dos expert, am I missing some setting when prepping the disk?
How did you resolve this? I'm having the exact same issue.

Re: Fixed size and already partitioned VHDs here!

Posted: Wed Aug 19, 2020 5:07 am
by Fallon
frozencities wrote: Wed Aug 19, 2020 4:48 am How did you resolve this? I'm having the exact same issue.

You can make your own VHD in disk management, basically create the VHD as fixed storage, allocate it's size, set it as MBR, but don't format it, or partition it, or create a simple volume.

Copy the VHD to mister then in MSDOS using "fdisk" command. Change to the drive with option 5 (I think), partition it as a primary, exit fdisk then use command "format d:"

Now copy it back to Windows, attach the VHD, select it, and open within disk management to add any files you want, then recopy back to Mister.


Then, get the shared folder working so you don't have to mess around copying VHD's back and forth over your network.

Re: Fixed size and already partitioned VHDs here!

Posted: Wed Aug 19, 2020 6:31 am
by Cebion
Or use the driver image disk after you formated and directly start misterfs to transfer files :D

Re: Fixed size and already partitioned VHDs here!

Posted: Wed Aug 19, 2020 7:47 am
by Caldor
Cebion wrote: Wed Aug 19, 2020 6:31 am Or use the driver image disk after you formated and directly start misterfs to transfer files :D
Yeah, this is a bootable floppy that has MiSTerFS, FDISK and FORMAT based on FreeDOS, so it can do all of this. Even has a file manager called Volkov Commander that can help copy files from the shared folder drive to your VHD.

http://dionysus.dk/software/DOS/AO486_floppy.7z
Boot this image and type "misterfs F" and you should get the shared folder as drive F, the shared folder will be created in the AO486 folder on your USB if a USB is used and otherwise it will be on the SD card.

But still, the files copied on the Windows computer to a mounted VHD should stay on that VHD. Not sure what causes this problem.

How is the drive mounted on the PC? I have used Windows 10s Disk Manager to mount and Daemon Tools as well for mounting the VHD and then transferring files to and from it. Especially when its more than even a few MB, its just way faster on the PC. Copying to the MiSTer over a network sometimes has a speed of just a few KB/s when running a core. That can probably be resolved cold rebooting the MiSTer to get it out of the core and / or use a faster dongle or a network cable with the MiSTer, but pretty sure it can be slow even using a cable.

Re: Fixed size and already partitioned VHDs here!

Posted: Sat Oct 10, 2020 3:55 am
by madelk
If you're having issues making a VHD you can try these commands in diskpart https://github.com/madelk/expandziptovh ... s.ps1#L158
You'll have to fill in the variables yourself for a path, size and a drive letter if you want to mount it right away

Re: Fixed size and already partitioned VHDs here!

Posted: Sat Oct 10, 2020 4:29 am
by flynnsbit
I do this:
Windows 10: Search for Disk --> open "Create and Format Hard Disk Partitions"
Action --> Create VHD
put it somewhere
Set the size to whatever you want 20MB-128GB
VHD
Fixed Size
Right click on the disk where it says unknown.
Initialize disk and select MBR
Right click on disk, new simple volume
quick format, again partition doesn't matter, fat, exFat, NTFS
Format it to whatever, doesn't matter as you are going to format again in next step
Close Disk Manager and the new File Explorer that might open up
Download http://www.ridgecrop.demon.co.uk/index. ... format.htm (Direct download: http://www.ridgecrop.demon.co.uk/guiformat-x64.Exe)
open guiformat-x64.Exe
Pick the drive you just formatted,
don't pick the wrong disk. Are you sure you have the disk you just created in the Drive section?
name the volume, click start.
Now you can transfer whatever you want to that vhd in windows and it will work in AO486. You can also use that VHD as an install target over in AO486, no need to fdisk it or diskpart it over there as long as you use an os that can handle Fat32. I suggest Dos 7.1 or Win98..

Re: Fixed size and already partitioned VHDs here!

Posted: Sat Oct 31, 2020 9:17 pm
by manni199
The max file size on a FAT/FAT32 formatted partition is 4GB, as far as I know.

So you should get problems copying a 8GB VHD to the MiSTer micro SD card.

Re: Fixed size and already partitioned VHDs here!

Posted: Sat Oct 31, 2020 10:39 pm
by flynnsbit
Nope, on the Mister the max FAT32 size is 137GB. I've tested filling a full vhd to the brim and all is fine as long as you stay away from the absolute limit. I keep mine at 130GB for the full AO486 packs. No issues what so ever as long as you format the vhd correctly.

Re: Fixed size and already partitioned VHDs here!

Posted: Sat Oct 31, 2020 11:24 pm
by aberu
manni199 wrote: Sat Oct 31, 2020 9:17 pm The max file size on a FAT/FAT32 formatted partition is 4GB, as far as I know.

So you should get problems copying a 8GB VHD to the MiSTer micro SD card.
FAT (aka FAT16) and FAT32 are very different. MSDOS 7.1 supports FAT32 natively. This enables it to use much larger drives. Windows 95 and 98 started using MS-DOS 7 under the hood.

FAT32 allows for 8TB drive sizes. However it only allows for a *file* size of up to 4GB.

Fat 16 has a max volume size of 4GB and max filesize of 4GB as well.
https://en.wikipedia.org/wiki/File_Allocation_Table

Now...

The MiSTer is not just in fat32. It also supports exfat which has no problem with these filesizes, unlike fat and fat32. Exfat has support for filesizes over 100 petabytes.

I'm pretty sure the sdcard installer and Mr fusion setup the root partition as exfat now.

The 137GB limit flynn's is mentioning above must be a limitation of MSDOS 7.x with regard to the vhd

Re: Fixed size and already partitioned VHDs here!

Posted: Sun Nov 01, 2020 1:17 am
by manni199
aberu
thank you for explanation.

So I remembered right that there ist a file size limitation 4GB in FAT16/32.
But I didn‘t know that exFAT is used for MiSTer SD card.

Re: Fixed size and already partitioned VHDs here!

Posted: Mon Nov 02, 2020 11:44 am
by Caldor
Yeah, I also use exFAT and yes, otherwise it would not be possible to use more than 4gb VHD files. Now AO486 supports... what is the new limit? 136gb maybe? Its pretty high, that is for sure. I think I have made a 32gb partition for someone.

Re: Fixed size and already partitioned VHDs here!

Posted: Mon Dec 14, 2020 7:48 pm
by Caldor
Bump since its a useful thread

Re: Fixed size and already partitioned VHDs here!

Posted: Mon May 01, 2023 5:13 pm
by zorik

I don't know what compression was used but I was able to compress all VHDs with 8GB vhd in a 4kb 7z file! :D by putting 7z inside a 7z :)


Re: Fixed size and already partitioned VHDs here!

Posted: Tue May 02, 2023 7:05 pm
by Bas

These are mostly empty, as in 99.9999% zeroed bytes. 7zip compressed those like there's no tomorrow.