zfs-recompress

Crates.iozfs-recompress
lib.rszfs-recompress
version0.1.0
sourcesrc
created_at2024-07-21 21:53:53.40989
updated_at2024-07-21 21:53:53.40989
descriptionSmall program to recompress a ZFS directory tree and/or gather metadata on the files within.
homepagehttps://codeberg.org/jjeggle/zfs-recompress
repositoryhttps://codeberg.org/jjeggle/zfs-recompress
max_upload_size
id1310603
size65,669
Julian Jeggle (jjegg01)

documentation

README

zfs-recompress

Small program to recompress a ZFS directory tree and/or gather metadata on the files within. Basically a multithreaded (and more memory efficient) version of this.

Warning

This software literally rewrites every file in a directory tree. Always make a backup beforehand to prevent data loss!

Usage

For general information on compiling and using Rust programs, see relevant sections of the Rust documentation.

This program will walk through a directory tree and for each file makes a copy (to trigger ZFS compression), verifies its integrity and then overwrites the original file. Naturally, if you have a lot of files, this will take a while!

Optionally, you can also collect some metadata (uid, gid, file size and hash) on all files in the directory tree in an SQLite database while recompressing. This can be very useful to find users with problematic file management habits. To enable metadata collection, specify the --files-db option with a path to write the SQLite database to.

General usage:

zfs-recompress [OPTIONS] <ROOT_DIR>

Additional options include:

  • --force to override any existing database at the location specified via --files-db
  • --no-recompress to skip recompression entirely and only collect metadata
  • --skip-compressed to avoid recompressing files that look like they already are compressed by ZFS (note: use --force-hash if you still want hashes on these files in the metadata database!)
  • --batch-size to specifiy how many files at once are assigned to a single thread (you might want to reduce this one if you have very large files to enable better parallelism)
  • --worker-threads to specify the number of threads running in parallel (strongly depends on IO speeds and how fast your CPU can calculate hashes)

Please check zfs-recompress --help for a full overview over all usage options.

License

Much like the original, this software is licensed as free software under the GPLv2 license. You can find the details of this license in the LICENSE file.

Commit count: 0

cargo fmt