Skip to content
Projetos

Sobre

Put your SSD on keto. Reclaim real APFS gigabytes on macOS without deleting a file or changing a single byte.

Ferramentas de desenvolvimento

Como estes números são medidos

18 estrelas0 Forks +10 em 24 h

Crescimento medido de estrelas

em 24 h
+10
em 7 dias
Coletando histórico
em 15 dias
Coletando histórico
em 1 mês
Coletando histórico

Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.

README.md

Original

ketodisk

CI Latest release MIT License macOS APFS

Put your SSD on keto. Reclaim real APFS gigabytes on macOS without deleting a single file or changing a single byte.

Use ketodisk to shrink the files you want to keep.

https://github.com/user-attachments/assets/30ec67dd-11e9-413f-aae1-e44f52cd441f

Quick start

brew install subwaycookiecrunch/tap/ketodisk
ketodisk

Pick Quick Scan or drag a folder straight from Finder into the folder picker. Review the estimated savings before choosing Optimize files. Each file keeps its original path, and ketodisk checks the SHA-256 hash of each staged replacement before swapping it into place.

Homebrew installs a prebuilt binary for Apple Silicon or Intel. Use brew upgrade subwaycookiecrunch/tap/ketodisk to update it.

Build from source

You’ll need macOS, a local APFS volume, stable Rust, and Apple’s Command Line Tools. If the Command Line Tools are missing, run xcode-select --install.

git clone https://github.com/subwaycookiecrunch/ketodisk.git
cd ketodisk
cargo install --path . --locked
ketodisk --version

For a build you can run directly from the checkout, use cargo build --release --locked and run ./target/release/ketodisk.

Try it

Use the arrow keys and Enter to navigate. Run a Demo lets you try the process on temporary sample files. Set NO_COLOR=1 for a plain palette.

You can do the same from the command line. Replace ~/Projects/archive with a local folder you want to check.

ketodisk scan ~/Projects/archive
ketodisk apply ~/Projects/archive

scan reads files and estimates savings. apply asks for confirmation before writing. Use apply --dry-run to preview, or apply --yes to run unattended. Add --report ./ketodisk-audit.json to save the verification report to a new file.

Command What it does
ketodisk inspect PATH Shows APFS allocation, clone, compression, and residency details.
ketodisk doctor Checks the current volume’s APFS support, snapshots, and permissions.
ketodisk doctor --clean-temp PATH Checks for recoverable files left by an interrupted run.
ketodisk bench Runs five benchmarks on temporary files in a writable APFS directory.
ketodisk --help Lists commands and options.

Roadmap

Star the repo to support the project and react with 👍 on the issues you want prioritized for v0.2.

Proposal Scope
Linux support Btrfs and XFS reflinks, plus native zstd compression on Btrfs.
Windows support NTFS compression and ReFS Dev Drive cloning.
Native Mac app One SwiftUI window for dragging in a folder, scanning it, and shrinking files.

Where the savings come from

  • Exact copies can share disk blocks through APFS copy-on-write clones. Each copy keeps its own path and can still be edited independently.
  • Compressible files can use transparent LZFSE compression. macOS decompresses them during normal reads.
  • Similar files can share matching 4 KiB blocks at the same offsets. This works well for append-only exports and files with a few rewritten pages. Insertions can shift the remaining data out of alignment.

The planner accounts for overlaps between these methods when it estimates savings. JPEGs, MP4s, and ZIPs usually have little left to compress, though identical copies can still share blocks.

Before applying a plan

Use files that are no longer being written. Keep live databases and running VM images out of the scan. ketodisk checks for open files and mappings where macOS allows it, but a writer can still open a file while a replacement is in progress.

Replacements keep the original path and readable contents. They change the inode and ctime, which can make backup tools index the file again. Time Machine snapshots can also hold old blocks, so the space reclaimed from files can differ from the free space macOS reports. See Safety and recovery for the checks, exclusions, and recovery process.

Benchmark

ketodisk bench

In one run on an M5 MacBook Air with macOS 27.0.1, all files passed the before-and-after SHA-256 audit. These were synthetic workloads. Savings on your files will depend on how much they compress and how many blocks they can share.

Workload Files verified Physical space reclaimed
Exact duplicates 6/6 39.97 MiB (83.27%)
Append-only datasets 3/3 20.94 MiB (60.53%)
Page-modified images 3/3 25.59 MiB (53.32%)
Cold developer tree 32/32 7.88 MiB (98.43%)
Developer tree stress test 1000/1000 246.08 MiB (98.43%)

The 1,000-file run took 3.16 seconds including fixture generation and verification. Use ketodisk bench --prepare-dir ./benchmark-fixture to keep a copy of the four standard workloads for your own scans.

Development

Run these checks from the repository root on macOS. The integration tests and benchmark use APFS.

cargo fmt --check
cargo clippy --locked --all-targets -- -D warnings
cargo test --locked
cargo run --locked --release -- bench

License

MIT.

Explore projetos relacionados

Carregando…