Hacking WBFS defrag

  • Thread starter Thread starter PsyBlade
  • Start date Start date
  • Views Views 11,487
  • Replies Replies 71

Would you like to have a WBFS defrag util?

  • Yes

    Votes: 38 71.7%
  • No

    Votes: 15 28.3%

  • Total voters
    53
This discussion made me go back to WBFS. It was really funny! I formatted my NTFS partition using wwt format, it worked. Then I clicked on that partition, all the games and directories are there*. I'll copy all the games back to wbfs partition tonight. I used a really fast tool to convert to fat from wbfs, so I can use that again, If I need.

Psyblade, wouldn't a tool for ntfs to fat be better? Some place is selling that for ~$23.

Oh, yes I will test your said program on ubuntu, if you develop it.

*it was just fluke that I did not know, that disappeared right after unplug/plug.
 
Psyblade, wouldn't a tool for ntfs to fat be better? Some place is selling that for
I really doubt many people will want to convert from ntfs to fat32.
Besides I don't think my hobby projects are polished enough to compete with professional stuff.
If they really want to do that they are much more likely to use a well tested tool.
They have been around for over a decade after all.

I don't want to reinvent wheels anyway,
I want to explore the roads less travelled.
 
Because of the fragmentation discussion, I have implemented some statistic stuff into my tools (coming with next release). I have thought about a ratio and this is my solution:

  1. Optimal is one fragment for each disc. Each additional fragment (or each break) is bad.
  2. The second important value is the size of the disc image (calculated by number_of_wbfs_blocks * wbfs_block_size)
  3. My definition: ratio := ( fragments - 1 ) * 1GiB / size
    (1GiB := 1024*1024*1024)
  4. I will always print the ratio with 2 digits after the comma.

Examples:
Code:
Image size  fragments   ratio
in GiB
--------------------------------
1.0          1        0.00
4.0          1        0.00
--------------------------------
1.0          2        1.00
4.0          2        0.25
--------------------------------
1.0         11       10.00
4.0         11        2.50
--------------------------------

For a weighted average ratio of a complete WBFS I do:
  1. n_img := number of images
  2. n_frag := total number of fragments
  3. total_size := total size of all images
  4. ratio := ( n_frag - n_img ) * 1GiB / total_size
    This is principal the same calculations as above.

And this is the summary of my WBFS drive:
* 4 of 50 discs are fragmented, weighted ratio = 0.06

I have formatted this drive in the last year and because of Custom Mario Kart development I have done hundreds of replacements (0 to 4 experimental images are held by my drive at same time).


@PsyBlade: If you still plan to implement your tool, please think about my calculations.
 
i dont think you need to keep adding games and removing them to get a fragmented drive. you can just change the part of the libwbfs code that says "GetAnUnusedBlock()" (or whatever its called) and make it return any random free block. Then each game you install will be heavily fragmented. and then you can do some real world tests to check loading speeds and stuff to see if fragmentation really matters.
 
Giant, you misunderstood me. That's my businesses and testing drive and in his live time it has hundreds of replacing, because I make a new image every view days if new custom tracks are available. When I develop a custom track, there are multiple replacements per day.

For tests with fragmentation I use the "wwt PHANTOM" command. It adds many phantom disc with one command. Because only the headers are written, it is very fast.

Example: wwt -a PHANTOM 3-5x1-9
Create 3-5 discs (random decision), each with a random size between 1 and 9 GiB. The names are generic and begin with 'PHT'.

But the idea with a random block selection is nice, if really needed.
 
@PsyBlade: If you still plan to implement your tool, please think about my calculations.
I still want to do it but unfortunatly my computer is not really funktional atm.
Whats worse is that I can't really do something about it myself.
I have to wait for someone else to finally release his repair tool (which drives me mad)

It may take some time till I can work on this again
 
I love my wbfs drive , I think I tried the fat32 awhile ago and couldnt figure out how to split the image lol , ( so call me lazy ) but it works great on my 1TB drive..... the only thing I dont understand with WBFS is this , when I copied the games over from a 500GB drive to the 1TB drive the size of the games increased , can anyone explain why this is ? what I mean is , in the 500GB drive the game might have been say 1GB but on the new drive that same game is now 1.1GB or something to that effect
 
I love my wbfs drive , I think I tried the fat32 awhile ago and couldnt figure out how to split the image lol , ( so call me lazy ) but it works great on my 1TB drive..... the only thing I dont understand with WBFS is this , when I copied the games over from a 500GB drive to the 1TB drive the size of the games increased , can anyone explain why this is ? what I mean is , in the 500GB drive the game might have been say 1GB but on the new drive that same game is now 1.1GB or something to that effect

It has to do with the blocksizes. the blocks are bigger on wbfs, and if a block is only partial filled it will show as full. Therefore files can take a bit more space than on say fat32. Simple explained...
 
