backup abort because of chown
Bug-Report
When I perform a backup with ncp-backup, the process is aborted with the following error message:
chown: changing group of '/media/USBdrive/ncp-backups/nextcloud-bkp_20191003_1570136572.tar': Operation not permitted
Abort...
By deleting the following line in the ncp-backup script, the backup function works fine again (I don't know why the user group has to be changed for the backup):
chown :www-data "$destfile"
System information NextCloudPi version v1.17.1 NextCloudPi image NextCloudPi_07-21-19 distribution Raspbian GNU/Linux 10 \n \l automount yes USB devices sdb sdc datadir /media/myCloudDrive/ncdata data in SD no data filesystem btrfs data disk usage 1.2G/120G rootfs usage 2.1G/7.1G swapfile /swap dbdir /var/lib/mysql Nextcloud check ok Nextcloud version 16.0.5.1 HTTPD service up PHP service up MariaDB service up Redis service up Postfix service up internet check ok port check 80 closed port check 443 open IP REMOVED SENSITIVE VALUE gateway REMOVED SENSITIVE VALUE interface eth0 certificates REMOVED SENSITIVE VALUE NAT loopback no uptime 2:01
Thanks for repoting. I don't see why changing the group would not be permitted, as long as it is not a windows filesystem, which is not supported.
I had the same issue doing backups on an ZFS share I have mounted to my NextcloudPi. So my situation is a little different, but if anyone ends up here, this was my solution:
The problem is since ZFS on Linux 0.8.3 the no_root_squash is not set as default anymore. All files were created as nobody:nogroup and chown wasn't possible anymore.
Enabling no_root_squash again fixed it:
zfs set sharenfs='rw,no_root_squash' zpool/data
As alternative use /etc/exports/
# sudo nano /etc/exports
/zpool/data/ *(rw,no_subtree_check,sync,insecure,no_root_squash)
Bug-Report When I perform a backup with ncp-backup, the process is aborted with the following error message:
chown: changing group of '/media/USBdrive/ncp-backups/nextcloud-bkp_20191003_1570136572.tar': Operation not permitted Abort...By deleting the following line in the ncp-backup script, the backup function works fine again (I don't know why the user group has to be changed for the backup):
chown :www-data "$destfile"
Tried that and found out, that without the chown you get trouble, when restoring. but u can fix that manually:
- in case of restoring copy the Backup file to local folder on nextcloudpi
- "chown :www-data" the backup file before restoring
- restore the smoothly prepared backup file in nextcloudpi panel
Just in case anyone has this problem with a USB drive with FAT, exFAT or NTFS filesystem on it, you need to format the drive with a Linux filesystem, like ext4.
-
Find path of USB stick
lsblk
-
If mounted, unmount it
sudo umount /mnt/usbstick/(example) -
Create filesystem
sudo mkfs.ext4 /dev/sda1(example) -
Mount it
sudo mount -t auto /dev/sda1 /mnt/usbstick/(example) -
Make it permanent Get UUID of USB drive
blkid
Edit fstab file
sudo nano /etc/fstabAdd the following lineUUID=87ad3eff-8894-4c5f-8528-wh4t3v3rth3number15 /mnt/usbstick auto defaults,nofail
Stumbled on this issue also. Thx @RayCulp, exFat was the problem in my case.
After sudo mkfs.ext4 /dev/sda1 i would suggest an sudo e2label /dev/sda1 backup to give the partition a descriptive name for the usb automount function. With the automount function of Nextcloudpi you don't need to fiddle with fstab, it gets mounted on /media/backup.