How to backup multiple sources to a single repo, longer than usual backups, and LUKS partitions

I’ve got several problems and I’m looking for a way to solve them. The last one is perhaps the most pressing issue, maybe read that first:

  1. I have two repositories, foo and bar. The data used to be on a single partition, backed up to a single repository. I have since separated them into two partitions and two repositories, and also changed the partition names, so when backing up, my repositories names are the same but the mount points at /run/media/user/ are star and gar. As far as I know there isn’t a way to rename repositories. I’d rather combine them into a single repo. According to a post I made a year ago, which I forgot about, there’s a way to combine backup sources to a single repository, but I’m uncertain what syntax to use. Is it restic -r /repo/ backup /run/media/user/star /run/media/user/gar? So I just add a space between each source location?
  2. I’ve performed two backups on each repository. My latest backups took 3 hours each, totalling close to the GB I had on those partitions, as if they were a full backup. Could this be caused by path changes, as a result of my partition name changes? All that’s changed is the name of the parent directory, the data is largely unchanged (as in /run/media/user/star instead of /run/media/user/foo). Given deduplication, I assumed it would recognise changes to pathing and only backup what was actually changed, but that doesn’t seem to have happened. I should note that it isn’t actually doing that much writing, the GB on the destination is changing about as much as I’d expect. So it’s needing to read the entire data set.
  3. (this is my biggest issue). My backup drive’s partition, on which all of my repositories live, is 2TB and encrypted with LUKS but there is another 2TB of free space. I’m running out of space on the partition. Extending LUKS partitions is risky and I’d rather avoid that. What’s the best way to move forward here, taking into account my first two issues? I do have other drives including a 2TB drive I could use to move existing backups to, then reformat my backup drive. Question is, how do I safely transfer those backups, using rsync? What arguments would be appropriate?

Thanks for reading, it’s a mess in my head but I’m hoping there’s an elegant solution.

@kq4t find here a partial response as I do not have experience with LUKS:

  1. assuming you use local repositories you can just rename the root folder of the repository. once done point your restic to the renamed location and all will work. to combine two sources into one repository you just add the second pass to the backup parameter, your proposal seems correct.

  2. if the data path for the restic backup parameter changes in any way ( i.e. change of parent folder, addition of a second path ) then restic cannot find a parent snapshot and will scan all files and folders. data will still be deduplicated and the backup after that one should be fast again, assuming the paths you pass onto the backup command remain stable so restic can refer to a parent snapshot.

1 Like

Check this out. You can resize a luks partition by decrypting it and then use a tool like gparted to resize. I’ve never done it and, like the person behind the link, if it was my data, I’d probably also at least make a copy to a second drive before doing anything.

You can clone a repo using rsync, e.g. like that:

rsync -Prvth –-delete source/ target/

Make sure you add the slashes after the folders. This can be restarted and also repeated in case the repo changed since starting the sync so it’s pretty solid.

1 Like