Giter Club home page Giter Club logo

filerewrite's Introduction

filerewrite

Tool for rewriting file's data in place.

filerewrite works by opening the given file(s) read-write, reading its content (8MB at a time) and writting the same data back at the same offset (using pread(2) and pwrite(2) system calls). Once the file is rewritten, its access and modification times are restored to those from before the file was rewritten. filerewrite operates only on regular files, skipping all the rest, including symbolic links, but it makes no effort to track hard linked files, so those will be rewritten multiple times.

This tool is useful for example with ZFS file system. When selected properties of a ZFS file system like compression or deduplication are updated, the new settings will only apply to newly written blocks without having any impact on alreading existing blocks.

Example usage:

find -x /directory/to/be/rewritten/ -type f -print0 | xargs -0 filerewrite

filerewrite should not be used on live file systems as there is an obvious race between reading the data and writing the data back.

It also makes little sense to use filerewrite on ZFS file systems with existing snapshots as the rewritten blocks are not going to be freed until the last snapshot referencing them is destroyed.

filerewrite should work on FreeBSD, Linux, macOS and pretty much any other pretty modern UNIX-like operating system.

filerewrite's People

Contributors

pjd avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.