The Wii contains 512 MiB of NAND flash storage, which is used to store "system software", channels (including Virtual Console titles), game saves, and system settings.
The NAND flash device is divided into 4096 blocks of 8 clusters. Each cluster is 8 pages. Each page is 2048 bytes of data and 64 bytes of "spare data" (used for error-correction (ECC) data and HMAC signatures on individual clusters).
* Block 0 (pages 0-0x3F): boot1** boot1 is the second-stage bootloader; it is decrypted by boot0, which resides on a read-only mask ROM inside the Starlet coprocessor. Its primary function is to load and decrypt boot2.
** Block 0 is guaranteed by the manufacturer to be valid, so there is no bad block map necessary.
* Blocks 1-7 (Pages 0x40 - 0x1ff) : boot2 (two copies and blockmaps)
* Block 8 / Cluster 0x40 / Page 0x200: beginning of per-console unique data
* Clusters 0x40 - 0x7EFF: Encrypted filesystem data. Data is encrypted with a per-console AES key, and then signed with a (separate, per-console) HMAC key.
* Clusters 0x7F00-0x7FFF: Filesystem metadata (SFFS, unencrypted). There are 16 superblocks contained therein
-- one every 16 clusters.
== Metadata layout ==
Each metadata "superblock" starts with the 4 magic bytes "SFFS", followed by a 4-byte "generation number" and another 4-byte number (always 0x10?). When accessing the FS, IOS will choose the superblock with the highest generation number and use it; whenever it modifies the filesystem in any way, it will increment the generation number by 1 and write out an entirely new superblock in the next slot (in round-robin order).
The next 0x10000 bytes (bytes 0xc:0x1000c within the superblock) are 0x8000 2-byte cluster numbers, and comprise the FAT. The FAT is followed by the FST
-- the tree structure containing the directory hierarchy and (plaintext!) filenames.
=== FAT ===
The FAT contains cluster chain / allocation information for the entire NAND chip, including parts of it which are not technically part of the filesystem!
The first 64 entries will always be 0xFFFC, which indicates that this cluster is "reserved". These correspond to the first 64 clusters or 8 blocks
-- which is where boot1 and boot2 are stored.
Special values include:
* 0xFFFB - last cluster within a chain
* 0xFFFC - reserved cluster
* 0xFFFD - bad block (marked at factory)
-- you should always see these in groups of 8 (8 clusters per NAND block)
* 0xFFFE - empty (unused / available) space
file access "mode" -- if bit 0 is set , this is a regular file ( leaf node) and not a directory