Hacking USB Loader Fragmentation

raptor5001

Well-Known Member
Newcomer
Joined
Aug 4, 2006
Messages
58
Trophies
1
XP
370
Country
United States
Ext2 would be preferred because we definitely don't need any journaling capabilities if we're not constantly writing to the disk.

With a quick look at the source code, it seems that WBFS does NOT fragment its files, so there is no need for a defragger. It does this on purpose, because the data for the file needs to be contiguous when loading it. Possibly, there is a need for a compactor, though. (Smush all files together to eliminate gaps of free space.) But the problem is that keeping contiguous files can result in wasted space:

ex1.png


In this case, a user has 4 files on his hard drive. He deletes file B. Then he adds file E. Space is wasted (unless he adds a file that can fill that space, but this is never a guarantee).

Regarding corruption of games, maybe there's a problem checking free space, which would cause this problem: Just a wild guess.
ex2.png


I don't feel like looking into the source in depth right now, because it's 3 am here; goodnight!

EDIT: My wild guess was just that. The second image is not correct. Turns out the delete function for a game would free the game's space and a bit extra, causing corruption of other games.
 

chr0m

Well-Known Member
Member
Joined
Oct 9, 2007
Messages
342
Trophies
1
XP
959
Country
Australia
Wiisel said:
i found out the hard way added 10 games delete 2 and added another 44 behind them all from disc, now i have corrupt games and wasted the day dumping discs.
now i have to start again unless this issue is fixed i suggest adding games to your hdd only after pre testing on a pendrive.

I added 110 games and had deleted some earlier, so now I have to reformat and start again. I wish I found this out before I spent yesterday loading up the hdd
frown.gif

Is there a quick way to find out which games are corrupted? At least that way I could extract all the working ones to PC and then redump from in a batch rather than going through all my dvds one by one again, that would be painful.
 

Wiisel

Well-Known Member
Member
Joined
Dec 4, 2008
Messages
1,309
Trophies
0
Website
Visit site
XP
333
Country
if you have space to have space for 110 4.37gb games on your pc you can load each game with the loader and remove any that say they are corrupt or dont boot then batch the rest out. as far as i know after deleting your ok aslong as you dont add anymore it may be safer to extract the lot then test before putting back the good ones sadly i stole my spare storage drive for the wii so this isnt an option for me.
 

Predator04

Well-Known Member
Newcomer
Joined
Oct 17, 2007
Messages
74
Trophies
0
XP
184
Country
United States
i have a 80gb hhd and i can load a delete just fine. no corruption. maybe the hhd your using suck? or old? or use a power source? ( not sure why that would do anything)
 

denzil

Well-Known Member
Newcomer
Joined
Jun 11, 2008
Messages
88
Trophies
0
XP
11
Country
United States
Stang said:
will the HDD's we use for the USB Loader become fragmented just as our ordinary computer HDD's do (I assume so)?
The "WBFS" does not know "fragments", it has neither concept nor support for files, let alone fragments.

Edit: Either I initially mis-read the source, or this changed between 1.0 and 1.1, but when looing at the 1.1 source, full disk-size chunks are not allocated (anymore). However, the argument regarding fragmentation stands. WBFS does not know fragments.
 

tj_cool

Site dev
Supervisor
Joined
Jan 7, 2009
Messages
10,064
Trophies
2
Location
This planet
XP
3,105
Country
Belgium
denzil said:
Stang said:
will the HDD's we use for the USB Loader become fragmented just as our ordinary computer HDD's do (I assume so)?
No, it won't. It can't. The "WBFS" does not know "fragments", it has neither concept nor support for files, let alone fragments. All it does is divide the HDD into chunks the size of a double-layer Wii disk. If you "delete" one of those chunks it can be re-used by another image since they are all the exact same size.
Where did you find that info?
My USB stick is only 1GB and I can perfectly place 2 (small) games on it
Size of dual-layer disc = 9.4GB
 

denzil

Well-Known Member
Newcomer
Joined
Jun 11, 2008
Messages
88
Trophies
0
XP
11
Country
United States
Upon re-reading the source, I stand corrected. See my edited post above. Thanks for pointing out my error.
 

raptor5001

Well-Known Member
Newcomer
Joined
Aug 4, 2006
Messages
58
Trophies
1
XP
370
Country
United States
FenrirWolf said:
The 2nd scenario is what currently happens. The idea of a "compactor" is an intriguing one and I hope something like that can be made...

While a good theoretical idea, the problem comes from moving gigabytes and gigabytes of data. It would take forever, and is error-prone if not done exactly right. Of course, I guess it would be faster for some rather then formatting and re-adding every game.

Implementing a file system such as ext2 which has a fragmentation system, but also has a good file allocation system so as to eliminate the need for a defragger (you'll never find a defrag program on Linux) may be a solution. But I don't know if the loader can handle files being fragmented, since reading fragmented files is much slower. Also implementing a real file system would be more work than just the basic code used now. *shrug*

Of course, another (bad) solution is to force every game to take up 4.7GB, regardless of the packed size. That way, there's no free space issues when deleting and then adding files. But that's worse than just taking up the next available contiguous space.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: Att is displaying prices like it's an ingredients list now lol