Speicher auf gemietetem V-Server voll ohne ersichtlichen Grund

Alle weiteren Dienste, die nicht in die drei oberen Foren gehören.
Antworten
DidiDee
Beiträge: 4
Registriert: 03.10.2022 15:37:47

Speicher auf gemietetem V-Server voll ohne ersichtlichen Grund

Beitrag von DidiDee » 03.10.2022 15:50:55

Hallo!

Ich habe mir vor etwa einem halben Jahr einen V-Server (VPS I LINUX V-SERVER) bei onyxhosting.de gemietet. Dieser hat 100 GB an Festplattenkapazität.
Ich betreibe lediglich eine Nextcloud und nutze ihn zu nichts weiter. Nun ist es aber so, dass der Speicher zu 98% voll ist, obwohl ich in Summe unter 30 GB an Dateien in der Nextcloud hochgeladen habe.

Ein einfaches "df -hl" ergibt folgendes:

Code: Alles auswählen

root@xyz:~# df -hl
Filesystem         Size  Used Avail Use% Mounted on
/dev/ploop37084p1   99G   93G  2.1G  98% /
none               4.0M     0  4.0M   0% /sys/fs/cgroup
none               1.0G     0  1.0G   0% /dev
tmpfs              1.0G     0  1.0G   0% /dev/shm
tmpfs              410M  1.2M  409M   1% /run
tmpfs              5.0M     0  5.0M   0% /run/lock
none               1.0G     0  1.0G   0% /run/shm
tmpfs              205M     0  205M   0% /run/user/0
Jedoch checke ich nicht, was ploop37084p1 ist.

Code: Alles auswählen

