set up a UrBackup Server (2.4.15 on linux/docker) and some clients (Windows, linux) and it works like a charm. Big thanks for that piece of software!
Backups are stored on an internal btrfs drive.
Now I want to have a copy of the backup data on an external drive so I can store it in a safe location.
I found advice to use a second urbackup server and do an image backup of the internal drive. As the internal drive is on a linux machine and linux does not support image backups, this will not work.
Another advice suggested to use btrfs functionality to clone the drive by btrfs send| btrfs receive. I tried to walk this way but I am struggling:
My backup location is /mnt/urbackup and at first I made a snapshot: btrfs subvolume snapshot -r /mnt/urbackup /mnt/urbackup/BACKUP and then send it to the new location:
btrfs send /home/BACKUP | btrfs receive /mnt/extern.
This seems to work but it was way to fast and the sizes did not match neither.
When i checked the snapshot i found that most of the directories were empty.
The database folder is perfectly fine but in the backup subdirectory i can see all the clients and within these directories there are the snapshots named after the date they were taken. But these directories are empty:
| | +--220409-0604 (empty)
| | +--220410-0610 (empty)
| | +--220409-0708 (empty)
| | +--220410-0705 (empty)
What am I doing wrong, why are there empty directories in the snapshot?
Any hint is welcome, thanks in advance.
it is a nightmare trying to duplicate btrfs with manual send/receive commands, but there is a tool, which seems to be doing wnat you need:
btrfs-clone change the ID an GEN snapshots… so UrBackup can’t read that cloned storage.
Look into btrfs send, it’s far from a nightmare, you just have to understand how it works.
Use internet to find tutorials and examples.
I don’t think clone is what you actually want to do.
If it is, raid 1 could be better to use, idk to be honest.
I re-read the OP and I get what he is trying to do. Not sure that is a path you want to walk (double urbackup servers on the same computer). Also, how would the database be provided to the second server? The database he says “is there” is the BACKUP of the database urbackup does every 24 hrs (if enabled in the settings) You can’t just clone the backup storage and expect a server to understand what to do with it.
As I stated above. The way I do it, I do NOT “mirror” every single backup, I pick one once a week and use a script to send that snapshot to another drive so I have one extra snapshot per week saved on another location. Can be automated with a systemd timer or cron if you prefer that.
This snapshot is obv not restorable with urbackup, but it is still a snapshot I can mount or overwrite with in a “worst case scenario”.
I was contemplating setting up a raid 1 on btrfs, but tbh, the method I use works perfectly for my needs since I am at home, not managing the backups of a company f.ex,
Also consumes WAY less space.
But if you REALLY want to walk the path of double servers somehow, you also have to include the database files wherever you store them on your computer. But that would mean they would BOTH try to backup THE SAME CLIENT, the SAME WAY, same keys and all (remember, you CLONED all the data), so cloning would be useless anyway.
I have no idea how you would manage the setup to be honest.
I tried this btrfs-clone fork GitHub - mgeha/btrfs-clone: A tool for copying a btrfs file system with all its partitions to another btrfs file system, this has upgrades.
But… this version and other forks don’t working in modern systems. You need to modify the source code (Add “-f” param on lines 53 and 251).
Anyway, the clone is not usable for UrBackup, because snapshot have other IDs, you could use it to recover files directly from S.O. Also, you can’t update this clone with a new sincronization.
If you want a always fresh copy of you store on another location your best option is a second server and use DRBD.