Why Partition Internal Devices?
Partitioning internal storage devices provides a several benefits, including:
- separation of system software, user installed software and user data
- selection of file systems used optimized for each task
- the ability to use a combination of read-only and read-write file systems.
The file system type, size and number of partitions used in a device depends on several factors and can be restricted by the underlying hardware. For example the jffs2 file system is only supported on mtd block devices.
Other factors that determine the file system type include:
- whether the contents change frequently
- how robust to corruption does the file system need to be
- does the contents need to be retained over reboots
- is there a performance or cost benefit in compressing the data?
System software changes infrequently and can be efficiently stored in a compressed read-only file system such as cramfs or squashfs. Read-only compressed file systems have better compression than compressed read-write file systems and are typically optimized for decompression performance. Additionally read-only file systems are less susceptible to corruption.
Journaling file systems, such as ext3, are more robust and less susceptible to corruption that file systems without journaling. However, there is a performance penalty for maintaining the journal.
RAM discs are typically used for temporary storage, they eliminate the need for an extra read-write partition and do not contribute to write cycles to internal flash.
The size of each partition is determined by the expected size of it contents and whether additional space should be reserved in each partition for future software expansion.
The size of user-data partitions is dependent on the targeted use case of the device. For example, low-end phone devices with limited address book and message data would need only a few MB of space allocated for the User Documents and Settings partition. Whereas a Media Playback device would typically have a User Documents and Settings partition in excess of 1GB for storing media files.
Typical Partition Layout
A typical Qt Extended device contains the following partitions:
Contents | Path | Size | Mode | File System |
System Software | / | less than 10MB | read-only | cramfs |
UI Software | /opt/Qtopia | greater than 20MB | read-only | cramfs |
User Documents and Settings | /home | at least 5MB | read-write | jffs2, ext2, ext3 |
Temporary Storage | /var | 500KB | read-write | tmpfs |
Temporary Storage | /tmp | 0 | symbolic link to /var/tmp | tmpfs |