How do I set up ZFS for rdiff-backup?

ZFS is a relatively new file system available for the Linux platform. Its popularity is gaining speed thanks to its great management flexibility and its resilience. To learn more about the benefits of ZFS, check out our previous article.

Further to our article on the benefits of ZFS for rdiff-backup, you will find herewith more technical information which explains the best configuration practices for ZFS when used with rdiff-backup.

For starters

To create a new dataset, run the following command where rpool is your zfspool.

sudo zfs create rpool/backups

This will create a default dataset configuration setting that you can adjust later.

Activate compression

To activate compression, you need to change compression properties.

zfs set compression=lz4 rpool/backups

Be sure to use lz4 compression mode to optimize performance since other compression modes are more draining on CPU resources.

Once activated, the new data written on the disk will then be compressed. Existing disk data will retain its original compression mode.

If you want ZFS to do all the compression work, it is recommended to deactivate rdiff-backup compression by changing your command line as follows:

rdiff-backup --no-compression ...

Implementing this strategy can be complex, as you will need to change the command on the client side or on the server side depending on the way you operate. Should you have any questions about this, please leave a message in the comments.

If you use Minarca, you can easily implement this strategy by changing the configuration setting to RDIFFBACKUP_ARGS= — no-compression dans /etc/minarca/minarca-shell.conf.

primarycache & secondarycache

sudo zfs set primarycache=metadata rpool/backups
sudo zfs set secondarycache=metadata rpool/backups

Deduplication

However, ZFS uses much more RAM. It would be wise to measure the real impact of this feature in the lab for your type of data backup.

sudo zfs set dedup=on rpool/backups

utf8only

sudo zfs create -o utf8only=off rpool/backups

Conclusion

1 ZFS Compression — A Win-Win, https://blogs.oracle.com/solaris/zfs-compression-a-win-win-v2

2 The Case for Using ZFS Compression, https://www.servethehome.com/the-case-for-using-zfs-compression/

Original article posted to ikus-soft.com

Involved in the open source community for more than 10 years. He is the founding president of Ikus Soft inc.,