ExtentPilot
Free and open source extent analyzer for Linux

See how your files are really laid out.

ExtentPilot measures how files sit on disk using the Linux FIEMAP ioctl. Scan a folder to get each file's extent count, largest extent and size, a one-cell-per-file schematic and a searchable table. It never modifies a file.

  • MIT licensed
  • Read-only
  • Rust and egui
  • JSON CLI report
  • Development build

Try it: pick a sample folder and press Start read-only scan, then click a cell in the schematic or search the table.

ExtentPilot

Read-only inspection · No optimization operations are enabled

Symlinks and nested mounts are excluded. Press the button to scan the sample folder.
Defragmentation, TRIM, history and scheduling are not available. This demo uses sample data.

Browser demo with pretend files. It cannot read your disk or call FIEMAP, and nothing leaves this page.

Everything you need to read extent layout

ExtentPilot reports what the kernel says about each file and is careful not to claim more. Nothing it does writes to your files.

Real extent counts

Each file's extent count, average extent, largest extent, logical size and allocated size, read through the FIEMAP ioctl.

Read-only by design

Scans never create, move or change a file. The GUI refuses to run as root, so a scan only sees what your user can see.

Safe directory walk

Walks with held descriptors and openat2. Symlinks, special files and nested mounts, including bind mounts, are rejected.

Shared and uncertain flags

Shared extents and measurements the kernel could not vouch for are flagged, with a completeness note for each scan.

Logical schematic

One cell per file, colored by extent state. It is a logical view of your files, not a physical map of the disk.

Searchable table

A virtualized table of up to 5,000 retained rows that you can search and sort, even for large trees.

JSON report

The command line writes a full JSON report with per-file rows and raw filename bytes.

extentpilot analyze PATH --json

Cancel any time

Cancel between entries and ioctl batches. Partial results stay visible. Hard-linked files count once.

Schematic and table

Gray marks uncertain cells, purple a shared extent, amber more than one extent and teal zero or one extent.

ExtentPilot window with a scan summary, schematic and table
The GUI with a scan result and schematic (sample data).
ExtentPilot window with the table filtered by a search term
Searching the measurement table (sample data).

Supported platforms and limits

Area Status
Linux 5.6 or newer Needs openat2 with RESOLVE_BENEATH and RESOLVE_NO_XDEV, a mounted procfs and a Wayland or X11 session for the GUI.
Filesystems Any filesystem that implements FIEMAP, such as ext4. Some, such as tmpfs, reject it; that is reported as unavailable, never as zero fragmentation.
Packaging Not packaged yet. Build from source with Rust 1.95 or newer.
Scope Analysis only. No defragmentation, TRIM, history or scheduling is implemented.

Run it from source

ExtentPilot is a development build with no package yet. You need Rust 1.95 or newer and a Linux desktop session.

  1. Get the source

    sudo apt install git build-essential
    git clone https://github.com/mikeholp87/defrag-hdd-linux
    cd defrag-hdd-linux
  2. Open the GUI

    cargo run --release

    Enter a folder and start a scan. The GUI refuses to run as root.

  3. Or use the command line

    cargo run --release -- drives
    cargo run --release -- analyze ~/Documents
    cargo run --release -- analyze ~/Documents --json > report.json

    JSON reports contain filenames, so store them privately. File contents are never exported.

Read-only and honest

Never modifies files

Scanning uses read-only ioctls on descriptors it holds. No file is created, moved, truncated or rewritten.

Says what it cannot know

Missing shared flags do not prove an extent is unshared, and a scan is not an atomic snapshot. The report says so.

Bounded work

Scans stop at 100,000 entries and 128 directory levels, and totals still cover every measured file.

Questions

Does ExtentPilot defragment my files?

No. This build only analyzes. Defragmentation, TRIM, scheduling and privileged backends are not implemented, and the app makes no claim that fewer extents means faster reads.

Is the schematic a map of my disk?

No. It has one cell per retained file, in scan order, colored by extent state. Physical addresses never drive any raw I/O and are not shown as a disk layout.

Why does a scan say a measurement is unavailable?

The filesystem or permissions did not allow FIEMAP for that file. Memory filesystems such as tmpfs reject it with EOPNOTSUPP, and unavailable is not the same as unfragmented.

Why will it not run as root?

Scans use your user's permissions on purpose, so a scan cannot reach files you could not already read.

Where do I report a bug?

Open an issue on GitHub.

Support ExtentPilot

ExtentPilot is free and open source. If it saves you time, sponsoring helps me keep fixing bugs, answering issues and shipping updates. Every bit helps, and you can stop any time.

Can't sponsor? A star on GitHub also helps other people find it.