Page 1 of 1

VMU free blocks - Free vs Game and defrag curiosities

Posted: Sun Apr 30, 2023 1:53 am
by edenist
I've been messing around with my VMUs and looking into the technical specifications. I noticed that in the File management page it lists "Free"
and "Game", with the corresponding blocks free. In a VMU with a fresh filesystem, it lists Free: 200 and Game: 128.

The maximum size of a VMU game is 128 blocks, but I was curious about there being a separate field. As the VMU fills up with game saves, though, the Game field will drop below 128 even if there is more than 128 blocks free.
For example, I had Free: 90, Game: 32 at one stage. This piqued my curiosity.

I couldn't find any discussion about this elsewhere, but based on the fact that the VMU flash storage uses a FAT filesystem [which is nicely documented in various places and explains where the extra 40 blocks come from if enabled], I have assumed that a game install requires a contiguous number of blocks to install to, and thus the value of "32" means there is a section of the FAT storage with 32 blocks free, but other areas are fragmented. Even further, does this 128 blocks perhaps need to be at the very beginning or end of the filesystem? Based on the limited resources of the VMU, having a statically defined address to run code from would make sense.

I've got VMU explorer which of course has a defrag function, but I haven't used it yet. But interestingly, I tried installing the mini game from sonic-adventure 1 with Free: 130 Game: 52, and it did succeed in installing the game. It did take quite a while longer to install than anticipated, which makes me wonder if SA1 [or any other games] perform their own defrag if necessary?

Re: VMU free blocks - Free vs Game and defrag curiosities

Posted: Sun Apr 30, 2023 6:38 pm
by BlueCrab
Yes, the game blocks are in one specific part of the filesystem (I believe at the beginning). Game saves usually go at the other end of the storage, and yes, it can get fragmented if you end up deleting saves often.

Re: VMU free blocks - Free vs Game and defrag curiosities

Posted: Tue May 02, 2023 8:06 am
by edenist
Thanks for confirming that. That make sense, in particular having save blocks start at the end. I'm quite curious now about SA's defrag ability, and wonder if any other games do the same thing or perhaps just the large ones [SA uses the full 128 blocks].
Given some reports of data corruptions with the implementation in VMU explorer I wonder if there are differences in how it is done.

Investigations on that matter shall continue :-)

Re: VMU free blocks - Free vs Game and defrag curiosities

Posted: Tue May 02, 2023 4:07 pm
by TapamN
I remember from one time back in 2001, that SA2 does NOT defrag the VMU, and displays an error message if there's not enough contiguous room for Chao Adventure 2.

Re: VMU free blocks - Free vs Game and defrag curiosities

Posted: Tue May 02, 2023 6:59 pm
by OlivusPrime
It's funny you should mention this - this evening, I tried defragmenting my VMU through VMU Tool, as I couldn't work out what the "game" blocks on it were being used for and wanted to see if they would clear.

Turns out, it was a bad idea, and I would NOT recommend defragging through VMU Tool. It effectively "offset" all of the saves on the VMU, corrupting some and making others outright disappear.

Luckily, after some fiddling, it seems like my Worms World Party save was the only one that was deleted entirely (the data was there, but no applications on the console could recognise it as a save file), but I haven't yet found out if some of the other remaining files have been adversely affected.