arcbox-ext4
Pure-Rust ext4 filesystem formatter and reader. Creates and reads ext4 images entirely in userspace -- no kernel mount, no FUSE, no C dependencies.
Designed for converting OCI container image layers into ext4 block device images on macOS and Linux.
Features
- Formatter -- create ext4 images from scratch (
mkfs+ file population) - Reader -- parse and read existing ext4 images (files, directories, symlinks)
- OCI unpack -- stream tar layers into ext4 with whiteout semantics (
.wh.*,.wh..wh..opq) - Extended attributes (inline + block)
- Extent trees (depth 0 and 1)
- Hard links with correct reference counting
- Symlinks (inline for targets < 60 bytes, data-block otherwise)
- No journal (not needed for container rootfs)
Quick start
use Path;
use Formatter;
// Create a new ext4 image.
let mut fmt = new?;
fmt.create?;
fmt.close?;
// Read it back.
let mut reader = new?;
let data = reader.read_file?;
assert_eq!;
OCI layer unpacking
use Cursor;
use Formatter;
let mut fmt = new?;
fmt.unpack_tar?;
fmt.unpack_tar?; // overlay with whiteouts
fmt.close?;
Limitations
- Block size is fixed at 4096 bytes
- Maximum file size: 128 GiB
- No journal support
- No metadata checksumming (
metadata_csum) - Extent tree depth limited to 1
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.