Understanding the directory structure

From GCW Zero Wiki
Jump to: navigation, search



This page intends to document the internal structure of the GCW Zero file system. If you seek information about installing new OPK files, consult the "Installing new software" section instead.

If you are only interested in the directory navigation, you can skip right into Chapter 2.

Internal partition table

               First       Last
 # Type       Sector      Sector   Offset    Length   Filesystem Type (ID) 
-- ------- ----------- ----------- ------ ----------- -------------------- 
   Pri/Log           0       32767      0#      32768 Free Space           ← master boot record + bootloader
 1 Primary       32768      819199      0      786432 W95 FAT32 (0B)       ← system partition
 2 Primary      819200    62552063      0    61732864 Linux (83)           ← data partition

(NOTE: Partition sizes may vary based on the internal microSD card capacity and firmware version).

GCW Zero keeps its data on an internal microSD card. The card is divided into four sections:

  • Master Boot Record (MBR) - space containing information about the bootloader location
  • bootloader area - space designated for the bootloader binary
  • System partition - space designated for the Linux kernel and Root File System
  • Data partition - space designated for custom user data (OPK files, ROMs, images, etc.)

Boot process

When starting your GCW Zero, the following happens (in a simplified form):

  1. MBR space is read and bootloader is loaded into the memory.
  2. Bootloader parses the system partition and loads the kernel into the memory.
  3. The kernel initializes all the essential processes required to communicate with the hardware, then the Root File System is mounted as the top of the directory structure and with read-only access.
  4. GMenu2X menu system is launched and it begins to scan for OPKs in the /apps/ folder on the internal and (if available) external microSD card and makes them visible in the menu.

GCW Zero directory structure

When navigating through a file browser on the GCW Zero, it is essential to understand its directory structure. The below information will attempt to clarify relations between the directories on this device.

directory description
/ The root (top-most) directory, this is the mountpoint of the Root File System. This space remains read-only.
/media/ The directory gathering all the user accessible partitions. This is where you will find mountpoints to the data partition and external microSD card partitions (/media/ directory itself remains read-only).
/media/data/ Mountpoint of the internal microSD data partition.
/media/{card_name}/ Mountpoint of the external microSD card. If your card has no partition label, it will be visible as /media/sdcard/.

The /media/ directory also contains two extra folders, which are both symlnks (a form of shortcut) into locations inside the data partition, displayed in /media/ for the comfort of navigation:

directory description
/media/apps/ Symlink to /media/data/apps/, a directory in which to place OPK files. For details on OPK installation, read: Installing new software.
NOTE: No other files should be put in this directory or its subdirectories, as it might substantially delay GMenu2X launch time (even up to several seconds!).
/media/home/ Symlink to /media/data/local/home/, a directory where OPK applications keep their config files, save states, etc.

The /media/data/ directory remains read-write and is designed as a storage space for any custom data the user desires to keep (with the exception of /media/data/apps/, mentioned above).


/media/data/         → internal microSD card's data partition
/media/{card_name}/  → external microSD card partition
/media/apps/         → symlink to /media/data/apps/
/media/home/         → symlink to /media/data/local/home/
/media/system/       → internal microSD card's system partition (read-only)

Directory structure through FTP connection

While connecting to GCW Zero via an FTP client (such as GCW Manager or FileZilla), the device exposes it's /media/ directory as a the top-most visible directory. As a result, the following directories will be shown when the user connects over FTP:


The above structure corresponds to directories found inside /media/, as visible when browsing the filesystem directly on the GCW Zero.