the-infiltratr/linux-defragger — explained in plain English
Analysis updated 2026-05-18
Check how fragmented a Linux drive's files and free space are before deciding whether to clean it up.
Defragment files on an ext4, Btrfs, or XFS drive to rebuild them into continuous blocks.
Compact free space toward the end of a FAT or exFAT drive and leave growth room after each file.
| the-infiltratr/linux-defragger | 0xallam/my-recipe | 0xhassaan/nn-from-scratch | |
|---|---|---|---|
| Stars | 0 | — | 0 |
| Language | Python | Python | Python |
| Last pushed | — | 2022-11-22 | — |
| Maintenance | — | Dormant | — |
| Setup difficulty | hard | moderate | moderate |
| Complexity | 5/5 | 2/5 | 4/5 |
| Audience | ops devops | general | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires root-level access and direct interaction with disk partitions, mistakes can affect filesystem data layout.
Linux Defragger is a desktop tool for Linux that examines a hard drive or storage device, shows how full and scattered its files are, and can reorganize them so the storage runs more smoothly. It works with many different storage formats, including FAT, exFAT, NTFS, ext4, Btrfs, XFS, and older formats used by Apple and Amiga systems, though the exact features supported vary by format. The program splits its work into distinct, separate operations rather than one big automatic fix. Analyse simply looks at a drive and reports how fragmented it is, without changing anything. Compact moves the free space on a drive toward the end of it, so large unused areas are grouped together instead of scattered in gaps. Defragment rebuilds files that have been split into pieces so each file sits in one continuous block again. Growth Defrag, a feature specific to FAT and exFAT formatted drives, rebuilds files in their current order but deliberately leaves a bit of extra room after each file, so the file has space to grow later without immediately fragmenting again. For newer Linux filesystems like ext4, the Compact process runs a filesystem check, shrinks the filesystem down to its smallest safe size, and then repeats this in rounds if it needs to move files out of small gaps first. Btrfs and XFS have their own native compacting methods built on tools already provided by the Linux kernel. Some older or more unusual filesystems, like ext2 and ext3, only support the read-only analysis feature rather than actually rearranging files. The tool has a graphical interface built with GTK that shows a visual map of how a drive's space is used, plus a command line option for users who want more detail or want to run it as part of a script. It also keeps a journal of the changes it makes during an operation, so if a rearrangement is interrupted partway through, an included recovery feature can finish the job safely instead of leaving the drive in a broken state. This is a fairly advanced, low-level system tool aimed at people comfortable working directly with disk partitions and filesystem internals, rather than an everyday consumer utility, since mistakes at this level can affect how a drive's data is stored.
A Linux desktop and command-line tool that analyzes filesystem fragmentation and reorganizes files and free space across many filesystem types.
Mainly Python. The stack also includes Python, GTK, Linux kernel ioctls.
Setup difficulty is rated hard, with roughly 1h+ to a first successful run.
Mainly ops devops.
This repo across BitVibe Labs
Verify against the repo before relying on details.