Skip to main content

Read ext4 filesystems from image files and block devices

Project description

ext4-cli

Read ext4 filesystems from image files and block devices — without mounting them.

Quick start

# Install (pick one)
cargo install ext4-cli          # From crates.io
pip install ext4-cli            # Via pip
uvx ext4-cli --help             # Run without installing (via uv)

# Use
ext4 --source disk.img ls /etc
ext4 --source disk.img cat /etc/fstab
ext4 --source disk.img cp /etc /tmp/etc-backup -r

Installation

From crates.io

cargo install ext4-cli

From PyPI

pip install ext4-cli
# or run without installing:
uvx ext4-cli ls /

From Homebrew

brew install rvben/tap/ext4

From GitHub releases

Pre-built binaries for Linux (x64, arm64) and macOS (x64, arm64) on the releases page.

Usage

All commands require a source — an ext4 image file or raw block device — via --source or the EXT4_SOURCE environment variable:

export EXT4_SOURCE=/dev/rdisk4s2
ext4 ls /

Commands

ls — list directory contents

ext4 --source disk.img ls                     # List root directory
ext4 --source disk.img ls /etc                # List /etc
ext4 --source disk.img ls -l /etc             # Long format (permissions, uid, gid, size)
ext4 --source disk.img ls -a /etc             # Include dotfiles
ext4 --source disk.img ls --json /etc         # JSON output

cat — print file contents

ext4 --source disk.img cat /etc/fstab
ext4 --source disk.img cat /etc/passwd

cp — extract files

ext4 --source disk.img cp /etc/fstab ./fstab          # Extract a file
ext4 --source disk.img cp /etc /tmp/etc-backup -r     # Extract a directory tree

stat — show file metadata

ext4 --source disk.img stat /etc/fstab
ext4 --source disk.img stat --json /etc/fstab

info — show filesystem metadata

ext4 --source disk.img info
ext4 --source disk.img info --json

Raw block devices (macOS)

On macOS, use the raw disk path (/dev/rdisk*) for better performance. Reading raw block devices requires root access:

sudo ext4 --source /dev/rdisk4s2 ls /

Exit codes

Code Meaning
0 Success
1 General error
2 Permission denied
3 Path not found

Development

make fixtures   # Generate test fixtures (requires e2fsprogs)
make test       # Run tests
make lint       # Run fmt + clippy
make install    # Build and install

License

MIT OR Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ext4_cli-0.0.2.tar.gz (48.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ext4_cli-0.0.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (559.6 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

ext4_cli-0.0.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (532.2 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

ext4_cli-0.0.2-py3-none-macosx_11_0_arm64.whl (508.9 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

ext4_cli-0.0.2-py3-none-macosx_10_12_x86_64.whl (529.3 kB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file ext4_cli-0.0.2.tar.gz.

File metadata

  • Download URL: ext4_cli-0.0.2.tar.gz
  • Upload date:
  • Size: 48.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.20 {"installer":{"name":"uv","version":"0.11.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ext4_cli-0.0.2.tar.gz
Algorithm Hash digest
SHA256 69320649d5cb56a68f036d9cd9a4353d682ea27a1f7d261c2e7c604f3e8ad1cd
MD5 e9273fef8520ff10d6e4130afa335912
BLAKE2b-256 e0a52b39bb2932caae91f6ef6469d125f3a056dca94b452ac22dd8471ab7d357

See more details on using hashes here.

File details

Details for the file ext4_cli-0.0.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: ext4_cli-0.0.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 559.6 kB
  • Tags: Python 3, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.20 {"installer":{"name":"uv","version":"0.11.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ext4_cli-0.0.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a7db2afa603ae2c3e0c38a6b61d1f4c19a8452b5b6f5dce8c2d3982163bcbbf5
MD5 e9ff04d827f371413d33fc0cd71b8a5b
BLAKE2b-256 dbdf961a726466583196bd15f1ab8f9b188346784768860add3a8e651ace483a

See more details on using hashes here.

File details

Details for the file ext4_cli-0.0.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

  • Download URL: ext4_cli-0.0.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
  • Upload date:
  • Size: 532.2 kB
  • Tags: Python 3, manylinux: glibc 2.17+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.20 {"installer":{"name":"uv","version":"0.11.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ext4_cli-0.0.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9319ca6219921aa672a5d0198cdd93cc5717359177a3122ed521fb81f46a1287
MD5 803c0d545758bd03a862aed7429244e0
BLAKE2b-256 46c7600b03f51feb0d86f27c7f32878ec1f2f3dda95bc34d56693e260ec03e92

See more details on using hashes here.

File details

Details for the file ext4_cli-0.0.2-py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: ext4_cli-0.0.2-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 508.9 kB
  • Tags: Python 3, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.20 {"installer":{"name":"uv","version":"0.11.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ext4_cli-0.0.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2aadf41c7e25f5e917b66d1125db2664299669d4a91acc1a9fca5dcd292a3e2b
MD5 f154ff6547f1734c873652037bb8cd73
BLAKE2b-256 9ba33cd4b594adc7abf51f5426f54a78477c2093d76b75165729cc50c55941f4

See more details on using hashes here.

File details

Details for the file ext4_cli-0.0.2-py3-none-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: ext4_cli-0.0.2-py3-none-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 529.3 kB
  • Tags: Python 3, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.20 {"installer":{"name":"uv","version":"0.11.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ext4_cli-0.0.2-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4967fda1d089d069139dad88870366c96eede3eb2ef75889b863f4861a1e4f05
MD5 bb3ced939e0afb7e9ae558feebc395b1
BLAKE2b-256 8d50fcdc189aa65961c918ccd27fd91923035b36bcf89e85962145f54cb4bd7c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page