ubuntuusers.de

Nextcloud-Snap: Neue Festplatte als Mountpunkt

Status: Gelöst | Ubuntu-Version: Ubuntu 20.04 (Focal Fossa)
Antworten |

Lockslay

Anmeldungsdatum:
25. Juli 2011

Beiträge: 8

Hallo zusammen,

ich habe auf meinem ProxMox ein Ubuntu 20.04 LTS installiert. Darauf habe ich eine Nextcloud über snap installiert. Jetzt wollte ich eine neue Festplatte als neuen Mountpoint einrichten. Ich habe in der Config die Angabe geändert:

'datadirectory' => '/mnt/nextcloud',
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0    7:0    0  67.8M  1 loop /snap/lxd/18150
loop1    7:1    0  55.4M  1 loop /snap/core18/1932
loop2    7:2    0    31M  1 loop /snap/snapd/9721
loop3    7:3    0    55M  1 loop /snap/core18/1880
loop4    7:4    0  29.9M  1 loop /snap/snapd/8542
loop5    7:5    0  71.3M  1 loop /snap/lxd/16099
loop6    7:6    0 273.4M  1 loop /snap/nextcloud/24051
sda      8:0    0    32G  0 disk 
├─sda1   8:1    0     1M  0 part 
└─sda2   8:2    0    32G  0 part /
sdb      8:16   0 465.8G  0 disk /mnt/nextcloud
sr0     11:0    1   914M  0 rom  

Den Inhalt von data habe ich auf den /mnt/nextcloud kopiert. Die Rechte sind auch angepasst:

root@ubuntuserver:/mnt/nextcloud# ls -la
total 28
drwxrwxr-x 4 www-data www-data  4096 Nov 28 20:46 .
drwxr-xr-x 3 root     root      4096 Nov 28 19:20 ..
-rwxrwxr-x 1 www-data www-data     0 Nov 28 19:29 .ocdata
drwxrwxr-x 4 www-data www-data  4096 Nov 28 20:46 data
drwxrwxr-x 2 www-data www-data 16384 Nov 28 18:00 lost+found

/var/snap/nextcloud/24051/nextcloud/config

Ich bekomme dann diese Fehlermeldung:

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

server log https://slexy.org/view/s2pxYcZfrp

Kann mir einer sagen was ich falsch mache?

Doc_Symbiosis

Avatar von Doc_Symbiosis

Anmeldungsdatum:
11. Oktober 2006

Beiträge: 4453

Wohnort: Göttingen

Hm, ich erinnere mich, dass das Nextcloud-Datenverzeichnis nur an bestimmten Stellen liegen darf, finde dazu aber gerade keine entsprechende Infos. Also es gibt da Probleme, wenn es ein Unterverzeichnis von /mnt oder /media ist, wenn ich mich da richtig entsinne. Such vielleicht mal in dieser Richtung. Oder probier mal, die Platte nach /var/data zu mounten und das Datenverzeichnis von Nextcloud dorthin zu legen.

EDIT: Jetzt hab ich's wiedergefunden. Vielleicht hilft Dir dieser Artikel: https://github.com/nextcloud/nextcloud-snap/wiki/Change-data-directory-to-use-another-disk-partition

Und noch der Link zu dem Thema hier im Forum: https://forum.ubuntuusers.de/topic/nextcloud-umziehen/

Lockslay

(Themenstarter)

Anmeldungsdatum:
25. Juli 2011

Beiträge: 8

Hallo und Danke für die Links.

ich habe das jetzt einmal so gemacht wie auf der Seite beschrieben.

Decide where you want the new data to live. We'll use /media/nextcloud/data. Make sure root has write access, but it's not accessible by others, for example:

 $ sudo mkdir -p /media/nextcloud/data
 $ sudo chown -R root:root /media/nextcloud/data
 $ sudo chmod 0770 /media/nextcloud/data

Update the Nextcloud config to use the new data directory by editing /var/snap/nextcloud/current/nextcloud/config/autoconfig.php and making sure the directory setting is pointing to the right place, e.g.:

 // ...
 'directory' => '/media/nextcloud/data',
 // ...

Now, restart the PHP service:

 $ sudo snap restart nextcloud.php-fpm

Ich habe die /var/snap/nextcloud/current/nextcloud/config/autoconfig.php nagepasst und auch die config.php auf den neuen Mountpoint gelegt.

