EROFS explained
EROFS (Enhanced Read-Only File System) is a lightweight read-only file system initially developed by Huawei, originally for the Linux kernel and now maintained by an open-source community from all over the world.
EROFS aims to form a generic read-only file system solution for various read-only use cases (embedded devices, containers and more) instead of just focusing on storage space saving without considering any side effects of runtime performance.
For example, it provides a solution to save storage space by using transparent compression as an option for scenarios that need high-performance read-onlyrequirements on their devices with limited hardware resources, e.g. smartphones like Android and IoT operating systems such as HarmonyOS alongside its HarmonyOS NEXT core system iteration.[1] [2] All of Huawei's new products shipped with EMUI 9.0.1 or later used EROFS,[3] and it was promoted as one of the key features of EMUI 9.1.[4] Oppo, Xiaomi and some Samsung products also use EROFS.[5] [6]
Also, it provides a content-addressable chunk-based container image solution together with lazy pulling feature to accelerate container startup speed by using new file-based fscache backend since Linux kernel v5.19.[7]
The file system was formally merged into the mainline kernel with Linux kernel v5.4.[8]
Features
The file system has two different inode on-disk layouts. One is compact, and the other is extended.
- Little-endian on-disk design
- 32-bit block addressing, which currently limits the total possible capacity of an EROFS filesystem to 16 TiB of 4 KiB block size.
- Metadata and data can be mixed by design for on-disk flexibility together with tail-packing inline data technology
- Support POSIX attributes and permissions, extended file attributes and ACL
- Fixed-size output transparent compression with LZ4, MicroLZMA (since Linux 5.16[9]) and/or DEFLATE (since Linux 6.6[10]) for relative higher compression ratios
- In-place decompression for higher sequential read [11] [12]
- Big pcluster feature allowing up to 1 MiB big pclusters for better compression ratios since Linux 5.13.[13] [14]
- Direct I/O, Direct Access (DAX) support, chunk-based data de-duplication for uncompressed files since Linux 5.15.[15]
- Multiple device support for multiple layer container images since Linux 5.16.
- Ztailpacking support since Linux 5.17.[16]
- File-based Fscache backend support since Linux 5.19 with "on-demand mode".[17] [18]
- Rolling-hash deduplicated data compression and fragment support since Linux 6.1.
See also
External links
-
- - git.kernel.org
- - LWN.net
- - blog.sigma-star.at
Notes and References
- Web site: There Is Finally A User-Space Utility To Make EROFS Linux File-Systems. Phoronix. Michael Larabel. 2018-11-19. 2018-12-13.
- erofs: introduce erofs file system. 2018-05-31. 2018-12-13. Linux kernel. Xiang. Gao.
- erofs: promote erofs from staging. 2019-07-04. 2019-09-03. Linux kernel. Xiang. Gao.
- Web site: EMUI 9.1, the Intelligent Android OS. Huawei Technologies. HUAWEI Global. 2022-01-10.
- Web site: Google's plan to use EROFS on Android. 20 May 2022 . 2022-08-04.
- Web site: The Galaxy S23 might be Samsung's first Android device to use EROFS. 2023-02-07. 2023-07-22.
- Web site: The Evolution of the Nydus Image Acceleration. 6 June 2022 . 2022-08-04.
- Web site: The 5.4 kernel has been released. corbet. 2019-11-25. LWN.net. 2019-12-01.
- Web site: EROFS File-System Adding LZMA Compression Support Via New MicroLZMA. Phoronix. Michael Larabel. 2022-01-10.
- Web site: EROFS File-System Adding DEFLATE Compression Support. Phoronix. Michael Larabel. 2023-09-03.
- Web site: staging: erofs: introduce LZ4 decompression inplace. 2020-12-03.
- Web site: staging: erofs: integrate decompression inplace. 2020-12-03.
- Web site: EROFS Sends In "Big Pcluster" Support For Linux 5.13, Other Improvements. Phoronix. Michael Larabel. 2021-07-11.
- Web site: erofs: add big pcluster compression support. 2021-07-11.
- Web site: XFS & EROFS File-Systems Have Big Changes For Linux 5.15. Phoronix. Michael Larabel. 2021-11-02.
- Web site: EROFS-Utils 1.5 Released With ZTailPacking, FSCK Extraction. 2022-08-04.
- Web site: 5.19 Merge window, part 1. Jonathan Corbet. 2022-08-04.
- Web site: Linux Kernel 5.19 Officially Released, Linus Torvalds Teases Linux 6.0 as Next Kernel Series. Marius Nestor. 31 July 2022 . 2022-08-04.