Unable to read/ write data from an external local drive

I have installed Nextcloud behind a docker container on a server. I have an external ext4 (hardware raid 1) drive mounted with www-data drwxrwxrw- permissions, although I have tried others. In my docker-compose.yaml I pass the drive over: app:
image: nextcloud:fpm-alpine
restart: always
volumes:
- nextcloud:/var/www/html:z
- /media/raidy:/usr/local/DATA:z
environment:
- MYSQL_HOST=db
- REDIS_HOST=redis
env_file:
- db.env
depends_on:
- db
- redis
I then import /usr/local/DATA using the nextcloud external drive feature. It appears under this mounting point and can take a friendly name, however no files inside this location are visible, and I cannot write files or make directories inside this external folder. I can within nextcloud’s /var/www/html. What am I doing wrong and now should I get read and write access to this folder? Many thanks

Your setup with Nextcloud behind a Docker container sounds promising, but it seems like you’re encountering issues with read and write access to your external drive. Let’s troubleshoot this together:

Firstly, ensure that the permissions on your external ext4 drive are set correctly. Since you’ve mounted it with www-data permissions, make sure that the www-data user within the Docker container has the necessary permissions to read and write to this drive.

Next, verify the permissions and ownership of the mounted directory (/media/raidy) on your server. Ensure that it is accessible and writable by the www-data user.

In your docker-compose.yaml, you’ve correctly passed the drive over to the Nextcloud container using the volumes section. However, it’s crucial to ensure that the permissions and ownership are properly preserved when mounting the volume. The “:z” option you’ve used should help with this, but double-check to confirm.

Additionally, ensure that SELinux or any other security mechanisms are not interfering with the permissions within the Docker container.

If you’re still facing issues, try troubleshooting within the Nextcloud interface. Check the Nextcloud logs for any error messages related to file permissions or access issues. It’s possible that Nextcloud itself may have specific requirements or configurations for accessing external storage.

Overall, it seems like you’re on the right track with your setup, but it’s essential to verify and adjust the permissions and ownership settings to ensure seamless access to your external drive within the Nextcloud environment. Good luck, and feel free to reach out if you need further assistance!