Mengatasi Error ” Tar : permission denied ” ketika Backup LXC proxmox ke nfs storage

Bismillah ..

berikut log error ketika backup container di proxmox ke nfs storage

INFO: starting new backup job: vzdump 109 --mode snapshot --node cloud1 --storage synology-nfs --remove 0 --compress zstd
INFO: Starting Backup of VM 109 (lxc)
INFO: Backup started at 2022-08-06 08:09:02
INFO: status = running
INFO: CT Name: ha-proxy-222.10
INFO: including mount point rootfs ('/') in backup
INFO: excluding bind mount point mp0 ('/tmp') from backup (not a volume)
INFO: backup mode: snapshot
INFO: ionice priority: 7
INFO: create storage snapshot 'vzdump'
Logical volume "snap_vm-109-disk-0_vzdump" created.
INFO: creating vzdump archive '/mnt/pve/synology-nfs/dump/vzdump-lxc-109-2022_08_06-08_09_02.tar.zst'
INFO: tar: /mnt/pve/synology-nfs/dump/vzdump-lxc-109-2022_08_06-08_09_02.tmp: Cannot open: Permission denied
INFO: tar: Error is not recoverable: exiting now
INFO: cleanup temporary 'vzdump' snapshot
Logical volume "snap_vm-109-disk-0_vzdump" successfully removed
ERROR: Backup of VM 109 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/synology-nfs/dump/vzdump-lxc-109-2022_08_06-08_09_02.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/synology-nfs/dump/vzdump-lxc-109-2022_08_06-08_09_02.tar.dat' failed: exit code 2
INFO: Failed at 2022-08-06 08:09:03
INFO: Backup job finished with errors
TASK ERROR: job errors

Problem di atas di karenakan lxc mebutuhkan folder yang bisa di tulis secara langsung oleh container (uid : 100000) maka solusi nya adalah

  1. Pastikan folder nfs nya writeable untuk uid 100000 (uid root di container proxmox)
  2. Ada yang menyaran kan bisa chmod ke 777 folder nfs nya agar writeable oleh uid: 100000
  3. Edit file /etc/vzdump.conf dan ganti tmp dir default nya ke directory yang writeable semua uid , ada yang menyaran kan pindah tmdir nya ke /tmp yang dia di set 777 secara default

folder nfs di set 777

root@cloud1:~# ls -l /mnt/pve/synology-nfs/
total 0
drwxrwxrwx 1 root root 6758 Aug 6 08:13 dump
drwxrwxrwx 1 root root 22 Apr 19 2021 '#recycle'
drwxrwxrwx 1 root root 16 Apr 20 2021 template
root@cloud1:~#

Edit vzdump.conf dan set tmp dir ke /tmp

kemudian test lagi backup ke nfs nya

Task viewer: VM/CT 109 - BackupOutputStatusStopINFO: starting new backup job: vzdump 109 --compress zstd --node cloud1 --mode snapshot --remove 0 --storage synology-nfs
INFO: Starting Backup of VM 109 (lxc)
INFO: Backup started at 2022-08-06 08:12:52
INFO: status = running
INFO: CT Name: ha-proxy-222.10
INFO: including mount point rootfs ('/') in backup
INFO: excluding bind mount point mp0 ('/tmp') from backup (not a volume)
INFO: backup mode: snapshot
INFO: ionice priority: 7
INFO: create storage snapshot 'vzdump'
Logical volume "snap_vm-109-disk-0_vzdump" created.
INFO: creating vzdump archive '/mnt/pve/synology-nfs/dump/vzdump-lxc-109-2022_08_06-08_12_52.tar.zst'
INFO: Total bytes written: 1017866240 (971MiB, 86MiB/s)
INFO: archive file size: 288MB
INFO: cleanup temporary 'vzdump' snapshot
Logical volume "snap_vm-109-disk-0_vzdump" successfully removed
INFO: Finished Backup of VM 109 (00:00:13)
INFO: Backup finished at 2022-08-06 08:13:05
INFO: Backup job finished successfully
TASK OK

semoga bermanfaat

No Comments, Be The First!

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.