Romfs Version 2



The romfs filesystem is extremely small and light but suffers from lackluster read performance and high cpu usage. In order to utilise its read-only, highly reproducible nature without suffering in performance, I created a file system very derived from romfs. This file system sacrifices some space in padding (<1k per regular file) in return for ext2/3 like read performance and cpu usage. This is especially apparent in slower devices like usb attached flash cards.

Hacky Benchmarks

These benchmarks were generated with a freshly mounted romfs/rom2fs filesystem made from a directory of some 2000 files, totalling ~900MB on a 7200RPM IDE hard disk. The increase in size of the rom2fs partition image was 1022KB.

$ time find /tmp/romfs-1/ -type f -exec cp {} /dev/null \;
real    1m33.904s
user    0m0.937s
sys     0m28.765s

$ time find /tmp/romfs-2/ -type f -exec cp {} /dev/null \;
real    0m41.712s
user    0m0.899s
sys     0m2.530s


To utilize, generate a filesystem with a patched genromfs and the '-2' option, and mount with a patched linux kernel (use -t romfs). The magic number has been changed, such that version 2 romfs partitions will not mount on unpatched romfs modules, this would cause fairly interesting errors. It is, imaginatively, '-rom2fs-'.


All code available under the Gnu Public License.

linux kernel: