Been studying file systems over the past two weeks—just taking some notes.
01
ext4
Features: Supports large capacity (single file up to 16 TiB, total up to 1 EiB), journaling, high stability.
Use cases: Yocto root file systems, Android’s /system partition, general-purpose storage.
Pros: Highly reliable, suitable for applications requiring large data storage and fast access.
Cons: Less optimized for special storage media like flash compared to dedicated file systems.
02
SquashFS
Features: High compression ratio, read-only, fast mounting.
Use cases: Yocto firmware images, read-only root file systems (like /usr), container images.
Pros: Saves space, ideal for scenarios requiring minimal storage footprint.
Cons: Read-only nature limits use in applications needing dynamic content modification.
03
UBIFS
Features: Optimized for NAND flash (bad block management, compression), dynamic partition resizing, journaling.
Use cases: Read/write flash storage on ARM embedded devices (IoT devices, industrial control systems).
Pros: Flash-specific design offers good wear leveling and reliability.
Cons: May not suit non-flash media compared to more general-purpose file systems.
04
JFFS2
Features: Directly operates flash blocks, power-loss protection, supports NOR/NAND flash.
Use cases: Small flash partitions (bootloader, kernel), read/write partitions on low-power devices.
Pros: Simple and efficient, ideal for small embedded systems.
Cons: Performance may degrade as flash size increases.
05
tmpfs
Features: RAM-based ultra-fast read/write, dynamically resizable.
Use cases: Temporary caches (/tmp), process shared memory, runtime temp data storage.
Pros: Extremely fast due to RAM storage.
Cons: Non-persistent—data lost on power-off.
06
FAT32/vfat
Features: Cross-platform compatible (Windows/Android/Linux), supports UEFI boot.
Use cases: Android external storage (SD card/USB), Yocto UEFI boot partitions.
Pros: Widely compatible, ideal for external storage.
Cons: Max file size limit (4GB), lacks advanced features like permission controls.
07
F2FS
Features: Flash lifespan optimization (TRIM, garbage collection), high-performance random writes.
Use cases: Android user data partition (/data), frequent R/W scenarios on flash devices.
Pros: Flash-specific design improves write efficiency and flash lifespan.
Cons: Primarily optimized for flash, may not suit other storage types.
08
Comparison
Note: Due to fixed-width formatting, best viewed on desktop.
Features/File System | ext4 | SquashFS | UBIFS | JFFS2 | tmpfs | FAT32/vfat | F2FS |
---|---|---|---|---|---|---|---|
Type | General File System | Read-only compression | NAND Flash Debicated | NOR/NAND Flash | In-memory file system | Cross-platform compatibility | Flash memory dedicated |
Read and Write Support | Support reading and writing | Read-only | Support reading and writing | Support reading and writing | Memory-based | Support reading and writing | Support reading and writing |
Compression Support | none | high | optional | none | none | none | none |
Applicable Storage | Hard disk, SSD, etc. | Universal Storage | NAND Flash | NOR/NAND Flash | RAM | SD card, USB flash drive, etc. | SSD, eMMC, etc. |
Service Target | Large capacity, high stability | Reduce space usage | Improving Flash Reliability | Small embedded systems | Extremely fast reading and writing | Cross-platform compatibility | Optimizing Flash Life |
Typical Uses | Root file system, system partition | Firmware, container images | IoT, Industrial Control Systems | Bootloader, kernel | Temporary Cache | SD card, UEFI boot | User data partition |
Special Notes:
Embedded systems usually choose to use SquashFS (read-only) or UBIFS (read-write) as rootfs.
Note: Due to the limitation of equal width, the reading experience of the table may be better on a computer.
Characteristic | SquashFS | UBIFS |
---|---|---|
Type | Read-only compression | Log-based, supports writing |
Read and Write Support | Read-only | Support reading and writing |
Compression | High compression rate, can reduce space usage | No compression |
Storage Type | Universal Storage | Flash memory (NAND) |
Applicable scenarios | Firmware, read-only system | Embedded Flash Storage |
Note that rootfs is not a specific file system type, but refers to the root file system that is first mounted during Linux system boot. It can be implemented using any of the file system types mentioned above.
- SquashFS used as a read-only root file system;
- UBIFS used as a writable partition;
- rootfs manages these partitions in a unified manner;
In practice, a combination is often used—for example, configuring rootfs as SquashFS, and the data partition as UBIFS.
Disclaimer:
- This channel does not make any representations or warranties regarding the availability, accuracy, timeliness, effectiveness, or completeness of any information posted. It hereby disclaims any liability or consequences arising from the use of the information.
- This channel is non-commercial and non-profit. The re-posted content does not signify endorsement of its views or responsibility for its authenticity. It does not intend to constitute any other guidance. This channel is not liable for any inaccuracies or errors in the re-posted or published information, directly or indirectly.
- Some data, materials, text, images, etc., used in this channel are sourced from the internet, and all reposts are duly credited to their sources. If you discover any work that infringes on your intellectual property rights or personal legal interests, please contact us, and we will promptly modify or remove it.