sdb 8:16 0 465.8G 0 disk /media/nextcloud

Nur als Meldung bekomme ich

Dein Datenverzeichnis ist ungültig Stelle sicher, dass eine Datei ".ocdata" im Wurzelverzeichnis des data-Verzeichnisses existiert. Kann das "Daten"-Verzeichnis nicht erstellen Dies kann zumeist behoben werden, indem dem Web-Server Schreibzugriff auf das Wurzel-Verzeichnis eingeräumt wird. Siehe auch https://docs.nextcloud.com/server/20/go.php?to=admin-dir_permissions 

Wobei ich sudo chmod 0770 /media/nextcloud/data ausgeführt habe.

Verstehe das einfach nicht.

Doc_Symbiosis

Avatar von Doc_Symbiosis

Anmeldungsdatum:
11. Oktober 2006

Beiträge: 4453

Wohnort: Göttingen

Hm, unter welcher Kennung läuft der Webserver denn?

Ich würde mal denken, dass Du www-data oder so als besitzende Gruppe für das Datenverzeichnis setzen musst.

Lockslay

(Themenstarter)

Anmeldungsdatum:
25. Juli 2011

Beiträge: 8

Hallo,

gute Idee..... Ich habe meine Daten unter /media/nextcloud aus Gewohnheit auf www-data eingerichtet.

drwxrwx--- 4 www-data www-data  4096 Nov 28 20:46 .
drwxr-xr-x 3 root     root      4096 Nov 29 12:50 ..
-rwxrwxr-x 1 www-data www-data     0 Nov 28 19:29 .ocdata
drwxrwx--- 4 www-data www-data  4096 Nov 28 20:46 data
drwxrwxr-x 2 www-data www-data 16384 Nov 28 18:00 lost+found

Die Config läuft aber al root

drwxr-xr-x 2 root root  4096 Nov 29 13:10 .
drwxr-xr-x 4 root root  4096 Nov 28 18:50 ..
-rw-r--r-- 1 root root   495 Nov 28 18:50 .htaccess
-rw-r--r-- 1 root root     0 Nov 28 18:50 CAN_INSTALL
-rw-r--r-- 1 root root   459 Nov 29 13:08 autoconfig.php
-rw-r----- 1 root root  1380 Nov 29 13:10 config.php
-rw-r----- 1 root root  1400 Nov 28 19:26 config.php_backup
-rw-r--r-- 1 root root 57409 Nov 28 18:50 config.sample.php

Mit

