I have a fresh install of NCP on Raspberry Pi, updated to latest versions. I have an external SSD attached, and was able to move database and swap to the SSD. But not the datadir. I did create the ncdata directory, so it exists.
Running nc-datadir
Nextcloud is in maintenance mode - no apps have been loaded
INFO: /media/MX500/ncdata is not empty. Creating backup /media/MX500/ncdata-09-11-19
Maintenance mode already enabled
moving data directory from /var/www/nextcloud/data to /media/MX500/ncdata…
/usr/local/bin/ncp/CONFIG/nc-datadir.sh: line 73: cd: /media/MX500/ncdata: No such file or directory
cp: cannot create directory ‘’: No such file or directory
Done. Press any key…
I finally managed to move the datadir to the USB disk. I found instructions on how to do it manually here: https://pimylifeup.com/raspberry-pi-nextcloud-server/ “Moving Nextcloud’s data folder”.
I also needed to run nc-fix-permissions.
after setup, wizard start for change of data directory to usb storage:
[ nc-automount ]
Created symlink /etc/systemd/system/multi-user.target.wants/nc-automount.service → /usr/lib/systemd/system/nc-automount.service.
Created symlink /etc/systemd/system/multi-user.target.wants/nc-automount-links.service → /usr/lib/systemd/system/nc-automount-links.service.
automount enabled
[ nc-format-USB ]
/dev/sda: 8 bytes were erased at offset 0x00000200 (gpt): 45 46 49 20 50 41 52 54
/dev/sda: 8 bytes were erased at offset 0xdf90355e00 (gpt): 45 46 49 20 50 41 52 54
/dev/sda: 2 bytes were erased at offset 0x000001fe (PMBR): 55 aa
Drive sda formatted successfuly and labeled myCloudDrive
[ nc-datadir ]
Maintenance mode enabled
moving data directory from /var/www/nextcloud/data to /media/USBdrive/ncdata…
BTRFS filesystem detected
ERROR: target path already exists: /media/myCloudDrive/ncdata
but when I switch to ncp control panel to use nc-datadir with the Data directory:
/media/myCloudDrive/ncdata
it gives:
[ nc-datadir ]
Nextcloud is in maintenance mode - no apps have been loaded
INFO: /media/myCloudDrive/ncdata is not empty. Creating backup /media/myCloudDrive/ncdata-09-13-19
Maintenance mode already enabled
moving data directory from /var/www/nextcloud/data to /media/myCloudDrive/ncdata…
BTRFS filesystem detected
ERROR: target path already exists: /media/myCloudDrive/ncdata
the actual status of ncp-report gives:
<–! Paste this in GitHub report →
NextCloudPi diagnostics
cat: /usr/local/etc/ncp-version: No such file or directory
Nextcloud is in maintenance mode - no apps have been loaded
NextCloudPi version
distribution Raspbian GNU/Linux 10 \n \l
automount yes
USB devices sda
datadir /var/www/nextcloud/data
data in SD yes
data filesystem ext2/ext3
data disk usage 2.1G/29G
rootfs usage 2.1G/29G
swapfile /var/swap
dbdir /var/lib/mysql
Nextcloud check ok
Nextcloud version 16.0.4.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 closed
IP ***REMOVED SENSITIVE VALUE***
gateway ***REMOVED SENSITIVE VALUE***
interface eth0
certificates ***REMOVED SENSITIVE VALUE***
NAT loopback no
uptime 31min
nc-automount shows
systemctl status nc-automount
● nc-automount.service - Automount USB drives
Loaded: loaded (/usr/lib/systemd/system/nc-automount.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2019-09-13 14:56:00 BST; 3h 3min ago
Process: 402 ExecStartPre=/bin/bash -c rmdir /media/* || true (code=exited, status=0/SUCCESS)
Main PID: 416 (udiskie)
Tasks: 3 (limit: 4915)
Memory: 14.7M
CGroup: /system.slice/nc-automount.service
└─416 /usr/bin/python3 /usr/bin/udiskie -NTF
Sep 13 14:56:00 raspberrypi systemd[1]: Starting Automount USB drives...
Sep 13 14:56:00 raspberrypi bash[402]: rmdir: failed to remove '/media/USBdrive': Not a directory
Sep 13 14:56:00 raspberrypi systemd[1]: Started Automount USB drives.
Sep 13 14:56:02 raspberrypi udiskie[416]: mounted /org/freedesktop/UDisks2/block_devices/sda1 on /media/myCloudDrive
what is wrong with my automount? or btfrs subvolumes?
what I’m doing wrong in this easy setup?
I’m running a nextcloud instance on an vps server since two years without a flaw, but I fail to scan this raspberrypi-nextcloud .sh scripts … I’m lost… any help is highly welcome…
Hi nachoparker,
first of all, thanks for your fast reply.
tried the development branche and that solved the problem.
datadir and database could be moved without a problem.
just for the sake of learning: can you point me to the problem in the actual ncp version? what script fails, why is it the fail2ban fix? that is not even close to what i thought about the btrfs subvolume mounting point or the nc-datadir.sh lines i’ve highlighted above.
I moved the point where the directory is created, but didn’t realize that in the BTRFS case it assumes that it doesn’t exist, so the btrfs command fails