root@xyz:/dev# ls -l
total 0
crw------- 1 root root  10,    235 Oct  3 15:20 autofs
drwxr-xr-x 2 root root          80 Oct  3 15:20 block
drwxr-xr-x 2 root root         160 Oct  3 15:20 char
crw--w---- 1 root tty    5,      1 Oct  3 15:21 console
lrwxrwxrwx 1 root root          13 Oct  3 15:20 fd -> /proc/self/fd
crw-rw-rw- 1 root root   1,      7 Oct  3 15:20 full
lrwxrwxrwx 1 root root          12 Oct  3 15:20 initctl -> /run/initctl
crw-r--r-- 1 root root   1,     11 Oct  3 15:20 kmsg
lrwxrwxrwx 1 root root          28 Oct  3 15:20 log -> /run/systemd/journal/dev-                                                                                                                                                                                               log
drwxrwxrwt 2 root root          40 Oct  3 15:20 mqueue
crw-rw-rw- 1 root root   1,      3 Oct  3 15:20 null
[b]brw-rw---- 1 root disk 182, 593344 Oct  3 15:20 ploop37084
brw-rw---- 1 root disk 182, 593345 Oct  3 15:20 ploop37084p1[/b]
crw-rw-rw- 1 root tty    5,      2 Oct  3 15:46 ptmx
drwxr-xr-x 2 root root           0 Oct  3 15:20 pts
crw------- 1 root root   2,      0 Oct  3 15:20 ptyp0
crw------- 1 root root   2,      1 Oct  3 15:20 ptyp1
crw------- 1 root root   2,      2 Oct  3 15:20 ptyp2
crw------- 1 root root   2,      3 Oct  3 15:20 ptyp3
crw------- 1 root root   2,      4 Oct  3 15:20 ptyp4
crw------- 1 root root   2,      5 Oct  3 15:20 ptyp5
crw------- 1 root root   2,      6 Oct  3 15:20 ptyp6
crw------- 1 root root   2,      7 Oct  3 15:20 ptyp7
crw------- 1 root root   2,      8 Oct  3 15:20 ptyp8
crw------- 1 root root   2,      9 Oct  3 15:20 ptyp9
crw------- 1 root root   2,     10 Oct  3 15:20 ptypa
crw------- 1 root root   2,     11 Oct  3 15:20 ptypb
crw-rw-rw- 1 root root   1,      8 Oct  3 15:20 random
drwxrwxrwt 2 root root          40 Oct  3 15:20 shm
lrwxrwxrwx 1 root root          15 Oct  3 15:20 stderr -> /proc/self/fd/2
lrwxrwxrwx 1 root root          15 Oct  3 15:20 stdin -> /proc/self/fd/0
lrwxrwxrwx 1 root root          15 Oct  3 15:20 stdout -> /proc/self/fd/1
crw-rw-rw- 1 root root   5,      0 Oct  3 15:20 tty
crw--w---- 1 root tty    4,      0 Oct  3 15:20 tty0
crw--w---- 1 root tty    4,      1 Oct  3 15:20 tty1
crw--w---- 1 root tty    4,     10 Oct  3 15:20 tty10
crw--w---- 1 root tty    4,     11 Oct  3 15:20 tty11
crw--w---- 1 root tty    4,     12 Oct  3 15:20 tty12
crw--w---- 1 root tty    4,      2 Oct  3 15:21 tty2
crw--w---- 1 root tty    4,      3 Oct  3 15:20 tty3
crw--w---- 1 root tty    4,      4 Oct  3 15:20 tty4
crw--w---- 1 root tty    4,      5 Oct  3 15:20 tty5
crw--w---- 1 root tty    4,      6 Oct  3 15:20 tty6
crw--w---- 1 root tty    4,      7 Oct  3 15:20 tty7
crw--w---- 1 root tty    4,      8 Oct  3 15:20 tty8
crw--w---- 1 root tty    4,      9 Oct  3 15:20 tty9
crw------- 1 root root   3,      0 Oct  3 15:20 ttyp0
crw------- 1 root root   3,      1 Oct  3 15:20 ttyp1
crw------- 1 root root   3,      2 Oct  3 15:20 ttyp2
crw------- 1 root root   3,      3 Oct  3 15:20 ttyp3
crw------- 1 root root   3,      4 Oct  3 15:20 ttyp4
crw------- 1 root root   3,      5 Oct  3 15:20 ttyp5
crw------- 1 root root   3,      6 Oct  3 15:20 ttyp6
crw------- 1 root root   3,      7 Oct  3 15:20 ttyp7
crw------- 1 root root   3,      8 Oct  3 15:20 ttyp8
crw------- 1 root root   3,      9 Oct  3 15:20 ttyp9
crw------- 1 root root   3,     10 Oct  3 15:20 ttypa
crw------- 1 root root   3,     11 Oct  3 15:20 ttypb
crw-rw-rw- 1 root root   1,      9 Oct  3 15:20 urandom
crw-rw-rw- 1 root root   1,      5 Oct  3 15:20 zero
Habt ihr mir einen Ansatz, was meinen Speicher so zumüllt?

Viele Grüße
Didi

Benutzeravatar
TRex
Moderator
Beiträge: 8070
Registriert: 23.11.2006 12:23:54
Lizenz eigener Beiträge: MIT Lizenz
Wohnort: KA

Re: Speicher auf gemietetem V-Server voll ohne ersichtlichen Grund

Beitrag von TRex » 03.10.2022 16:08:02

Probiers mal mit nem

Code: Alles auswählen