root@ubuntuserver:/var/snap/nextcloud/24051/nextcloud/config# ps -e PID TTY TIME CMD 1 ? 00:00:01 systemd 2 ? 00:00:00 kthreadd 3 ? 00:00:00 rcu_gp 4 ? 00:00:00 rcu_par_gp 6 ? 00:00:00 kworker/0:0H-kblockd 8 ? 00:00:00 mm_percpu_wq 9 ? 00:00:05 ksoftirqd/0 10 ? 00:00:05 rcu_sched 11 ? 00:00:00 migration/0 12 ? 00:00:00 idle_inject/0 14 ? 00:00:00 cpuhp/0 15 ? 00:00:00 kdevtmpfs 16 ? 00:00:00 netns 17 ? 00:00:00 rcu_tasks_kthre 18 ? 00:00:00 kauditd 19 ? 00:00:00 khungtaskd 20 ? 00:00:00 oom_reaper 21 ? 00:00:00 writeback 22 ? 00:00:00 kcompactd0 23 ? 00:00:00 ksmd 24 ? 00:00:00 khugepaged 70 ? 00:00:00 kintegrityd 71 ? 00:00:00 kblockd 72 ? 00:00:00 blkcg_punt_bio 73 ? 00:00:00 tpm_dev_wq 74 ? 00:00:00 ata_sff 75 ? 00:00:00 md 76 ? 00:00:00 edac-poller 77 ? 00:00:00 devfreq_wq 78 ? 00:00:00 watchdogd 80 ? 00:00:00 kswapd0 81 ? 00:00:00 ecryptfs-kthrea 83 ? 00:00:00 kthrotld 84 ? 00:00:00 acpi_thermal_pm 85 ? 00:00:00 scsi_eh_0 86 ? 00:00:00 scsi_tmf_0 87 ? 00:00:00 scsi_eh_1 88 ? 00:00:00 scsi_tmf_1 90 ? 00:00:00 vfio-irqfd-clea 91 ? 00:00:00 ipv6_addrconf 101 ? 00:00:00 kstrp 104 ? 00:00:00 kworker/u3:0 117 ? 00:00:00 charger_manager 157 ? 00:00:00 scsi_eh_2 158 ? 00:00:00 kworker/0:1H-kblockd 159 ? 00:00:00 scsi_tmf_2 183 ? 00:00:00 ttm_swap 211 ? 00:00:00 raid5wq 251 ? 00:00:00 jbd2/sda2-8 252 ? 00:00:00 ext4-rsv-conver 323 ? 00:00:00 systemd-journal 350 ? 00:00:00 systemd-udevd 506 ? 00:00:00 kaluad 507 ? 00:00:00 kmpath_rdacd 508 ? 00:00:00 kmpathd 509 ? 00:00:00 kmpath_handlerd 510 ? 00:00:00 multipathd 522 ? 00:00:00 loop0 526 ? 00:00:00 loop1 527 ? 00:00:00 loop2 528 ? 00:00:00 loop3 529 ? 00:00:00 loop4 533 ? 00:00:00 loop5 534 ? 00:00:00 loop6 553 ? 00:00:00 systemd-timesyn 624 ? 00:00:00 systemd-network 626 ? 00:00:00 systemd-resolve 641 ? 00:00:00 accounts-daemon 645 ? 00:00:00 cron 646 ? 00:00:00 dbus-daemon 654 ? 00:00:00 networkd-dispat 655 ? 00:00:00 rsyslogd 657 ? 00:00:00 run-httpd 658 ? 00:00:00 delay-on-failur 659 ? 00:00:01 start_mysql 660 ? 00:00:00 nextcloud-cron 661 ? 00:00:01 nextcloud-fixer 663 ? 00:00:00 start-redis-ser 664 ? 00:00:00 renew-certs 665 ? 00:00:13 snapd 667 ? 00:00:00 systemd-logind 675 ? 00:00:00 atd 687 ? 00:00:02 containerd 688 ? 00:00:00 dockerd 737 ? 00:00:00 sshd 839 ? 00:00:00 polkitd 938 ? 00:00:00 mdns-publisher 1028 ? 00:00:00 unattended-upgr 1065 ? 00:00:20 redis-server 1233 ? 00:00:00 none 1388 ? 00:00:00 mysqld_safe 1590 ? 00:00:18 mysqld 1757 ? 00:00:00 sleep 2178 ? 00:00:00 httpd-wrapper 2221 ? 00:00:00 httpd 2223 ? 00:00:00 httpd 2224 ? 00:00:00 httpd 2225 ? 00:00:00 httpd 8365 tty1 00:00:00 login 13619 ? 00:00:00 sshd 14431 ? 00:00:00 systemd 14432 ? 00:00:00 (sd-pam) 14611 ? 00:00:00 sshd 14612 pts/0 00:00:00 bash 15229 tty1 00:00:00 bash 23602 pts/0 00:00:00 sudo 23801 pts/0 00:00:00 bash 35498 ? 00:00:00 jbd2/sdb-8 35499 ? 00:00:00 ext4-rsv-conver 46903 ? 00:00:00 httpd 91052 ? 00:00:00 start-php-fpm 91150 ? 00:00:00 php-fpm 154425 ? 00:00:02 kworker/0:1-cgroup_destroy 248418 ? 00:00:00 kworker/u2:2-events_power_efficient 416699 ? 00:00:00 kworker/u2:0-events_unbound 486626 ? 00:00:00 kworker/u2:1-events_power_efficient 498826 ? 00:00:00 kworker/0:0-events 524193 ? 00:00:00 jbd2/sdc-8 524194 ? 00:00:00 ext4-rsv-conver 542983 ? 00:00:00 kworker/0:2-events 554532 ? 00:00:00 sleep 555838 ? 00:00:00 sleep 555903 ? 00:00:00 sleep

Kann ich leider nicht sehen welcher Dienst apache oder Nginx läuft.

Gruß Lockslay

Doc_Symbiosis

Avatar von Doc_Symbiosis

