[SOLVED] Backup works before restore. backup failed after restoring LXC

lapas

New Member
Dec 17, 2024
9
0
1
So I was testing out my backups by deleting one of my LXCs and restoring it. I was able to restore my LXC from my NAS (NAS added as a store in PVE) via the Shell. Everything works except when it tried to perform a backup job to my NAS it failed. This is an unprivileged container. Before restoring this LXC, the backup was running fine, so I don't know why it is failing now.

Here's some of the output from the failed backup job for the LXC:
Code:
INFO: temporary directory is on NFS, disabling xattr and acl support, consider configuring a local tmpdir via /etc/vzdump.conf
INFO: starting first sync /proc/892236/root/ to /mnt/pve/synology-nas/dump/vzdump-lxc-102-2024_12_29-11_15_56.tmp
ERROR: rsync: [generator] chown "/mnt/pve/synology-nas/dump/vzdump-lxc-102-2024_12_29-11_15_56.tmp/." failed: Operation not permitted (1)
ERROR: rsync: [generator] chown "/mnt/pve/synology-nas/dump/vzdump-lxc-102-2024_12_29-11_15_56.tmp/bin" failed: Operation not permitted (1)
ERROR: rsync: [generator] chown "/mnt/pve/synology-nas/dump/vzdump-lxc-102-2024_12_29-11_15_56.tmp/lib" failed: Operation not permitted (1)
ERROR: rsync: [generator] chown "/mnt/pve/synology-nas/dump/vzdump-lxc-102-2024_12_29-11_15_56.tmp/lib64" failed: Operation not permitted (1)
ERROR: rsync: [generator] chown "/mnt/pve/synology-nas/dump/vzdump-lxc-102-2024_12_29-11_15_56.tmp/sbin" failed: Operation not permitted (1)
ERROR: rsync: [generator] chown "/mnt/pve/synology-nas/dump/vzdump-lxc-102-2024_12_29-11_15_56.tmp/boot" failed: Operation not permitted (1)
ERROR: rsync: [generator] chown "/mnt/pve/synology-nas/dump/vzdump-lxc-102-2024_12_29-11_15_56.tmp/dev" failed: Operation not permitted (1)
ERROR: rsync: [generator] chown "/mnt/pve/synology-nas/dump/vzdump-lxc-102-2024_12_29-11_15_56.tmp/etc" failed: Operation not permitted (1)
ERROR: rsync: [generator] chown "/mnt/pve/synology-nas/dump/vzdump-lxc-102-2024_12_29-11_15_56.tmp/etc/localtime" failed: Operation not permitted (1)
ERROR: rsync: [generator] chown "/mnt/pve/synology-nas/dump/vzdump-lxc-102-2024_12_29-11_15_56.tmp/etc/mtab" failed: Operation not permitted (1)

I did the same thing with a VM: deleted it, restored the VM from my backup, and it completed the same backup job (all my LXCs and VMs are scheduled at midnight to do a backup to my NAS via NFS).

Can someone please help with this issue?
 
Restoring LXCs in PVE can sometimes be an odd experience - so I'm not sure what changed, but why not follow the advice given in that log and set a tmpdir in the vzdump.conf file. As in the docs.

I quote from the above docs (as this may be relevant to your case) from the section Backup Modes for containers, suspend mode section:
Use of a local tmpdir is also required if you want to backup a local container using ACLs in suspend mode if the backup storage is an NFS server.
 
  • Like
Reactions: UdoB
Restoring LXCs in PVE can sometimes be an odd experience - so I'm not sure what changed, but why not follow the advice given in that log and set a tmpdir in the vzdump.conf file. As in the docs.
Thanks for the reply. Is this what I need to add as a value for the tmpdir in the vzdump.conf file?
# vzdump default settings
tmpdir: /mnt/pve/synology-nas/dump/
 
No. That looks like it is in the NAS location. You need to use a local location (& fast) for the tmpdir. See the example given in the above docs;
Code:
tmpdir: /mnt/fast_local_disk
Yes, it is the NAS location. Will any directory work as long as it exists on the LXC? So something like tmpdir: /tmp will do then? If so, I can create this directory. So for this tmpdir directory, it’s only temporary and the files will get deleted after the backup job finishes?
 
You need to use some local & fast storage NOT on the NAS & NOT on the LXC.

On a successful backup they should get deleted. Try it & check.
I read the docs, but I am not sure if I am understanding it correctly. So do I need to create a directory on the node/host then?

Happy New Year!
 
So do I need to create a directory on the node/host then?
I believe you do.

So (just as an example, IDK your system):

Code:
# On PVE host:
mkdir /mnt/local-tmp

# Then again on PVE host:
nano /etc/vzdump.conf

# Add the following:
tmpdir: /mnt/local-tmp

# Save & exit
 
  • Like
Reactions: lapas
Please note; for any backups you now do in suspend-mode, you will require enough space in that local tmpdir to contain the backup, before completing that backup.
 
  • Like
Reactions: lapas
I believe you do.

So (just as an example, IDK your system):

Code:
# On PVE host:
mkdir /mnt/local-tmp

# Then again on PVE host:
nano /etc/vzdump.conf

# Add the following:
tmpdir: /mnt/local-tmp

# Save & exit
This worked. Thank you.
Please note; for any backups you now do in suspend-mode, you will require enough space in that local tmpdir to contain the backup, before completing that backup.
So by default does the backup job run in suspend-mode? Do you know what happened why after I restored the LXC, the backup job fails, while the same backup job completes for all VMs and LXCs?
 
So by default does the backup job run in suspend-mode?
The backup mode runs in whatever mode you set it. However the default is snapshot. See here.

Do you know what happened why after I restored the LXC
No. As I wrote above, restoring an LXC can be a journey. (Also see below). You have to understand that an LXC is using the normal host resources (kernel, OS & FS) in a permission controlled (somewhat separated) environment. So "things" can happen pre/post restore.

while the same backup job completes for all VMs and LXCs?
It would appear that that particular LXC is using ACLs in a fashion that disturb the running of the LXC vs the backup to the NAS. In short it causes a conflict of permissions while performing the backup in suspend mode. I imagine something changed with that situation pre vs post restore.

Anyway happy you got it sorted - maybe mark this thread as Solved. At the top of the thread, choose the Edit thread button, then from the (no prefix) dropdown choose Solved.
 
  • Like
Reactions: lapas
The backup mode runs in whatever mode you set it. However the default is snapshot. See here.


No. As I wrote above, restoring an LXC can be a journey. (Also see below). You have to understand that an LXC is using the normal host resources (kernel, OS & FS) in a permission controlled (somewhat separated) environment. So "things" can happen pre/post restore.


It would appear that that particular LXC is using ACLs in a fashion that disturb the running of the LXC vs the backup to the NAS. In short it causes a conflict of permissions while performing the backup in suspend mode. I imagine something changed with that situation pre vs post restore.

Anyway happy you got it sorted - maybe mark this thread as Solved. At the top of the thread, choose the Edit thread button, then from the (no prefix) dropdown choose Solved.
Thank you sir. Will mark it Solved now.
 

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!