Hacking How to store an Wii ISO images on ext2/ext3 (Linux file system)

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
How to store Wii ISO images on ext2/ext3 (Linux file system)

This little article explains how to store WII ISO images on an ext2/etx3 file system in an efficient way without compressing.


1. What is ext2/ext3

ext2 is a file system like FAT or NTFS but developed for Linux. ext3 is ext2 with journaling extension. Both are the native file systems for Linux. ext2 and ext3 are handled by the same driver.


2. What are the features of ext2/ext3

Max file size: 16 GiB - 64 TiB
Max number of files: 10^18 = 10.000.000.000.000.000.000
Max filename length: 255 characters
Max volume size 2-32 TiB
Allowed characters in filenames: Any byte except NULL and '/'

For more features see: http://en.wikipedia.org/wiki/Ext2


3. Sparse files


The ext2 file system can handle sparse files efficiently. "Sparse files" are files with large blocks that contains only zero-bytes. For complete zero blocks there is no need a reserve a disk block. So you can save disk space.

And this is the advantage for a Wii ISO image dump: Fill the unused sectors within the ISO with zeros and make a sparsed copy. This is sometimes called as scrubbing, but the Wii-Scrubber software is useless because it fills the ISO image with 0xFF.


4. How to build a sparse file


As mentioned before the Wii-Scrubber software fills the unused sectors with 0xff and that is useless for sparsing.

But most of WBFS-Manger do it right! They using the fsetpos() function to skip unused blocks. And the files system driver of ext2/ext3 will insert sparse blocks.

Under Linux you can use the wbfs Tool (search 'wbfuse') or the wwt tool to scrub a ISO image in the right way. Just copy the ISO image to a WBFS file system and back. Linux can build a WBFS file system as a single file:

Code:
#----------------------------------------------------------------------
# assuming that 'wwt' is in the path, e.g. /usr/local/bin/wwt
# if not: /use path_to/wwt or ./wwt
#
# wwt tool: http://gbatemp.net/index.php?showtopic=182236#entry2286365
#----------------------------------------------------------------------

# create a 10 GB WBFS file as sparse file itself
wwt format --force --size 10G a.wbfs

# copy an iso image to wbfs
wwt -p a.wbfs add __THE_ISO_FILE__

# extract a wbfs image to iso
wwt -p a.wbfs extract __THE_ID6__

# check results ( -s => the first number shows the disk space )
ls -lsh


If yo have already an ISO image filled with zeros but not sparsed, you have to copy the ISO image with a sparse option. Examples:

Code:
cp --sparse=always SOURCE.iso DEST.iso
cp --sparse=always -r SOURCE_DIRECTORY DEST_DIRECTORY

rsync --sparse SOURCE.iso DEST.iso
rsync --sparse -ra SOURCE_DIRECTORY/ DEST_DIRECTORY

5. Is there a Windows driver for ext2?


Yes: http://www.fs-driver.org/
And a good message: It will handle sparse files too.

To format an ext2 partition under Windows you have to buy a professional disk manager. Better and easier is to format with a Linux live system like Knoppix.

While formating be sure to set the inode size to 128 bytes!
 

mousex

Well-Known Member
Member
Joined
Jan 23, 2009
Messages
986
Trophies
0
XP
115
Country
United States
There is a German "und" still in your text. This happens to me very often, too
tongue.gif
(Any Bytes except NULL und / )
Nice hint about the sparse files, will test if HFS+ has similar features.
EDIT: Well, it has not
tongue.gif
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
A little ego trip
wink.gif


It's nice to see, that this old theme about sparse files is hot. At the beginning I stored all ISO as sparse files to save disc usage. To inform you about this I opened this thread. Later on I developed WDF and it supports WDF, a way to store ISO effectively without sparse holes. And handling of WDF files is much easier than handling of sparse files. All my backups are stored is WDF.

And some month later I found out, that NTFS also supports sparse files:
Wiimm said:
A good message for Win/NTFS users:
I have played with the newest cygwin version to prove the functionality. And what did I found?

NTFS supports sparse files too!

When creating a WBFS or extracting a raw ISO file from a small game the disc usages is much less than the file size. But when copying the ISO this advantage is lost. This means: WDF is still the best solution for storing ISO images.

And now many windows people talk about this previous unknown feature.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    ZeroT21 @ ZeroT21: No way, Switch pro will be next