What's the best and cost effective way to backup LXCs/VMs media and data?

roxy

New Member
Aug 18, 2024
12
1
3
I am using pve with some LXCs which should use/access the same storage (ca 12 TB of mixed data with movies, shows, music, documents etc.) Now I'd like to backup the LXCs as well as the data. My favorite would be an external storage which I connect once a week and than all changes will be synced. Does anyone know a solid solution for such a task? I already use the proxmox integrated Backup routine for LXCs (without the data). Should in use it for the Data as well? How do you do your backup/archive?
PS: Proxmox Backup Server would only be possible as LXC (or VM?) on the same host.
 
And would you recommend to backup my 12 TB data via the build-in backup option as well?
 
That is what I personally do.
Do note that video and images cannot be compressed so your backup sizes will be really big even with compression.
So make sure you have enough storage for the backup on the other end. (As I would not be suprised that the backup sizes are about as big as the VM is right now.)
 
Last edited:
  • Like
Reactions: roxy
And how do you do that? Because I bind mount my media directory as a Mout Point into some containers to share the content for different Services. but if I do so I can not check the "Backup"-Option in the LXC Ressources. Only if I create a "Storage"-Mount Point in the Ressources I can check it, but the I can not share the media files with different containers. I really struggle to find the right way to do it
 
Hmmm...
That is a difficult one.

When you use storage between multiple VMs/LXCs then indeed the backup option disappears since normally you do not share disk with multiple VMs/LXCs. (And in 99% of the time you also shouldn't.)
I get that is it easier and better to just share the storage beween the LXCs and I am not going to say to not do that.
But this means that the build-in option is not a option for you.

But maybe something like rclone could work for you if you plan on uploading to the cloud. (And set a cron job to upload everything like once a week)
If you plan to just create a backup to a local disk then just copying the data every week would also be an option via cron. (But it will override all the data that is has already copied and this take longer and wearout the backup disk quicker.)

But I cannot think of a out-of-the-box option that could create a backup of a share location.
So you may want to try to just create a script that checks if a file is already backed-up and if not copy it over. (But really depends on your experience with bash and making your own scripts.)
 
I really thank you for you thoughts and explaining answers. The thing is I want to use plex, some media management apps and as well a samba to share them in my private network. To balance the load (transcoding, managing etc) I thought it would be a good idea to have a lxc for each service instead of setting up a vm and then guests inside of it (like with docker). My hardware is not that powerful (N3450, 12GB RAM, 1TB SATA SSD) so I wanted to have as less overhead as possible.
Because of that I refused the variant to "Mount Point" the storage as raw disk (from pve-GUI > Ressources) into a nas lxc/vm (ex. Cockpit or OpenMediaVault), which would offer the backup option and then share it with nfs and smb to the other LXCs. Additionally unprevileged lxc can not mount cifs drives. https://forum.proxmox.com/threads/e...rage-across-lxc-containers.130968/post-575646
In this thread @crally passes a HBA into a OMV VM and shares the storage via samba into other VMs (for example for nextcloud or docker).
So from my point of view there remain only two options.
1. Mount drive on host and bind mount to LXCs. (User mapping needed)
2. Pass Drive into "vault"-vm (omv, cockpit or plain samba for accesscontrol) and then share it via nfs or smb in the LXCs/VMs.
I really like to know what the best way is to setup a media home server. How 'should' it be?
 
Last edited:
Lxc unpriveleged containers cannot mount nfs shares or cifs directly but you can mount the shares to the proxmox host and then do a mountpoint to lxc and you don' t need user mapping for that see this post: https://forum.proxmox.com/threads/t...are-to-an-unprivileged-lxc.138506/post-726198.

But I agree that this represent extra overhead and complexity but more importantly I came to realize it presents a single point of failure which the VM.

My plan was to have all my drives pass through a VM and then this mounted to proxmox host and then to LXC containers. The advantage would be that I could backup everything using restic from the VM but now I am hesitant because if I screw the VM with an update or something I would loose all the services.

I am right now researching and experimenting to see if I can somehow use zvols for my data inatead of passing physical disks and upload zvols to the cloud using restic or any other methods.