g2p / bedup

Btrfs deduplication
http://pypi.python.org/pypi/bedup
GNU General Public License v2.0
322 stars 50 forks source link

Defrag and bedup #22

Closed skarekrow closed 11 years ago

skarekrow commented 11 years ago

Is there anyway to have bedup just run the defrag routine on everything it also doesn't dedup? Since I know defrag removes the CoW copy, I'm hesitant to add autodefrag to my mount options in fstab. Can you confirm whether that mount option is safe or not? Otherwise, can bedup dedup --defrag / run a defrag routine on everything instead of just the deduplicated files.

Thanks for this excellent program.

g2p commented 11 years ago

Defrag is snapshot-aware since 3.9 (though do stick to a recent kernel, the first iterations introduced bugs). From the btrfs FAQ, you need a command like this to defragment recursively:

find -xdev -type f -exec btrfs fi defrag '{}' \;

It will take time but you could run it just once. I'm not sure I want bedup to defrag every changed file (higher than its tracking threshold), that could be quite slow, unlike the current flag which benefits from the page cache. Try the autodefrag mount option and ping the btrfs list/channel if it doesn't work as well as it should.

skarekrow commented 11 years ago

That is great news, thanks for responding. If it works as it should, I see no reason your utility should defray further then it is currently.

Thanks again :) On Jun 28, 2013, at 4:45 AM, g2p notifications@github.com wrote:

Defrag is snapshot-aware since 3.9 (though do stick to a recent kernel, the first iterations introduced bugs). From the btrfs FAQ, you need a command like this to defragment recursively:

find -xdev -type f -exec btrfs fi defrag '{}' \; It will take time but you could run it just once. I'm not sure I want bedup to defrag every changed file (higher than its tracking threshold), that could be quite slow, unlike the current flag which benefits from the page cache. Try the autodefrag mount option and ping the btrfs list/channel if it doesn't work as well as it should.

— Reply to this email directly or view it on GitHub.