du -sch /*
(und bei Bedarf dann eben weiter, zb du -sch /var/*), um zu sehen, wo der Platz verbraucht wird.

ploopdings ist der Blockspeicher, der an deinen V-Server durchgereicht wurde.
Jesus saves. Buddha does incremental backups.
Windows ist doof, Linux funktioniert nichtDon't break debian!Wie man widerspricht

DidiDee
Beiträge: 4
Registriert: 03.10.2022 15:37:47

Re: Speicher auf gemietetem V-Server voll ohne ersichtlichen Grund

Beitrag von DidiDee » 03.10.2022 17:47:01

TRex hat geschrieben: ↑ zum Beitrag ↑
03.10.2022 16:08:02
Probiers mal mit nem

Code: Alles auswählen

du -sch /*
(und bei Bedarf dann eben weiter, zb du -sch /var/*), um zu sehen, wo der Platz verbraucht wird.

ploopdings ist der Blockspeicher, der an deinen V-Server durchgereicht wurde.

Danke dir, hier das Ergebnis:

Code: Alles auswählen

root@xyz:~# du -sch /*
15M     /bin
4.0K    /boot
0       /dev
19M     /etc
16K     /home
45M     /lib
4.0K    /lib64
16K     /lost+found
4.0K    /media
4.0K    /mnt
4.0K    /opt
du: cannot read directory '/proc/1/map_files': Operation not permitted
du: cannot read directory '/proc/82/map_files': Operation not permitted
du: cannot read directory '/proc/114/map_files': Operation not permitted
du: cannot read directory '/proc/122/map_files': Operation not permitted
du: cannot read directory '/proc/197/map_files': Operation not permitted
du: cannot read directory '/proc/208/map_files': Operation not permitted
du: cannot read directory '/proc/209/map_files': Operation not permitted
du: cannot read directory '/proc/215/map_files': Operation not permitted
du: cannot read directory '/proc/224/map_files': Operation not permitted
du: cannot read directory '/proc/231/map_files': Operation not permitted
du: cannot read directory '/proc/291/map_files': Operation not permitted
du: cannot read directory '/proc/338/map_files': Operation not permitted
du: cannot read directory '/proc/342/map_files': Operation not permitted
du: cannot read directory '/proc/354/map_files': Operation not permitted
du: cannot read directory '/proc/388/map_files': Operation not permitted
du: cannot read directory '/proc/471/map_files': Operation not permitted
du: cannot read directory '/proc/477/map_files': Operation not permitted
du: cannot read directory '/proc/491/map_files': Operation not permitted
du: cannot read directory '/proc/493/map_files': Operation not permitted
du: cannot read directory '/proc/510/map_files': Operation not permitted
du: cannot read directory '/proc/551/map_files': Operation not permitted
du: cannot read directory '/proc/553/map_files': Operation not permitted
du: cannot read directory '/proc/733/map_files': Operation not permitted
du: cannot read directory '/proc/909/map_files': Operation not permitted
du: cannot read directory '/proc/910/map_files': Operation not permitted
du: cannot read directory '/proc/911/map_files': Operation not permitted
du: cannot read directory '/proc/912/map_files': Operation not permitted
du: cannot read directory '/proc/913/map_files': Operation not permitted
du: cannot read directory '/proc/914/map_files': Operation not permitted
du: cannot read directory '/proc/935/map_files': Operation not permitted
du: cannot read directory '/proc/936/map_files': Operation not permitted
du: cannot read directory '/proc/1148/map_files': Operation not permitted
du: cannot read directory '/proc/1150/map_files': Operation not permitted
du: cannot read directory '/proc/1354/map_files': Operation not permitted
du: cannot read directory '/proc/3305/map_files': Operation not permitted
du: cannot read directory '/proc/3306/map_files': Operation not permitted
du: cannot read directory '/proc/5211/map_files': Operation not permitted
du: cannot read directory '/proc/11235/map_files': Operation not permitted
du: cannot read directory '/proc/11300/map_files': Operation not permitted
du: cannot read directory '/proc/11516/map_files': Operation not permitted
du: cannot read directory '/proc/11611/map_files': Operation not permitted
du: cannot read directory '/proc/26127/map_files': Operation not permitted
du: cannot read directory '/proc/26206/map_files': Operation not permitted
du: cannot read directory '/proc/35649/map_files': Operation not permitted
du: cannot read directory '/proc/46077/map_files': Operation not permitted
du: cannot read directory '/proc/46137/map_files': Operation not permitted
du: cannot access '/proc/46231/task/46231/fd/3': No such file or directory
du: cannot access '/proc/46231/task/46231/fdinfo/3': No such file or directory
du: cannot access '/proc/46231/fd/3': No such file or directory
du: cannot read directory '/proc/46231/map_files': Operation not permitted
du: cannot access '/proc/46231/fdinfo/3': No such file or directory
du: cannot read directory '/proc/46235/map_files': Operation not permitted
0       /proc
144K    /root
1.2M    /run
9.0M    /sbin
4.0K    /srv
0       /sys
48K     /tmp
1.9G    /usr
91G     /var
92G     total

root@xyz:~# ls /var/*
liefert folgende Ordnerstruktur:

Code: Alles auswählen

/var/swap

/var/backups:
apt.extended_states.0     apt.extended_states.3.gz  apt.extended_states.6.gz
apt.extended_states.1.gz  apt.extended_states.4.gz
apt.extended_states.2.gz  apt.extended_states.5.gz

/var/cache:
apache2  cracklib         debconf              ldconfig     private
apt      dbconfig-common  dictionaries-common  man          samba
bind     ddclient         fontconfig           modsecurity  tcpdf

/var/lib:
apache2              fail2ban     pam         smartmontools
apt                  fetchmail    php         snmp
aspell               git          phpmyadmin  sudo
bind                 initscripts  polkit-1    systemd
dbus                 ispell       postfix     ucf
debsecan             letsencrypt  private     udisks2
dhcp                 logrotate    prometheus  unattended-upgrades
dhcpv6               man-db       python      update-rc.d
dictionaries-common  misc         quota       urandom
dpkg                 mlocate      redis       vim
emacsen-common       mysql        samba       xml-core
exim4                nfs          sgml-base

/var/local:

/var/lock:
apache2  subsys

/var/log:
alternatives.log       exim4             ncp.log.2.gz
alternatives.log.1     fail2ban.log      ncp.log.3.gz
alternatives.log.2.gz  fail2ban.log.1    ncp.log.4.gz
alternatives.log.3.gz  faillog           php7.4-fpm.log
alternatives.log.4.gz  fontconfig.log    php7.4-fpm.log.1
alternatives.log.5.gz  fsck              php7.4-fpm.log.10.gz
apache2                journal           php7.4-fpm.log.11.gz
apt                    lastlog           php7.4-fpm.log.12.gz
auth.log               letsencrypt       php7.4-fpm.log.2.gz
auth.log.1             lynis-report.dat  php7.4-fpm.log.3.gz
auth.log.2.gz          lynis.log         php7.4-fpm.log.4.gz
auth.log.3.gz          mail.info         php7.4-fpm.log.5.gz
auth.log.4.gz          mail.info.1       php7.4-fpm.log.6.gz
btmp                   mail.info.2.gz    php7.4-fpm.log.7.gz
btmp.1                 mail.info.3.gz    php7.4-fpm.log.8.gz
daemon.log             mail.info.4.gz    php7.4-fpm.log.9.gz
daemon.log.1           mail.log          private
daemon.log.2.gz        mail.log.1        prometheus
daemon.log.3.gz        mail.log.2.gz     redis
daemon.log.4.gz        mail.log.3.gz     runit
dbconfig-common        mail.log.4.gz     samba
debug                  mail.warn         syslog
debug.1                mail.warn.1       syslog.1
debug.2.gz             mail.warn.2.gz    syslog.2.gz
debug.3.gz             mail.warn.3.gz    syslog.3.gz
debug.4.gz             mail.warn.4.gz    syslog.4.gz
dpkg.log               messages          unattended-upgrades
dpkg.log.1             messages.1        user.log
dpkg.log.2.gz          messages.2.gz     user.log.1
dpkg.log.3.gz          messages.3.gz     user.log.2.gz
dpkg.log.4.gz          messages.4.gz     user.log.3.gz
dpkg.log.5.gz          mysql             user.log.4.gz
dpkg.log.6.gz          ncp.log           wtmp
dpkg.log.7.gz          ncp.log.1.gz

/var/mail:
nobody  www-data

/var/opt:

/var/run:
agetty.reload  ddclient.pid  mount       rpcbind          sshd.pid   utmp
apache2        dnsmasq       mysqld      samba            sudo       xinetd.pid
avahi-daemon   fail2ban      named       saslauthd        sysconfig
credentials    initctl       network     screen           systemd
crond.pid      lock          php         sendsigs.omit.d  udev
crond.reboot   log           redis       shm              udisks2
dbus           motd.dynamic  rpc_pipefs  sshd             user

/var/spool:
cron  exim4  mail  postfix  rsyslog  samba

/var/tmp:
systemd-private-9d93333916474c0780da1f3d30c8a933-apache2.service-dcvVwh
systemd-private-9d93333916474c0780da1f3d30c8a933-redis-server.service-9vU2hf
systemd-private-9d93333916474c0780da1f3d30c8a933-systemd-logind.service-JHRkMg

/var/www:
...
Hast du noch weitere Ideen? :)

Benutzeravatar
Tintom
Moderator
Beiträge: 3033
Registriert: 14.04.2006 20:55:15
Wohnort: Göttingen

Re: Speicher auf gemietetem V-Server voll ohne ersichtlichen Grund

Beitrag von Tintom » 03.10.2022 17:57:44

DidiDee hat geschrieben: ↑ zum Beitrag ↑
03.10.2022 17:47:01
Jedoch ist der Befehl selbst nach 45 Minuten noch immer nicht fertig. Es tut sicher aber auch seitdem nichts mehr...
Du musst den Befehl schon bis zum Ende laufen lassen. Da aber /var in deiner Ausgabe fehlt, könntest du den Befehl mal auf /var direkt loslassen.

/durch edit erledigt

Benutzeravatar
heisenberg
Beiträge: 3542
Registriert: 04.06.2015 01:17:27
Lizenz eigener Beiträge: MIT Lizenz

Re: Speicher auf gemietetem V-Server voll ohne ersichtlichen Grund

Beitrag von heisenberg » 03.10.2022 18:00:17

DidiDee hat geschrieben:

Code: Alles auswählen

...
91G     /var
...
Ok. Du siehst also, dass der Speicher in /var verbraucht wurde.

Die Tatsache, dass der Befehl so lange gebraucht hat, deutet darauf hin, dass irgendwo unterhalb von /var eine gigantische Menge von Dateien liegt, was die Ausgabe des kurz laufenden Befehls df -i(Anzeige der Anzahl freier und belegter Inodes(grob gesagt: Dateien)) auch schon bestätigen müsste.

Zum Vergleich: Eine kleine VM - ein NTP-Server - von mir hat ca. 50.000 Dateien. Ein größeres Shared-Webhosting-System mit Mails(Maildir) hat bei mir ca. 2.500.000 Dateien.

Schneller als mit mehrfachen du - Kommandos geht es mit Debianncdu. Das ist ein Werkzeug mit einer Textoberfläche, mit der Du durch den Verzeichnisbaum navigieren kannst und damit herausfinden, wo der Speicher verbraten wird.

Das einlesen dauert ca. genauso lang wie ein du - Aufruf. Alternativ kannst Du Dich mit weiteren du Aufrufen zum Ziel hangeln, wo die große Menge an Dateien liegen wird.

Code: Alles auswählen

du -sm /var/*
du -sm /var/{grösstes Verzeichnis aus vorigem Befehl}/*
...
Jede Rohheit hat ihren Ursprung in einer Schwäche.

Benutzeravatar
TRex
Moderator
Beiträge: 8070
Registriert: 23.11.2006 12:23:54
Lizenz eigener Beiträge: MIT Lizenz
Wohnort: KA

Re: Speicher auf gemietetem V-Server voll ohne ersichtlichen Grund

Beitrag von TRex » 03.10.2022 18:44:36

Ja, letzteres hatte ich ja eigentlich empfohlen, nicht ls - dann wären wir schon eins weiter ;)
Jesus saves. Buddha does incremental backups.
Windows ist doof, Linux funktioniert nichtDon't break debian!Wie man widerspricht

DidiDee
Beiträge: 4
Registriert: 03.10.2022 15:37:47

Re: Speicher auf gemietetem V-Server voll ohne ersichtlichen Grund

Beitrag von DidiDee » 03.10.2022 18:53:00

Danke euch beiden, ihr habt mir sehr geholfen! Tatsächlich hat die Nextcloud alles zugemüllt, da von den Usern gelöschte Daten nicht auf dem System gelöscht wurden. Das konnte ich jetzt aber automatisiert einstellen und das passt nun.

Tausend Dank für die schnelle Hilfe!!!

Benutzeravatar
heisenberg
Beiträge: 3542
Registriert: 04.06.2015 01:17:27
Lizenz eigener Beiträge: MIT Lizenz

Re: Speicher auf gemietetem V-Server voll ohne ersichtlichen Grund

Beitrag von heisenberg » 03.10.2022 19:06:14

Weil ich das Problem vor kurzem auch bearbeitet habe, hier ein paar passende Informationen dazu:
Jede Rohheit hat ihren Ursprung in einer Schwäche.

DidiDee
Beiträge: 4
Registriert: 03.10.2022 15:37:47

Re: Speicher auf gemietetem V-Server voll ohne ersichtlichen Grund

Beitrag von DidiDee » 03.10.2022 19:12:18

Vielen Dank dir! Den Cronjob hatte ich noch nicht drin. Mega cool :)

uname
Beiträge: 12072
Registriert: 03.06.2008 09:33:02

Re: Speicher auf gemietetem V-Server voll ohne ersichtlichen Grund

Beitrag von uname » 04.10.2022 08:05:45

heisenberg hat geschrieben:Schneller als mit mehrfachen du - Kommandos geht es mit Debianncdu. Das ist ein Werkzeug mit einer Textoberfläche, mit der Du durch den Verzeichnisbaum navigieren kannst und damit herausfinden, wo der Speicher verbraten wird.
Ich denke auch, dass Debianncdu das Mittel der Wahl ist.
Damit findet man ganz schnell die größten Unter-Unter-Unter-Ordner z. B. in /var.
Zudem benötigt man dafür keinerlei IT-Wissen.
Wenn aber wirklich die Nextcloud-Mülleimer von vielen Benutzern vollgemüllt und nicht geleert waren, hilft es natürlich weniger.
Aber ist es ja wie in der Natur. Ich denke 1% der Menschen sind für 99% des Mülls im Wald verantwortlich. Mag bei deiner Nextcloud ähnlich sein.
Aber führe den Befehl trotzdem mal durch. Ich denke schneller als mit ncdu kann man keine Plattenspeicher-Fresser finden.

Benutzeravatar
heisenberg
Beiträge: 3542
Registriert: 04.06.2015 01:17:27
Lizenz eigener Beiträge: MIT Lizenz

Re: Speicher auf gemietetem V-Server voll ohne ersichtlichen Grund

Beitrag von heisenberg » 04.10.2022 09:44:03

uname hat geschrieben: ↑ zum Beitrag ↑
04.10.2022 08:05:45
Wenn aber wirklich die Nextcloud-Mülleimer von vielen Benutzern vollgemüllt und nicht geleert waren, hilft es natürlich weniger. Aber ist es ja wie in der Natur. Ich denke 1% der Menschen sind für 99% des Mülls im Wald verantwortlich. Mag bei deiner Nextcloud ähnlich sein.
Na. Da würde ich jetzt die Schuld nicht bei irgendwelchen bösen Benutzer suchen. Für meine Bedürnisse wäre es schon wünschenswert, wenn sich der Mülleimer irgendwann mal selbst leeren würde. Also sowohl Online mit Nextcloud als auch offline in der eigenen Wohnung. Ist aber wohl beides leider nicht der Fall.

Im Ernst: Eine automatische Löschung der Inhalte des Mülleimers nach Zeit X Tage(90 Tage scheint mir sinnvoll) finde ich sinnvoll und um so etwas würde ich mich als Nutzer nicht kümmern wollen müssen.
Jede Rohheit hat ihren Ursprung in einer Schwäche.

Antworten