I configured Restic through the NixOS module, and then I manually started the corresponding systemd service for the first time. The service every time complains about insufficient space, which is strange because my entire home directory could easily fit on that drive many times over. Manually emptying everything with rm does not seem to even make space for a full backup.
Result of systemctl status restic-backups-homeBackup.service:
Feb 28 11:57:23 nixos systemd[1]: Starting restic-backups-homeBackup.service...
Feb 28 11:57:25 nixos restic[27936]: no parent snapshot found, will read all files
Feb 28 11:58:10 nixos restic[27936]: Save(<data/7d29d51893>) failed: write /dev/mapper/backups/home-rocky-anjela/data/7d/7d29d518936a5e3bf64cba67>
Feb 28 11:58:10 nixos restic[27936]: Fatal: unable to save snapshot: write /dev/mapper/backups/home-rocky-anjela/data/7d/7d29d518936a5e3bf64cba67>
Feb 28 11:58:10 nixos systemd[1]: restic-backups-homeBackup.service: Main process exited, code=exited, status=1/FAILURE
Feb 28 11:58:10 nixos systemd[1]: restic-backups-homeBackup.service: Failed with result 'exit-code'.
Feb 28 11:58:10 nixos systemd[1]: Failed to start restic-backups-homeBackup.service.
Feb 28 11:58:10 nixos systemd[1]: restic-backups-homeBackup.service: Consumed 55.215s CPU time, 1.5G memory peak, 1.2G read from disk, 7.8M writt>
I manually mount the encrypted drive to /dev/mapper/backups. Here’s the enormous disk space usage afterwards:
Filesystem 1K-blocks Used Available Use% Mounted on
devtmpfs 193552 185260 8292 96% /dev
My configuration:
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
restic
cryptsetup
];
services.restic.backups = {
homeBackup = {
exclude = ["/home/rockyw/.cache/"];
initialize = true;
passwordFile = "/home/rockyw/Documents/restic_passphrase.txt";
paths = ["/home/rockyw/"];
repository = "/dev/mapper/backups/home-rocky-anjela/";
extraOptions = [
"--compression=max"
];
pruneOpts = [
"--keep-daily 14"
"--keep-weekly 4"
"--keep-monthly 2"
];
runCheck = true;
};
};
}