Hello,
I have installed nextcloud with the snap method. Everything is going well but I am out of space. So I have bought a new hard drive. The problem is that I do not manage to move the data directory to the new hard drive. Let me summarize what I have done:
- Plug the HDD
- Create a location
/media/HDD_storage
- Change the
/etc/fstab
file by adding a new lineUUID=... /media/HDD_storage ext4 defaults 0 2
- Reboot my computer to automount the disk
- Then I have followed the guide from the github page Nextcloud-snap
$ sudo mkdir -p /media/HDD_storage/nextcloud
$ sudo chown -R root:root /media/HDD_storage/nextcloud
- I stop the snap running
$ sudo snap stop nextcloud
- I have change the path to the new directory in the
config.php
file
// ...
'datadirectory' => '/media/HDD_storage/nextcloud/data',
// ...
- For the first try I did
$ sudo cp -R /var/snap/nextcloud/common/nextcloud/data /media/HDD_storage/nextcloud/
- The first try was not working so I tried this after removing the previous folder
$ sudo mv /var/snap/nextcloud/common/nextcloud/data /media/HDD_storage/nextcloud/
- Finally I restart the snap
$ sudo snap start nextcloud
Unfortunately, it does not work. I get the following error message from the browser:
Your data directory is invalid Ensure there is a file called ".ocdata" in the root of the data directory. Cannot create "data" directory This can usually be fixed by giving the webserver write access to the root directory. See https://docs.nextcloud.com/server/22/go.php?to=admin-dir_permissions
I do not understand why this file is missing because I try with mv
and cp -R
. After the mv
command try, I move back the directory, still with mv
, and I went back to the first config.php
file
'datadirectory' => '/var/snap/nextcloud/common/nextcloud/data'
and know it is working again but I am still out of space.
Could someone help me to understand what is wrong?
Thanks for reading.