Anmeldungsdatum:
11. Oktober 2006

Beiträge: 4453

Wohnort: Göttingen

Hm, so kann ich da leider auch nichts erkennen. Verwende bitte Codeblöcke, um solche Ausgaben zu posten.

EDIT: Vielleicht hilft Dir noch dieser Link: https://help.nextcloud.com/t/changing-data-directory-location-with-snap-installation-procedures/23841/4

Da steht, dass man dem Snap Zugriff auf /media geben muss mit dem Kommando:

 sudo snap connect nextcloud:removable-media

Lockslay

(Themenstarter)

Anmeldungsdatum:
25. Juli 2011

Beiträge: 8

Hallo, ich habe also alles so eingestellt wie in dem Link.

Enable external storage for snap: sudo snap connect nextcloud:removable-media

Stop nexcloud snap: sudo snap stop nextcloud

Update storage location: sudo vim /var/snap/nextcloud/current/nextcloud/config/config.php

change data location:

'datadirectory' ⇒ '/media/storage/data',

Move the data directory to the storage device: sudo mv /var/snap/nextcloud/common/nextcloud/data /media/storage/

Start nextcloud snap: sudo snap start nextcloud

Und habe natürlich /media/storage angelegt in die fstab eingetragen und die Rechte vergeben:

/media/storage# ls -la
total 28
drwxr-xr-x 4 www-data www-data  4096 Nov 28 20:46 .
drwxr-xr-x 6 root     root      4096 Nov 29 17:13 ..
-rwxr-xr-x 1 www-data www-data     0 Nov 28 19:29 .ocdata
drwxr-xr-x 4 www-data www-data  4096 Nov 28 20:46 data
drwxr-xr-x 2 www-data www-data 16384 Nov 28 18:00 lost+found
root@ubuntuserver:/media/storage# 

Jetzt bekomme ich wenigstens schon die Nextcloud Seite mit der Meldung:

Fehler

    Your data directory is not writable

    Berechtigungen können zumeist korrigiert werden indem dem Web-Server Schreibzugriff auf das Wurzel-Verzeichnis eingeräumt wird. Siehe auch https://docs.nextcloud.com/server/20/go.php?to=admin-dir_permissions.

Also ich blicke echt nicht mehr durch. Überlege nextcloud ohne snap zu installieren.

Gruß und Danke Lockslay

Doc_Symbiosis

Avatar von Doc_Symbiosis

Anmeldungsdatum:
11. Oktober 2006

Beiträge: 4453

Wohnort: Göttingen

Hm, da wären wir wieder bei der Frage, unter welchem Benutzer der Webserver läuft.

Probier vielleicht mal folgendes (nur reine Vermutung):

chown root:www-data /media/storage/data

Und wegen Snap: ich hab bisher Nextcloud immer einfach manuell installiert. Geht eigentlich ziemlich problemlos.

Lockslay

(Themenstarter)

Anmeldungsdatum:
25. Juli 2011

Beiträge: 8

Hallo und vielen DAAAANNNNKK es geht, jetzt kann ich mich Anmelden. Danke !!!

Doc_Symbiosis

Avatar von Doc_Symbiosis

Anmeldungsdatum:
11. Oktober 2006

Beiträge: 4453

Wohnort: Göttingen

OK, sehr schön! Das freut mich.

Wenn das Problem damit gelöst ist, markiere das Thema bitte noch als gelöst.

Lockslay

(Themenstarter)

Anmeldungsdatum:
25. Juli 2011

Beiträge: 8

Hallo und Guten Morgen,

jetzt habe ich eben den Beitrag als gelöst markiert und stelle fest, dass ich keine Daten auf die Cloud kopieren kann. Sobald ich eine Datei hochlade erhalte ich die Meldung, fehlgeschlagen.

Erster Gedanke, Benutzerrechte in /media/nextcloud chmod -R 775

Also ich verstehe das nicht. Kannst du so nett sein und nochmals helfen ....

Doc_Symbiosis

Avatar von Doc_Symbiosis

Anmeldungsdatum:
11. Oktober 2006

Beiträge: 4453

Wohnort: Göttingen

Steht was Hilfreiches in den Logs von Nextcloud?

chmod und chown rekursiv auf das Datenverzeichnis zu machen, hört sich ganz plausibel an.

Antworten |