GithubHelp home page GithubHelp logo

chintzung / duperemove Goto Github PK

View Code? Open in Web Editor NEW

This project forked from markfasheh/duperemove

0.0 2.0 0.0 2.21 MB

Tools for deduping file systems

License: GNU General Public License v2.0

Makefile 1.08% C 96.82% Groff 2.10%

duperemove's Introduction

This README is for the development branch of duperemove. If you're looking for a stable version which is continually updated with fixes, please see v0.10 branch.

Duperemove

Duperemove is a simple tool for finding duplicated extents and submitting them for deduplication. When given a list of files it will hash their contents on a block by block basis and compare those hashes to each other, finding and categorizing extents that match each other. When given the -d option, duperemove will submit those extents for deduplication using the btrfs-extent-same ioctl.

Duperemove has two major modes of operation one of which is a subset of the other.

Readonly / Non-deduplicating Mode

When run without -d (the default) duperemove will print out one or more tables of matching extents it has determined would be ideal candidates for deduplication. As a result, readonly mode is useful for seeing what duperemove might do when run with '-d'. The output could also be used by some other software to submit the extents for deduplication at a later time.

It is important to note that this mode will not print out all instances of matching extents, just those it would consider for deduplication.

Generally, duperemove does not concern itself with the underlying representation of the extents it processes. Some of them could be compressed, undergoing I/O, or even have already been deduplicated. In dedupe mode, the kernel handles those details and therefore we try not to replicate that work.

Deduping Mode

This functions similarly to readonly mode with the exception that the duplicated extents found in our "read, hash, and compare" step will actually be submitted for deduplication. An estimate of the total data deduplicated will be printed after the operation is complete. This estimate is calculated by comparing the total amount of shared bytes in each file before and after the dedupe.

See the duperemove man page for further details about running duperemove.

Requirements

The latest stable code can be found in v0.09-branch.

Kernel: Duperemove needs a kernel version equal to or greater than 3.13

Libraries: Duperemove uses glib2 and sqlite3.

FAQ

Please see the FAQ file provided in the duperemove source

Usage Examples

Duperemove takes a list of files and directories to scan for dedupe. If a directory is specified, all regular files within it will be scanned. Duperemove can also be told to recursively scan directories with the '-r' switch. If '-h' is provided, duperemove will print numbers in powers of 1024 (e.g., "128K").

Assume this abitrary layout for the following examples.

.
├── dir1
│   ├── file3
│   ├── file4
│   └── subdir1
│       └── file5
├── file1
└── file2

This will dedupe files 'file1' and 'file2':

duperemove -dh file1 file2

This does the same but adds any files in dir1 (file3 and file4):

duperemove -dh file1 file2 dir1

This will dedupe exactly the same as above but will recursively walk dir1, thus adding file5.

duperemove -dhr file1 file2 dir1/

An actual run, output will differ according to duperemove version.

duperemove -dhr file1 file2 dir1
Using 128K blocks
Using hash: SHA256
Using 2 threads for file hashing phase
csum: file1     [1/5]
csum: file2     [2/5]
csum: dir1/file3       [3/5]
csum: dir1/subdir1/file5       [4/5]
csum: dir1/file4       [5/5]
Hashed 80 blocks, resulting in 17 unique hashes. Calculating duplicate
extents - this may take some time.
[########################################]
Search completed with no errors.
Simple read and compare of file data found 2 instances of extents that might
benefit from deduplication.
Start           Length          Filename (2 extents)
0.0     2.0M    "file2"
0.0     2.0M    "dir1//file4"
Start           Length          Filename (3 extents)
0.0     2.0M    "file1"
0.0     2.0M    "dir1//file3"
0.0     2.0M    "dir1//subdir1/file5"
Dedupe 1 extents with target: (0.0, 2.0M), "file2"
Dedupe 2 extents with target: (0.0, 2.0M), "file1"
Kernel processed data (excludes target files): 6.0M
Comparison of extent info shows a net change in shared extents of: 10.0M

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.