rewrite‐inplace.c - yktoo/yktools GitHub Wiki

Rewrites files, partitions or entire devices in-place, without needing to copy the data elsewhere and back.

This rather simple C program was originally written to address performance issues on Samsung EVO 840 SSDs.

You are strongly recommended to read this original post prior to using it.

Synopsis

rewrite-inplace <filename>

Where:

  • <filename> Path to the file to rewrite.

When applying this utility to rewrite a device or partition, it needs to be run as root.

Compiling

Before using, the program needs to be compiled from the source first:

gcc rewrite-inplace.c -o rewrite-inplace

Usage examples

# Compile
gcc rewrite-inplace.c -o rewrite-inplace

# Rewrite the entire /dev/sda device
rewrite-inplace /dev/sda

Disclaimer

This program comes with ABSOLUTELY NO WARRANTY whatsoever, use it entirely at your own risk! The author shall never be held responsible for loss of your data, ruining your hard drive, PC, house, city or planet, including but not limited to wars, hurricanes, famines, global warming or alien invasions, arising from using it.

See also

⚠️ **GitHub.com Fallback** ⚠️