Hey there. Yesterday I received my new Raspberry Pi 4 (8 GB) that I wanted for my NextcloudPi server. I asked help on Telegram group (https://t.me/NextCloudPi/40931) and now I’m here looking for more help and hoping that this post will help more people.
I launched ncp-backup command more than 12 hours ago, I just checked the state of the backup now, and the nextcloud-bck file has gone, I get this on terminal:
Running nc-backup
check free space...
clean up old backup /media/USBDRIVE1/nebula/backups/nextcloud-bkp_20200911_1599827190.tar.gz
Maintenance mode enabled
backup database...
backup files...
chown: changing group of '/media/USBDRIVE1/nebula/backups/nextcloud-bkp_20201116_1605529641.tar.gz': Operation not permitted
Abort...
rm: cannot remove '/media/USBDRIVE1/nebula/backups/nextcloud-bkp_20201116_1605529641.tar.gz': Input/output error
Maintenance mode disabled
Done. Press any key...
Thanks bro. Looks to be a permissions issue as described in this recent guide.
Try changing recursive ownership from root to www-data as shown below. Note, you might want to include the parent directories as well: $ sudo chown www-data:www-data -R /media/USBDRIVE1/nebula/backups/
pi@nextcloudpi:/media/USBDRIVE1 $ sudo -v
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for pi:
pi@nextcloudpi:/media/USBDRIVE1 $ sudo -v
pi@nextcloudpi:/media/USBDRIVE1 $ sudo usermod -a -G www-data pi
pi@nextcloudpi:/media/USBDRIVE1 $ sudo chown www-data:www-data -R /media/USBDRIVE1/nebula/
chown: changing ownership of '/media/USBDRIVE1/nebula/backups/ncp-config_20200911.tar': Operation not permitted
chown: changing ownership of '/media/USBDRIVE1/nebula/backups': Operation not permitted
chown: changing ownership of '/media/USBDRIVE1/nebula/': Operation not permitted
pi@nextcloudpi:/media/USBDRIVE5 $ ls
lost+found ncdata ncdatabase
and another that I connect to the Raspberry when I want to make a backup, USBDRIVE1 is used for other things.
nebula is the name i’ve given to my Nextcloud server.
root@nextcloudpi:/media/USBDRIVE1/nebula# chown www-data:www-data -R /media/USBDRIVE1/nebula/
chown: changing ownership of '/media/USBDRIVE1/nebula/backups/ncp-config_20200911.tar': Operation not permitted
chown: changing ownership of '/media/USBDRIVE1/nebula/backups': Operation not permitted
chown: changing ownership of '/media/USBDRIVE1/nebula/': Operation not permitted
You are getting I/0 errors, so chances are either your HDD is failing, or it is not receiving enough power. Then you get permissions denied because probably it is mounting itself read only after the I/0 error.
Do not power it from the PI USB port. Get a dedicated good quality PSU for it.