[SOLVED] Sync How swap etc...

zuber

New Member
Nov 20, 2023
15
0
1
Hi, I have a question: is there any possibility to do something like hot swap and, upon detecting a new disk by Proxmox, trigger a synchronization task to copy data there? So far, I've tested with a USB drive, but after removing and reattaching it, Proxmox requires a restart, which, as you can imagine, is not desirable!
 
As far as I remember this is a planned feature (external rotating disks). But no, nothing exists yet. But should be possible to script such a feature utilizing autofs/systemd-mounts, datastore maintainance mode and local sync jobs you can trigger via PBS API.
 
For now, I'm not very concerned about having synchronization occur immediately upon connecting the drive. Mainly, I would like for the machine to not crash upon manual connection and disconnection of the drive. Do you know how to do this?
 
Did you test to enable maintainance mode for that datastore, then unmount/export of the disks filesystem before unplugging the disk?
 
Last edited:
Problem is: even if you set maintenance mode to "offline" some process still keeps it busy (I suspect the proxmox-backup-proxy process). As a results you still cannot unmount it. Sure, you can remove the disk the hard way. But the proxmox-backup process will not recognize it and remount it. You will have to restart the whole server.

In essence: No, PBS is not capable to deal with removable external drives (no matter if we talk about USB drives or hot swap capable SATA/SAS backplanes. Its a pity as it make realizing the 3-2-1 backup rule pretty hard if not impossible (with 1 backup offsite and offline) with platters. Only way is to use tapes or a tape drive emulator.

Also have a look here:
https://bugzilla.proxmox.com/show_bug.cgi?id=3156

There're claim of people having scripts up and running, however I doubt that they work with the current PBS version.

I also found this one here which I understand could solve the problem:

https://lists.proxmox.com/pipermail/pbs-devel/2024-March/007965.html
 
Last edited:
Yeah, well. It shows what I already knew: proxmox-backup-proxy still keeps the datastore busy and doesn't release the .lock file. Its probably much related to the patch mentioned in the mailing-list, I don't know....
 
And just restarting the service doesn't help? Seems excessive to restart the whole server.
 
Unfortunately only the hard way with systemctl stop proxmox-backup-proxy. A systemctl restart proxmox-backup-proxy only send a -HUP signal which still does not make the process releasing the lock.
However, it shouldn't be need to kill and then start the process again to force the release of the resource when you already set the maintenance mode yo "offline".
 
However, it shouldn't be need to kill and then start the process again to force the release of the resource when you already set the maintenance mode yo "offline".
Well, it's still better than restarting the whole machine.
And many daemons handle things that way and require a full restart for major changes. See also nfsd, samba ...
 
Not really. You cannot compare those types of services, its comparing apples with oranges. Filesharing services as SAMBA and alike are not designed for being used with removable media (even though some still work even with those).

But backup services are usually explicitly designed to deal with removable media. Even PBS is capable of dealing with tapes, just not with anything else. This is not acceptable for a serious backup solution in my eyes.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!