Problem when changing data directory

Hello world !

So, after literally 6 hours of try and retry I am giving up. I’ve seen a looot of people strugling with the same problem as I but all solutions I’ve found do not seem to work for me. So here goes :

I installed my nextcloud server on a ubuntu 22.04 machine, on the main drive which has the system (a small SSD). However my data is on harddrives. One of them I want to dedicate fully to nextcloud. It is mounted and formated in ext4. The path to it is media/gordon/HDD_SAMS_25.

I tried to move the data directory.
mkdir media/gordon/HDD_SAMS_25/nextclouddata
chown -R www-data:www-data media/gordon/HDD_SAMS_25/nextclouddata

And updated the config.php in the www/nextcloud install dir.

And since then, it is telling me that .ocdata isn’t found. I tried creating it via touch. I check 100 times the permissions and they look ok. I am out of ideas.

Thanks !

Here is the HowTo, which might help. HowTo: Change / Move data directory after installation

Since it’s a hidden file, it probably got skipped and is still in the original location.

Also, when moving your data, ensure you maintain file and folder timestamps.

If this is basically a new install, you may find it easier to just make the data folder originally Bally in this new location, rather than trying to move it.

Hi there. It is indeed a fresh install so nothing to move really. I’ll check the ocdata but when I did a touch followed by a ls to see what was in the directory (even with root user) it seems ocdata isn’t really created. Can’t understand why.
Originally I wanted to install straight from the start with the new directory but also with no luck. It kept telling me he didn’t had the rights to the folder.

Is it not /media/…/ with a beginning slash?

Do you know about hidden “dot files” in Linux? They aren’t shown in a normal ls. You have to use something like ls -a. They can also be skipped by a command like mv * so that’s why I say it may have been left behind in the original folder.

For the new data folder you’ll need:

  • chown www-data:www-data /media/gordon/HDD_SAMS_25/nextclouddata
  • chmod 750 /media/gordon/HDD_SAMS_25/nextclouddata

Prepare the folder like that before installing and make sure it’s empty including hidden files and it should work.