1

I'm having problems using owncloud docker with external hard disk on a Raspberry Pi 4.

The OS version I'm using is the following:

PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"

It's the 64 bit architecture.

What I wanna do is having all my owncloud data on an external hard disk. When I launch the docker-compose up -d command the owncloud_server docker starts, but it fails to gain permission over some files, and it blocks there.

I've tried all the combinations of users (pi, root, www-data, 1000:1000) and of permissions (over folder and external hard disk). Depending on the combination, I get stuck at different errors, but still I'm not capable of effectively start the owncloud server.

Here in the following you can see the hard disk mount option I'm using:

UUID=XXXXXXXXXXXXXXXX /mnt/toshiba_extdisk ntfs-3g defaults,umask=000,users 0 0

Here you can find the docker-compose.yml file I'm using:

docker compose:  
version: "3"
volumes:
#  dati:
#    driver: local
#    driver_opts:
#     type: none
#     device: /mnt/toshiba_extdisk/owncloud
#     o: bind
  mysql:
    driver: local
  redis:
    driver: local
  caddy_data:
  caddy_config:

services:
  owncloud:
    image: owncloud/server:${OWNCLOUD_VERSION}
    container_name: owncloud_server
    restart: always
    user: www-data

#    ports:
#      - ${HTTP_PORT}:8080
    depends_on:
      - mariadb
      - redis
    environment:
      - OWNCLOUD_DOMAIN=${OWNCLOUD_DOMAIN}
      - OWNCLOUD_TRUSTED_DOMAINS=${OWNCLOUD_TRUSTED_DOMAINS}
      - OWNCLOUD_DB_TYPE=mysql
      - OWNCLOUD_DB_NAME=owncloud
      - OWNCLOUD_DB_USERNAME=username
      - OWNCLOUD_DB_PASSWORD=password
      - OWNCLOUD_DB_HOST=mariadb
      - OWNCLOUD_ADMIN_USERNAME=${username}
      - OWNCLOUD_ADMIN_PASSWORD=${password}
      - OWNCLOUD_MYSQL_UTF8MB4=true
      - OWNCLOUD_REDIS_ENABLED=true
      - OWNCLOUD_REDIS_HOST=redis
    healthcheck:
      test: ["CMD", "/usr/bin/healthcheck"]
      interval: 30s
      timeout: 10s
      retries: 5
    volumes:
      - /mnt/toshiba_extdisk/owncloud:/mnt/data:rw

  mariadb:
    image: mariadb:10.6 # minimum required ownCloud version is 10.9
    container_name: owncloud_mariadb
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=password
      - MYSQL_USER=username
      - MYSQL_PASSWORD=password
      - MYSQL_DATABASE=owncloud
    command: ["--max-allowed-packet=128M", "--innodb-log-file-size=64M"]
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-u", "root", "--password=password"]
      interval: 10s
      timeout: 5s
      retries: 5
    volumes:
      - mysql:/var/lib/mysql

  redis:
    image: redis:6
    container_name: owncloud_redis
    restart: always
    command: ["--databases", "1"]
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 5
    volumes:
      - redis:/data
  caddy:
    image: caddy:2
    restart: "no"
    ports:
     - 443:443/udp
     - 443:443
     - 80:80
    volumes:
     - $PWD/Caddyfile:/etc/caddy/Caddyfile
     - caddy_data:/data
     - caddy_config:/config

Here is the creation of the docker server:

➜  owncloud-docker-server docker-compose up -d
Creating owncloud_redis                 ... done
Creating owncloud_mariadb               ... done
Creating owncloud-docker-server_caddy_1 ... done
Creating owncloud_server                ... done

Here the logs results: (for sake of clariness i reported just the first try)

sudo docker logs -f owncloud_server
Creating volume folders...
Creating hook folders...
Waiting for MySQL...
services are ready!
Waiting for Redis...
services are ready!
Removing custom folder...
Linking custom folder...
Removing config folder...
Linking config folder...
Writing config file...
Fixing base perms...
chown: changing ownership of '/var/www/owncloud/custom': Operation not permitted
chown: changing ownership of '/var/www/owncloud/config': Operation not permitted

Here are the actual permission of the hard disk and of the folder where the data will be stored:

drwxrwxrwx  1 root root 16384 Nov 22 23:58 toshiba_extdisk
drwxrwxrwx 1 root root        440 Nov 23 08:58  owncloud

If in the docker-compose.yml file I change user: www-data to user: root, I get the following error:

➜  owncloud-docker-server docker logs -f owncloud_server
Creating volume folders...
Creating hook folders...
Waiting for MySQL...
services are ready!
Waiting for Redis...
services are ready!
Removing custom folder...
Linking custom folder...
Removing config folder...
Linking config folder...
Writing config file...
Fixing base perms...
Fixing data perms...
Fixing hook perms...
Upgrading server database...
Console has to be executed with the user that owns the file config/config.php
Current user: www-data
Owner of config.php: root
Try adding 'sudo -u root ' to the beginning of the command (without the single quotes)
Console has to be executed with the user that owns the file config/config.php
Current user: www-data
Owner of config.php: root
Try adding 'sudo -u root ' to the beginning of the command (without the single quotes)
Writing objectstore config...
Writing php config...
Updating htaccess config...
Console has to be executed with the user that owns the file config/config.php
Current user: www-data
Owner of config.php: root
Try adding 'sudo -u root ' to the beginning of the command (without the single quotes)
0

1 Answer 1

1

Change your hard drive's file system from ntfs-3g to ext4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.