EROFS vs SquashFS: Compression, Performance and OTA Trade-offs
Detailed comparison of EROFS and SquashFS for embedded Linux in 2026, covering read performance, compression ratios, deduplication, and integration with OTA update schemes.

SquashFS has been the default read-only compressed filesystem for embedded Linux for over a decade. EROFS (Enhanced Read-Only File System) is now a serious alternative, having matured in the mainline kernel since Linux 5.4. Choose using your kernel compatibility, image size and measured application workload. Keep a working SquashFS deployment until an EROFS evaluation demonstrates a benefit that justifies migration.
Design and workload trade-offs
SquashFS and EROFS both provide compressed read-only images. Compression layout, block or cluster size, cache state and decompressor choices affect the amount of work required for each read. A filesystem name alone cannot predict application startup time.
Inspect the distribution of small files, large sequential assets and duplicated content in your rootfs. Then reproduce those accesses on the target. Compare memory use and CPU time as well as storage throughput, especially if a faster read path competes with a latency-sensitive application.
Reproducible benchmark method
Create both images from one frozen directory tree. Record its digest or manifest, total uncompressed bytes, file count, permissions, extended attributes and tool versions. Preserve the complete creation commands and outputs. Record kernel version, CPU, RAM, storage model and mount options.
Test cold and warm cache conditions separately on disposable equipment. Measure representative application startup, random reads and sequential reads. Repeat runs, retain all observations and explain the aggregation. Include image creation time, image bytes and memory use alongside read performance. This page publishes a method without measured results.
Use the same test duration and dataset for both filesystems. Record any background processes or thermal throttling. If a workload reads only a small subset of files, make that subset explicit so readers can decide whether the result applies to their product.
Repeat the startup test with the other services running under the expected RAM limit. The kernel mailing list discussion of EROFS cluster benchmarks identifies page-cache behaviour as a variable. Record peak memory and subsequent read latency so a fast isolated run does not hide cache pressure during normal operation.
Compression and version compatibility
The upstream EROFS documentation reviewed on 16 November 2026 lists LZ4, MicroLZMA, DEFLATE and Zstandard. Availability depends on the target kernel configuration and the erofs-utils build used to create the image. The table records what still needs confirmation before deployment. Kernel EROFS documentation.
| Format and choice | Version/configuration check | Deployment decision |
|---|---|---|
| EROFS LZ4 / LZ4HC encoder | Check LZ4 decoding and selected mkfs.erofs flags | Compare creation time, size and read workload |
| EROFS MicroLZMA | Check matching kernel decoder and encoder support | Validate target mount and application access |
| EROFS DEFLATE | Check decoder support in the pinned kernel | Retain the image feature list with test logs |
| EROFS Zstandard | Minimum supported kernel/tool pair is unverified here | Establish and test the pair before issuing a deployment command |
| SquashFS selected compressor | Check mksquashfs version and target decoder configuration | Verify generated image metadata and mount behaviour |
LZ4HC describes an encoder choice that produces LZ4-compressed data. Compressor labels alone do not specify all image features. Keep a compatibility record per product kernel and test the exact generated image in its recovery environment too.
Deduplication
Duplicated files and repeated data can affect image size. Compare the actual deduplication settings and output of the selected tools. Tail packing and duplicate detection are distinct mechanisms, and their impact depends on the input tree.
Keep a file manifest when evaluating deduplication. Identical binaries in several application directories may provide a useful test case. Measure bytes saved and image creation cost, then repeat after an ordinary release change. Avoid projecting a fixed saving percentage onto a different package set.
dm-verity integration
Either image format can sit above a read-only dm-verity mapping. Generate the hash tree for the final image bytes and protect the expected root digest through the boot chain. Measure verification overhead under the same cache and workload conditions used for the filesystem comparison.
The dm-verity guide explains trust boundaries and writable-state limitations. Include hash-tree space in the per-slot capacity budget once, and keep the image and tree versioned together.
OTA update considerations
Whole-image replacement needs an installation and boot-selection policy that survives interruption. Neither filesystem alone makes a deployment atomic. Review OTA update tooling when choosing slot layout, health checks and rollback.
Image size, compressed download size and delta transfer size answer different questions. To evaluate a one-file change, freeze the original tree, change one identified file, create the second image with the same flags and run a named, versioned delta mechanism. Retain both image hashes, transfer bytes and device reconstruction results. This page has no measured delta experiment.
A small source change can alter image placement or compression enough to change many output bytes. Test an ordinary security update as well as the single-file case. Budget download staging and fallback capacity using the actual installer behaviour.
Tooling
Creating SquashFS images
mksquashfs rootfs/ rootfs.squashfs -comp zstd -Xcompression-level 15 -b 131072
SquashFS tools are mature and widely available in distribution packages.
Creating EROFS images
mkfs.erofs -zlz4hc rootfs.erofs rootfs/
EROFS tools (erofs-utils) are packaged in most distributions since 2023. Check mkfs.erofs --help for the features compiled into your version. The commands shown are illustrative and require target compatibility checks.
When to choose which
Retain SquashFS when its supported kernel/tool pair meets your capacity and workload requirements. Evaluate EROFS when its layout or image features address a measured product limitation. In either case, keep the comparison tied to repeatable tests and include recovery-kernel support.
Record the cost of changing build recipes, test fixtures, boot configuration and update delivery. A reduction in image size can be useful even if startup time stays similar, but its value should be assessed against the additional maintenance work.
Migration from SquashFS to EROFS
Switching filesystems in an existing product:
- Update the build pipeline to produce EROFS images (replace
mksquashfswithmkfs.erofs) - Ensure the target kernel has EROFS support compiled in (
CONFIG_EROFS_FS=y) - Update mount commands in initramfs or fstab
- Regenerate dm-verity hash trees for the new image format
- Test thoroughly - file permissions, symlinks, device nodes, and xattr must be preserved
The intended file content can remain the same, but verify metadata, filesystem operations and error behaviour against application requirements.
Because this migration can touch build recipes, CI helpers, and deployment scripts at the same time, AI code refactoring tools can help teams update repeated configuration patterns while keeping the changes reviewable.
Integration with ProteanOS
Inspect the selected build-system source to locate filesystem generation and post-processing. Verify ownership, permissions, links and extended attributes after image creation. The ProKit documentation provides project context. Any filesystem-selection variable or automatic verity step needs confirmation in the version you use.
Record the migration decision
Retain the current image and recovery path until the candidate format passes the same functional and failure tests. Record which measured constraint improved, what compatibility requirements changed and who will maintain the image tooling. Repeat the relevant tests after kernel, compressor or package-set changes.