Backup Fehler 'tar: Permission denied'

Dec 14, 2022
34
1
8
Hi,
habe heute einen NFS Share als Backup Verzeichnis auf meiner Synology angelegt. Bekomme beim Backup immer einen Fehler wegen der Zugriffsrechte.
Code:
INFO: starting new backup job: vzdump --mailnotification always --mode snapshot --notes-template '{{guestname}}' --node merlin --mailto montino@gmx.net --all 1 --compress zstd --storage Lan24TB --prune-backups 'keep-last=2'
INFO: Starting Backup of VM 100 (lxc)
INFO: Backup started at 2022-12-21 19:48:40
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'
  Logical volume "snap_vm-100-disk-0_vzdump" created.
INFO: creating vzdump archive '/mnt/pve/Lan24TB/dump/vzdump-lxc-100-2022_12_21-19_48_40.tar.zst'
INFO: tar: /mnt/pve/Lan24TB/dump/vzdump-lxc-100-2022_12_21-19_48_40.tmp: Cannot open: Permission denied
INFO: tar: Error is not recoverable: exiting now
INFO: cleanup temporary 'vzdump' snapshot
  Logical volume "snap_vm-100-disk-0_vzdump" successfully removed
ERROR: Backup of VM 100 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/Lan24TB/dump/vzdump-lxc-100-2022_12_21-19_48_40.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/Lan24TB/dump/vzdump-lxc-100-2022_12_21-19_48_40.tar.dat' failed: exit code 2
INFO: Failed at 2022-12-21 19:48:41
INFO: Starting Backup of VM 101 (lxc)
INFO: Backup started at 2022-12-21 19:48:41
INFO: status = running
INFO: CT Name: PiHole
INFO: including mount point rootfs ('/') in backup
INFO: mode failure - some volumes do not support snapshots
INFO: trying 'suspend' mode instead
INFO: backup mode: suspend
INFO: ionice priority: 7
INFO: CT Name: PiHole
INFO: including mount point rootfs ('/') in backup
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/2731/root/ to /mnt/pve/Lan24TB/dump/vzdump-lxc-101-2022_12_21-19_48_41.tmp
ERROR: Backup of VM 101 failed - command 'rsync --stats -h --numeric-ids -aH --delete --no-whole-file --sparse --one-file-system --relative '--exclude=/tmp/?*' '--exclude=/var/tmp/?*' '--exclude=/var/run/?*.pid' /proc/2731/root//./ /mnt/pve/Lan24TB/dump/vzdump-lxc-101-2022_12_21-19_48_41.tmp' failed: exit code 23
INFO: Failed at 2022-12-21 19:50:32
INFO: Starting Backup of VM 102 (lxc)
INFO: Backup started at 2022-12-21 19:50:32
INFO: status = stopped
INFO: backup mode: stop
INFO: ionice priority: 7
INFO: CT Name: Wireguard
INFO: including mount point rootfs ('/') in backup
INFO: creating vzdump archive '/mnt/pve/Lan24TB/dump/vzdump-lxc-102-2022_12_21-19_50_32.tar.zst'
INFO: tar: /mnt/pve/Lan24TB/dump/vzdump-lxc-102-2022_12_21-19_50_32.tmp: Cannot open: Permission denied
INFO: tar: Error is not recoverable: exiting now
ERROR: Backup of VM 102 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/Lan24TB/dump/vzdump-lxc-102-2022_12_21-19_50_32.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/Lan24TB/dump/vzdump-lxc-102-2022_12_21-19_50_32.tar.dat' failed: exit code 2
INFO: Failed at 2022-12-21 19:50:32
INFO: Starting Backup of VM 103 (lxc)
INFO: Backup started at 2022-12-21 19:50:32
INFO: status = running
INFO: CT Name: heimdall
INFO: including mount point rootfs ('/') in backup
INFO: backup mode: snapshot
INFO: ionice priority: 7
INFO: create storage snapshot 'vzdump'
  Logical volume "snap_vm-103-disk-0_vzdump" created.
INFO: creating vzdump archive '/mnt/pve/Lan24TB/dump/vzdump-lxc-103-2022_12_21-19_50_32.tar.zst'
INFO: tar: /mnt/pve/Lan24TB/dump/vzdump-lxc-103-2022_12_21-19_50_32.tmp: Cannot open: Permission denied
INFO: tar: Error is not recoverable: exiting now
INFO: cleanup temporary 'vzdump' snapshot
  Logical volume "snap_vm-103-disk-0_vzdump" successfully removed