It has to do with the blocksizes. the blocks are bigger on wbfs, and if a block is only partial filled it will show as full. Therefore files can take a bit more space than on say fat32. Simple explained...
additionally the blocksize of a wbfs partition is dependent on drive size (linear steps)
bigger partition -> bigger blocks -> more wasted space
 
Here are some examples for the occupied space. You see the differences for different sized WBFS:

Code:
# wit isosize -ll pool/wdf/

ISO  ISO .wbfs 500g   3t
blocks  MiB  file WBFS WBFS  filename
-------------------------------------------------------------------------------
91160 2849  2854 2864 2944  pool/wdf/mkw.wdf
233469 7296  7304 7320 7552  pool/wdf/ssbb.wdf
35134 1098  1104 1120 1280  pool/wdf/tlz.wdf
101364 3168  3174 3184 3328  pool/wdf/tra.wdf
774   24    30   48  192  pool/wdf/wch.wdf
4292  134   140  152  320  pool/wdf/wmu.wdf
5416  169   174  192  320  pool/wdf/wpl.wdf
20222  632   638  648  768  pool/wdf/wsp.wdf
-------------------------------------------------------------------------------
Total: 491831 blocks (15370 MiB = 15 GiB) in 8 files
 
WBFS is obsolete. Move on to fat32 or NTFS. Move along here people, move along...


It may be obsolete for the average user, yes. But to say its obsolete as a whole is just wrong. It clearly has its benefits for pure wii-related things.
 
I happen to like my wbfs , the only think I dont like is the fact that , a game saved to my 500GB would equal say 1 GB , but when I moved that same game over to the 1 TB drive that same game now takes up 1.1GB .....If I were to change to NTFS how long would it take , and is it really worth it ?
 
If I were to change to NTFS how long would it take , and is it really worth it ?

With ntfs you would gain the ability to store normal files (for use on other devices) and to play music and video from it on your wii.

Fat32 can in addition to that be used to run programms from hbc and store emulator roms for wii use... , basically every wii program that uses usb storage supports it.
Filesize woud be capped at 4GiB but that does only matter if you want to use it for purposes other then the wii.


There are two ways to switch fs copy or convert:

Copy is easy to do, but will reqire free space and time (in the order of 2x500GB/50MB/s = ~5.5h).

Convert is done in a few minutes but is a little bit more complicated.
You would need to use wbfs2fat (sig) to convert it to fat32 and then use microsoft "convert" (included in windows) for ntfs.
See my tutorial for details.
 
FAT32 has another advantages over NTFS though. It works on pretty much any PC in the world, regardless of what OS its running. So compability is a lot higher than with NTFS.
The only advantage of NTFS for the average user is the ability to store files >4GB.

Personally I see no reason to run a full NTFS partition on an external. Compability is far more important for me :) (but then I travel a lot between different computers and OS's)
 
NTFS, FAT or WBFS is a decision, that each pone must do for himself.

My private example: I have a 500GB drive. The first 150G are FAT and the second WBFS. The usage is about 1GB on FAT and 100GB on WBFS. There is enough place for all my needs on both partitions.

One FAT or NTFS partitions seems good for drives which are almost full, because you must not plan the usage on formatting. But generally full partitions tends to be fragmented. And so it's maybe better to estimate the WBFS and other usage and find a good size for a splitted drive. But the best choice (for all computers!) is to have always enough space an each drive. And so make the FAT large (2x the calculated size) and if your WBFS becomes full, swap out some (temporary) unneeded games.
 
I don't see why anyone wants wbfs, a file format not recognized on any computer without a program.
Fragmentation which being discussed in this topic, unable to be defragmented.
fat32 - Can be defragmented and be used on any operating system
ntfs - Faster but can only be used on Windows.

Not to mention if you have 2 partiitons, one wbfs and one fat32. Then one of them gets full, you have to resize partitions so you can keep on adding.
Keeping it all fat32 makes managing space a lot easier.

Look at it this way:
WBFS / Fat32
Defrag Support - No / Yes
ISO Compression - Yes / Yes
Windows/Mac/Linux Support - No / Yes - Without additional programs
Games Per Partition - 500 / Unlimited
I don't know if changing the sector size is supported in WBFS but changing the sector size in FAT32 is supported and can either save space or improve transfer rate.
WBFS really isn't supported anymore, its less stable, and relying on some program to transfer your files that may crash and corrupt files.

Which is why I said WBFS is obsolete. It pretty much is.

http://gbatemp.net/topic/218212-wbfs-vs-ntfs/
http://gbatemp.net/topic/267480-wbfs-vs-fat32/
A poll
http://gbatemp.net/topic/254071-poll-wbfs-wbfs-with-fat32-partition-fat32-or-ntfs/page__mode__show
 
  • Like
Reactions: 1 person

Site & Scene News

Popular threads in this forum