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.3.tar.gz (49.0 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.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (559.5 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

ext4_cli-0.0.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (532.1 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

ext4_cli-0.0.3-py3-none-macosx_11_0_arm64.whl (508.6 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

ext4_cli-0.0.3-py3-none-macosx_10_12_x86_64.whl (528.8 kB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: ext4_cli-0.0.3.tar.gz
  • Upload date:
  • Size: 49.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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.3.tar.gz
Algorithm Hash digest
SHA256 0dcb11518f01d11b2728522462f58b26f2e909428d304e9bbdf7b80feb5f488d
MD5 13bd309b32eb9a33b02e0286d72c8d34
BLAKE2b-256 ca2cdeac9b01795ed28580ae9ab21125bc626863a0a39644830e2766aa529a7b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ext4_cli-0.0.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 559.5 kB
  • Tags: Python 3, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b3b9dcb8211b95381c47d349442c9651b03e6484fbd0f0637cc48fb8ac4ef964
MD5 39958ecb89804192fa9e1016777f0157
BLAKE2b-256 50c25ecdb13b3633aff7da45b77e996aa1e79d955e5fa81c4f324515506b81a3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ext4_cli-0.0.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
  • Upload date:
  • Size: 532.1 kB
  • Tags: Python 3, manylinux: glibc 2.17+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6247f8a4c99dcf6921f8c6d7a91635e96f31552bfbee3f3e3290974408913753
MD5 c40f2a0a20a56de8c47df28b192ea138
BLAKE2b-256 7e45cd4ad9f94bd4a1ce100037917ae272851fa7c28bb3105aa1708cdec5f9fb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ext4_cli-0.0.3-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 508.6 kB
  • Tags: Python 3, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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.3-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 acc335836e5047ad24b758762c57c60dfc57e39246b5c29cfe9c782050cefe60
MD5 fc58a1f4984c403f6def64bab72ac3b3
BLAKE2b-256 d3fb0912ea6f125acb0aa9633b9d194a853803e27604c854da1e7d3cb167db97

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ext4_cli-0.0.3-py3-none-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 528.8 kB
  • Tags: Python 3, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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.3-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 228cb1985ac650d86348bc7df8312ac1665d6133bf1c0afe0cd4efc4e8506661
MD5 6f584b73f36d823007e1c9f35d043e7d
BLAKE2b-256 cf9672e07d82e72190b006075552528fb436241fd8e21db075d60004db487982

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