Skip to content

akx/extremelyfast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

extremelyfast

EXT4remely fast read-only EXT4 filesystem structure reader. Parses the on-disk format directly via mmap.

File data is not read, only metadata (directory entries, inodes). Designed for fast directory traversal and metadata extraction, not file content reading.

Performance

On my Macbook with a M1 Pro chip, noble-minimal-cloudimg-amd64.raw (15,850 entries) takes ~1.8 ms warm. Should be fast enough for casual use.

Library

use extremelyfast::{Ext4Reader, Entry, EXT4_ROOT_INO, EXT4_FT_DIR};

let reader = Ext4Reader::open("disk.img", None)?; // auto-detects partition
let mut path = b"/".to_vec();
reader.walk(EXT4_ROOT_INO, &mut path, &mut |entry: &Entry| {
    println!("{} {} {:o} {}",
        entry.size,
        entry.mtime,
        entry.mode,
        String::from_utf8_lossy(entry.path));
});

Entry exposes: path, ino, mode, file_type, size, uid, gid, nlinks, blocks, flags, mtime, ctime, crtime.

CLI example

cargo run --release --example list_files -- disk.img
cargo run --release --example list_files -- disk.img --repeat 1000  # for profiling

Input formats

  • Raw EXT4 partition images (magic detected at offset 0)
  • Full disk images with GPT (first Linux partition auto-detected)
  • Block devices (/dev/sdaX)
  • Manual offset: --offset <bytes>

Limitations

  • Read-only, EXT4 only, extents only (no legacy block maps)
  • No inline data support
  • On a live read-write mount, concurrent writes may cause torn reads (crash and retry)

Built with Claude Code (Opus 4.6 did the actual implementation).

About

EXT4remely fast read-only EXT4 filesystem structure reader

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages