Externe HDD mit Docker auf ncp

Hallo allerseits,

Ich habe mir über diesen Link ncp auf einen Docker Container auf meiner RPI 4 installiert. Das klappt auch alles ganz prima. Aktivierung hat funktioniert. Ich sehe die externe Festplatte als sda1 in Einstellungen -> System. Das Problem ist, dass ich keine Daten auf die Festplatte schreibe. Sprich, wenn ich eine Datei hochlade, dann sehe ich die Belegung der overlay und root Partition, aber nicht der sda1 Partition.

Jetzt ist meine Frage: Wie schaffe ich es, dass die Daten auf die externe Festplatte geschrieben werden? Welche Datei muss ich da bearbeiten und den passenden Pfad eintragen?

Viele Grüße
Sebastian

Veröffentlichen Sie die Ausgabe von nc-info, damit wir sehen können, wie Sie dies eingerichtet haben. Bitte senden Sie auch Ihren Docker-Ausführungsbefehl, den Sie verwendet haben.

Überprüfen Sie Ihre Berechtigungen, um sicherzustellen, dass Sie www-data sowohl für Benutzer als auch für Gruppen ordnungsgemäß besitzen.

Ich kann kein Deutsch. Ich hoffe das macht Sinn.

Hi just,

sorry for writing in german, I can of course write in english as well. But I really appreciate, you translated my original post! :pray:t3:

The command to start the container was

docker run -d -p 4443:4443 -p 443:443 -p 8080:80 -v /var/www/nextcloud:/data --restart unless-stopped --name nextcloudpi ownyourbits/nextcloudpi 192.168.xxx.xx

About the rights:

  • The folder /var belongs to root, anyone can access and read, but only root can change. Is this the problem?
  • The folder /var/www belongs to the www-data. Again, anyone can access and read, but only www-data can change.
  • All other folders belong to www-data.

The output of nc-info is:

Running nc-info
Gathering information…
NextCloudPi version v1.34.6
NextCloudPi image NextCloudPi_docker_11-27-20
distribution Debian GNU/Linux 10 \n \l
automount no
USB devices sda
datadir /data/nextcloud/data
data in SD no
data filesystem ext2/ext3
data disk usage 804M/916G
rootfs usage 13G/15G
swapfile /var/swap
dbdir /data/database
Nextcloud check ok
Nextcloud version 20.0.2.2
HTTPD service up
PHP service up
MariaDB service up
Redis service up
Postfix service up
internet check ok
port check 80 open
port check 443 open
IP 172.17.0.2
gateway 172.17.0.1
interface eth0
certificates none
NAT loopback no
uptime 17:58
You should run Lets Encrypt for trusted encrypted access
You should enable automount to use your plugged in USB drive
Done. Press any key…

So I hope that can help you!

same id in the container and on the host?

mhm maybe…? I can’t figure out how to check the UID of the docker user. I found it on the host, but I need the UID in the container as well. Where do I find this one?

docker exec -u www-data nextcloudpi id

means: execute the command id as user www-data in the container nextcloudpi.

nextstep: change the ownership of the folder /var/www/nextcloud to the ID that means the numerical number of the “container www-data”.