Backup of CT fails, VM works

Morphy8

New Member
Sep 11, 2022
3
0
1
Hello,

I am stalling progress on fixing a CT Backup. (Actually I am on the way to move to bigger SSD on my NUC and want to port everything over.

I have a VM running IOBroker and a CT with Portainer for Grafana and Influx.
Backup is to Synology NAS - NFS.

THis works well for the VM but for the CT I have serious issues. Backing up to the NAS is giving me this permission error:

Code:
()
{{guestname}}
INFO: starting new backup job: vzdump 200 --storage Diskstation --notes-template '{{guestname}}' --node Proxmox --remove 0 --mode snapshot --compress zstd
INFO: Starting Backup of VM 200 (lxc)
INFO: Backup started at 2023-11-03 16:33:10
INFO: status = running
INFO: CT Name: Docker
INFO: including mount point rootfs ('/') in backup
INFO: backup mode: snapshot
INFO: ionice priority: 7
INFO: create storage snapshot 'vzdump'
  WARNING: You have not turned on protection against thin pools running out of space.
  WARNING: Set activation/thin_pool_autoextend_threshold below 100 to trigger automatic extension of thin pools before they get full.
  Logical volume "snap_vm-200-disk-0_vzdump" created.
  WARNING: Sum of all thin volume sizes (90.00 GiB) exceeds the size of thin pool pve/data and the size of whole volume group (55.39 GiB).
INFO: creating vzdump archive '/mnt/pve/Diskstation/dump/vzdump-lxc-200-2023_11_03-16_33_10.tar.zst'
INFO: tar: /mnt/pve/Diskstation/dump/vzdump-lxc-200-2023_11_03-16_33_10.tmp: Cannot open: Permission denied
INFO: tar: Error is not recoverable: exiting now
INFO: cleanup temporary 'vzdump' snapshot
  Logical volume "snap_vm-200-disk-0_vzdump" successfully removed
ERROR: Backup of VM 200 failed - command 'set -o pipefail && lxc-usernsexec -m u:0:100000:65536 -m g:0:100000:65536 -- tar cpf - --totals --one-file-system -p --sparse --numeric-owner --acls --xattrs '--xattrs-include=user.*' '--xattrs-include=security.capability' '--warning=no-file-ignored' '--warning=no-xattr-write' --one-file-system '--warning=no-file-ignored' '--directory=/mnt/pve/Diskstation/dump/vzdump-lxc-200-2023_11_03-16_33_10.tmp' ./etc/vzdump/pct.conf ./etc/vzdump/pct.fw '--directory=/mnt/vzsnap0' --no-anchored '--exclude=lost+found' --anchored '--exclude=./tmp/?*' '--exclude=./var/tmp/?*' '--exclude=./var/run/?*.pid' ./ | zstd --rsyncable '--threads=1' >/mnt/pve/Diskstation/dump/vzdump-lxc-200-2023_11_03-16_33_10.tar.dat' failed: exit code 2
INFO: Failed at 2023-11-03 16:33:11
INFO: Backup job finished with errors
TASK ERROR: job errors



I tried to backup to a FLASH drive directly at the NUC, but this did not work either - it actually did access the drive, but writing did not work somehow:

Code:
INFO: starting new backup job: vzdump 200 --storage USB-drive --notes-template '{{guestname}}' --node Proxmox --remove 0 --compress 0 --mode snapshot
INFO: filesystem type on dumpdir is 'devtmpfs' -using /var/tmp/vzdumptmp10242_200 for temporary files
INFO: Starting Backup of VM 200 (lxc)
INFO: Backup started at 2023-11-03 16:22:26
INFO: status = running
INFO: CT Name: Docker
INFO: including mount point rootfs ('/') in backup
INFO: backup mode: snapshot
INFO: ionice priority: 7
INFO: create storage snapshot 'vzdump'
  WARNING: You have not turned on protection against thin pools running out of space.
  WARNING: Set activation/thin_pool_autoextend_threshold below 100 to trigger automatic extension of thin pools before they get full.
  Logical volume "snap_vm-200-disk-0_vzdump" created.
  WARNING: Sum of all thin volume sizes (90.00 GiB) exceeds the size of thin pool pve/data and the size of whole volume group (55.39 GiB).
INFO: creating vzdump archive '/dev/usb-drive/dump/vzdump-lxc-200-2023_11_03-16_22_26.tar'
INFO: Total bytes written: 8274094080 (7.8GiB, ?/s)
INFO: tar: -: Wrote only 6144 of 10240 bytes
INFO: tar: Error is not recoverable: exiting now
INFO: cleanup temporary 'vzdump' snapshot
  Logical volume "snap_vm-200-disk-0_vzdump" successfully removed
ERROR: Backup of VM 200 failed - command 'set -o pipefail && lxc-usernsexec -m u:0:100000:65536 -m g:0:100000:65536 -- tar cpf - --totals --one-file-system -p --sparse --numeric-owner --acls --xattrs '--xattrs-include=user.*' '--xattrs-include=security.capability' '--warning=no-file-ignored' '--warning=no-xattr-write' --one-file-system '--warning=no-file-ignored' '--directory=/var/tmp/vzdumptmp10242_200' ./etc/vzdump/pct.conf ./etc/vzdump/pct.fw '--directory=/mnt/vzsnap0' --no-anchored '--exclude=lost+found' --anchored '--exclude=./tmp/?*' '--exclude=./var/tmp/?*' '--exclude=./var/run/?*.pid' ./ >/dev/usb-drive/dump/vzdump-lxc-200-2023_11_03-16_22_26.dat' failed: exit code 2
INFO: Failed at 2023-11-03 16:23:56
INFO: Backup job finished with errors
TASK ERROR: job errors

I also tried the other way - use Clonezilla to move to bigger SSD, but this tool also did not like my files and stopped executing.
BTW: the CT works flawlessly.

Not sure if backing up is somehow locked up because my file system is totally overcomitted to CT and VM... !? This is the issue I am targeting to resolve.


Thank you for any hint!!!
Morphy
 
Please use the forums search function. This was asked and solved uncountable times.

In short:
To back up unprivileged LXC the temporary storage (which defaults to a subdir of your target backup storage) both UID 0 and UID 100000 need write permissions. So either make sure UID 100000 on your NAS also got the rights to write to the share or edit your /etc/vzdump.conf and point the tmpdir to a folder with enough rights like "/tmp" which got 777.
 
Apologies - Yes I was not doing the proper search before. I make sure I do next time.
I edited /etc/vzdump.conf and pointed to "/TMP" and it runs nicely - tank you @Dunuin to help anyhow thats a nice gesture.
 

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!