Restic backup - taking up way to much space on first backup

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;
    };
  };
}

Can you pleas share your config? It has only written a few MB (as it says in the logs) so I doubt the space is a problem. The problem with restic I ran into in the past was more because the lack of memory.

Okay, first off, do not mount anything into /dev mount it under /mntand share your config. There is no enormous space usage, /dev is a in-memory filesystem and as such is limited to a tiny size. Whats happening is that restic is writing directly into dev, which is probably due to serviceConfig.PrivateTemp = true in the systemd unit. Restic doesnt see the mount point writes into your /dev

Oh, sure, sorry I forgot about that.

Interesting. Do you happen to know the cryptsetupcommand to mount the partition on /mnt/instead of /dev/mapper?

cryptsetup? Thats not mounting but opening. doing cryptsetup to /dev/mapper is fine. but you still got to mount it, which i suppose youre not doing?

Ahh, okay, perfect, that does it, thank you so much.