Duplicati Can’t Access My Hard Drives [NixOS]

Hi all,

How do I enable Duplicati to backup my data to either an external or internal secondary hard drive? I have used rsync and cron in the past but am trying to move to a system that regularly backs up my data, can encrypt it, and pretty much does it all in the background so I don’t have to think about it.

  • I’m running into the same issue on multiple NixOS PCs.
  • I have tried the simple things, such as show hidden files, adding my username & password, etc.
  • I am able to see my external HD on my laptop and copy/move files to and from it. Same with my internal HD in my desktop, albeit I do have to use my user password in Gnome in order to access it.

One of my weaknesses is fully understanding storage and permissions on any distro of Linux. I am thinking that I need to somehow enable secondary hard drives (both internal and external, not the hard drive that NixOS is installed on). I am currently unable to backup my data using Duplicati on any of my systems (mainly concerned about my laptop and desktop).

I have dabbled with editing my /etc/fstab in the past, but

  1. am not sure I even need to do so in this issue, and
  2. not sure if there is a nixified way of handling this if it is needed.

Any help / direction is much appreciated! Let me know if you need any additional information to help diagnose what is occurring.

I have tried posting on the NixOS discourse, but no one seems to have any expertise in Duplicati there.

Hello

there is nothing mystical in the way Duplicati accesses backup drives under Linux: these devices need to be mounted before using them, and then you add the path to the mounted device in the job configuration.

So if your system is a standard Linux, ‘man mount’ should get you where you need to be.

If your particular system needs special incantations to get them mounted, the particular system forum should give you that and you can then add these incantations to mount the drive in a before backup script.

Top hit from Google search for nixos mount:

Filesystems, which quickly references to this. There’s also NixOS Wiki which lists many NixOS forums.

Questions should not be asked specifically about Duplicati, but in terms of general access by programs running as Duplicati runs. You can view About → System info → UserName to see what yours is using. Sometimes people who package Duplicati make different choices than the packages Duplicati provides.

https://search.nixos.org/packages will let you find Duplicati, and there is a maintainer there you can ask. There’s also no current Duplicati listed there, but Duplicati can sometimes do its own autoupdates. See:

About → System info → BaseVersionName (its original install) and ServerVersionName (may be newer)

As Duplicati team does not create NixOS packages in their specialized format, it’s a guess, but I found:

which is reminiscent of what the Arch Linux AUR packager did. It’s safer, but gets in the way of access.

Duplicati is just a program which runs as some user and is subject to the usual permissions, so find out what user it runs as, the path where it needs access (this is the mount), then see if permissions allow it.

I have no idea why Duplicati will not work on any of my NixOS systems. I have moved to Borg, which works perfectly. My drives are fully accessible.

Duplicati works great for a nonprofit I have set it up for, albeit on Windows.

Were the ideas which were posted above your post tested and disproven?

Probably not since the complexity of accessing an USB device under this OS seem wildly overinflated; I downloaded a 3 Gb Nixos image, installed it in a KVM VM (12 GB space needed), did a redirection to a USB external hard disk that I have - it was the hardest part since it needed a 2 mn Internet search - then started the NixOs disk utility from the NixOs graphical launcher (30 s search), mounted the (Ntfs) partition (1 mn work, the mount path was displayed helpfully by the disks utility - it was /run/media/gp/ntfs, ‘gp’ being the user name I selected and ‘ntfs’ being the partition name, started Duplicati (installed via the trick pointed at by your link) with Duplicati-server, searched the mount path in the Duplicati menu, started a backup, done.
Now all this would need to be made persistent and automated sure, and I have not done this job, but accessing an external USB disk under NixOs is not rocket science. I can’t believe that no one has provided a pointer or two on this Nix forum. Gah. Will not use, consider or recommend.

Yes, I’ve tested this option under both my host and home manger flake files and dumped the outputs to my notes:

home-manager:

error:
       … while calling the 'seq' builtin

         at /nix/store/b0l3v8509hrl3qbv6fj2zl0mjb2rwhdy-source/lib/modules.nix:322:18:

          321|         options = checked options;
          322|         config = checked (removeAttrs config [ "_module" ]);
             |                  ^
          323|         _module = checked (config._module);

       … while evaluating a branch condition

         at /nix/store/b0l3v8509hrl3qbv6fj2zl0mjb2rwhdy-source/lib/modules.nix:261:9:

          260|       checkUnmatched =
          261|         if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [] then
             |         ^
          262|           let

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: undefined variable 'mkOption'

       at /nix/store/061hcpi3pv2vkfyakaw69blyhz5398j6-source/users/zonsopkomst/home-manager.nix:62:12:

           61|
           62|     user = mkOption {
             |            ^
           63|       default = "duplicati";

default.nix (or configuration.nix):

error:
       … while calling the 'seq' builtin

         at /nix/store/b0l3v8509hrl3qbv6fj2zl0mjb2rwhdy-source/lib/modules.nix:322:18:

          321|         options = checked options;
          322|         config = checked (removeAttrs config [ "_module" ]);
             |                  ^
          323|         _module = checked (config._module);

       … while evaluating a branch condition

         at /nix/store/b0l3v8509hrl3qbv6fj2zl0mjb2rwhdy-source/lib/modules.nix:261:9:

          260|       checkUnmatched =
          261|         if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [] then
             |         ^
          262|           let

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: undefined variable 'mkOption'

       at /nix/store/x2x6b4vhib09m7a6apq1iclbf8srr146-source/hosts/local/weda/default.nix:31:12:

           30|
           31|     user = mkOption {
             |            ^
           32|       default = "duplicati";

I’ve tried a few other searched items each week since I opened this topic, I will have to reach out to the maintainer(s) when I can make some time.