Cannot create or write into the data directory /media/veracrypt1/nextcloud-data

Whenever i try to set custom place for my data folder i get: Cannot create or write into the data directory /media/veracrypt1/nextcloud-data

Even tho i changed permissions for nextcloud to be able to use it:

esmailelbob@debian:/media/veracrypt1$ sudo ls -la | grep nextcloud-data
drwxrwxr-x 1 www-data www-data       0 Nov 20 04:11 nextcloud-data

What file system do you have in Veracrypt container?
What is the size of the Veracrypt container?

btw.:
Why do you use Veracrypt instead of Nextclouf encryption?

Because i used veracrypt before, anyways now i formatted my drive and it’s ext4 and it’s size 2TB, i tried to do same thing and still get same error

ls -la /media/esmailelbob/51d3be75-d88e-4216-8a3b-cbb20431153e/nextcloud-data
total 20
drwxr-xr-x 2 www-data root     4096 Nov 20 06:05 .
drwxrwxr-x 4 root     www-data 4096 Nov 20 06:03 ..
-rw-r--r-- 1 www-data www-data  542 Nov 20 06:05 .htaccess
-rw-r--r-- 1 www-data www-data    0 Nov 20 06:05 index.html
-rw-r----- 1 www-data www-data 5029 Nov 20 06:05 nextcloud.log

I just compared the permissions mit my UCS Nextcloud installation:
drwxrwx— 16 www-data www-data 4096 Okt 17 14:10 nextcloud-data
is im my computer set by installation and the sub folders :slight_smile:
drwxrwxr-x 2 www-data www-data 4096 Dez 12 2020

What about errors, if you try to create the data folder outside the Veracrypt container?

i do not get it?

about veracrypt forget it, i formatted my drive and it’s now normal HDD and i can’t create files as HDD under www group and i’m normal user

Uh i hate docker so fucking much at this point (because i’m dumb i admit it)

so my problem was, i needed to map volume in my docker-compose.yml file
so i mounted my HDD (sudo mkdir /mnt/cloud && sudo mount /dev/sdc1 /mnt/cloud (use lsblk to see your USB device name))

then i added this line
- /mnt/cloud/:/var/www/html/dat
(so my docker file would be like)

version: '2'

volumes:
  nextcloud:
  db:

services:
  db:
    image: mariadb:10.5
    restart: always
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=AbcDef
      - MYSQL_PASSWORD=AbcDef
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
  app:
    image: nextcloud:fpm
    restart: always
    links:
      - db
    volumes:
      - nextcloud:/var/www/html
      - /mnt/cloud/:/var/www/html/data
#      - /media/veracrypt1/nextcloud-data:/data
     # - ./config:/var/www/html/config
#      - /media/esmailelbob/51d3be75-d88e-4216-8a3b-cbb20431153e/nextcloud-data:/var/www/html/data
    environment:
      - MYSQL_PASSWORD=
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db

  web:
    image: nginx
    restart: always
    ports:
      - 8585:80
    links:
      - app
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    volumes_from:
      - app

Then i re-installed nextcloud (sudo docker-compose down -v && sudo docker-compose up -d)

And in webui (usually localhost:8080) i kept the file location the defualt because it seems docker is dumb (or maybe me) and it does not see files in linux but sees files mapped inside docker-compose file so yes because i mapped it above to it’s default name i kept the data location as default and made my account and boom it worked!