Btrfs: Difference between revisions

Onny (talk | contribs)
replace manual bees with NixOS module
Line 122: Line 122:


Files with (partially) equal contents can be deduplicated using [https://github.com/Zygo/bees bees] or [https://github.com/markfasheh/duperemove duperemove].
Files with (partially) equal contents can be deduplicated using [https://github.com/Zygo/bees bees] or [https://github.com/markfasheh/duperemove duperemove].
To use bees, you need to:
bees can be configured in <code>configuration.nix</code>:


# configure the UUID
<syntaxhighlight lang="nix">
# mount the filesystem
services.beesd.filesystems = {
# create a hash table ([size guidelines](https://github.com/Zygo/bees/blob/master/docs/config.md))
  root = {
# run <code>beesd</code>
    spec = "LABEL=root";
    hashTableSizeMB = 2048;
    verbosity = "crit";
    extraOptions = [ "--loadavg-target" "5.0" ];
  };
};
</syntaxhighlight>


<syntaxhighlight lang="console">
This will run the daemon in the background. To disable auto-start, use <code>systemd.services."beesd@root".wantedBy = lib.mkForce [ ];</code> for each filesystem.
# mkdir -p /var/run/bees/configs/bees/
# echo "UUID=$UUID" > /var/run/bees/configs/bees/root.conf
# mkdir -p /run/bees/mnt/
# mount /dev/disk/by-uuid/$UUID /run/bees/mnt/$UUID -osubvol=/
# truncate -s 1g /var/lib/bees/$UUID/.beeshome/beeshash.dat
# chmod 700 /var/lib/bees/$UUID/.beeshome/beeshash.dat
# beesd /
</syntaxhighlight>


== Usage ==
== Usage ==