ERROR: Backup of VM 103 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/Lan24TB/dump/vzdump-lxc-103-2022_12_21-19_50_32.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/Lan24TB/dump/vzdump-lxc-103-2022_12_21-19_50_32.tar.dat' failed: exit code 2
INFO: Failed at 2022-12-21 19:50:33
INFO: Starting Backup of VM 104 (qemu)
INFO: Backup started at 2022-12-21 19:50:33
INFO: status = stopped
INFO: backup mode: stop
INFO: ionice priority: 7
INFO: VM Name: Ubuntu-22.04
INFO: include disk 'scsi0' 'HDD-2-1:vm-104-disk-0' 32G
INFO: creating vzdump archive '/mnt/pve/Lan24TB/dump/vzdump-qemu-104-2022_12_21-19_50_33.vma.zst'
INFO: starting kvm to execute backup task

Soweit ich raufinden konnte, liegt es wohl an den unpriviligierten Containern.
Habe das schon gemacht, hilft aber nicht. Dann habe ich diesen thread gefunden. Bei mir sieht das anders aus:
Screenshot 2022-12-21 200440.png
Da ich leider nur wenig Anhnung von den permissions habe traue ich mich nicht recht, das vorgeschlagene chmod 755 zu machen, oder ist das die Lösung. Wie gesagt squash hat bei mir nix gebracht...

Edit: Sorry, das es jetzt zwei Beiträge hierzu von mir gibt. Der andere war eben verschwunden, daher hab ich nochmal einen Beitrag erstellt. Sorry!!!
 
Last edited:
Führe den folgenden Befehl aus und ersetze your_username durch deinen Benutzernamen, um das Berechtigungsproblem zu beheben: chown -R your_username /mnt/pve/Lan24TB
 
  • Like
Reactions: FlyByWire
Das Problem bei unprivilegierten LXCs ist, dass da sowohl UID 0 als auch UID 100000 Schreib- und Leserechte auf deinem Netzwerkshare haben müssen. Also entweder musst du
1.) den UIDs bei deinem NFS-/SMB-Server entsprechende Rechte einräumen oder
2.) den NFS/SMB Share für jeden frei zugänglich machen (z.B. chmod 755) oder
3.) du editierst die /etc/vzdump.conf und setzt dort den "tmpdir" auf ein Verzeichnis wo beide UIDs drauf schreiben dürfen (z.B. "/tmp" was das 777 Rechte hat)
 
  • Like
Reactions: FlyByWire
1.) den UIDs bei deinem NFS-/SMB-Server entsprechende Rechte einräumen
Hätte das nicht dann auch mit dem squash Map all users to admin auf der Synology funktionieren müssen?

2.) den NFS/SMB Share für jeden frei zugänglich machen (z.B. chmod 755)
Mein share hat, wenn ich das richtig verstehe ja 777. Sollte doch dann auch gehen, oder?

3.) du editierst die /etc/vzdump.conf und setzt dort den "tmpdir" auf ein Verzeichnis wo beide UIDs drauf schreiben dürfen (z.B. "/tmp" was das 777 Rechte hat)
Das habe ich schon gemacht, funktioniert auch. /tmp schreibt ja vermutlich auf die Systempartition?! Das ist eine NVMe, habe noch zwei HDD (sda und sdb). Um nicht unnötig auf der NVMe zu schreiben, würde ich lieber hier zwischen speichern. Kann ich also statt /tmp auch z.b. sdb angeben?
 
Hätte das nicht dann auch mit dem squash Map all users to admin auf der Synology funktionieren müssen?
Ich nutz hier kein Synology. Musst du mal das Forum durchsuchen. Hier fragen ständig Leute wie sie NFS/SMB Shares auf QNAP/Synology/TrueNAS für Backups von unprivilegierte LXCs zum Laufen bekommen. Da hat bestimmt wer seine Lösung mitgeteilt, wie man da was genau in der Synology einzustellen hat, damit das mit den Rechten funktioniert.

Mein share hat, wenn ich das richtig verstehe ja 777. Sollte doch dann auch gehen, oder?
Ja, 777 sollte dann auch gehen.

Das habe ich schon gemacht, funktioniert auch. /tmp schreibt ja vermutlich auf die Systempartition?!
Ja, sofern du nicht manuell ramfs/tmpfs für /tmp aktiviert hast, wo dann temporäre Daten im RAM landen würden.
Das ist eine NVMe, habe noch zwei HDD (sda und sdb). Um nicht unnötig auf der NVMe zu schreiben, würde ich lieber hier zwischen speichern. Kann ich also statt /tmp auch z.b. sdb angeben?
Kannst du in einen beliebigen lokalen Ordner schreiben. Der sollte hat nur entsprechende Rechte habe.
 

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!