# Rm: cannot remove '/var/run/postgresql': Directory not empty

**URL:** <https://meta.discourse.org/t/rm-cannot-remove-var-run-postgresql-directory-not-empty/257046>\
**Category:** Self-hosting\
**Created:** [March 4, 2023, 12:09pm UTC](https://meta.discourse.org/t/rm-cannot-remove-var-run-postgresql-directory-not-empty/257046 "2023-03-04T12:09:32Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![Blechpirat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blechpirat/32/221370_2.png) [@Blechpirat](https://meta.discourse.org/u/Blechpirat)\
**Post date:** [March 6, 2023, 5:53pm UTC](https://meta.discourse.org/t/rm-cannot-remove-var-run-postgresql-directory-not-empty/257046/15 "2023-03-06T17:53:31Z")

</div>

```plaintext
# ls -lsa /var/discourse/shared/standalone
insgesamt 16
4 drwxr-xr-x 4 root root 4096 Mär 6 08:34 .
4 drwxr-xr-x 3 root root 4096 Mär 6 08:34 ..
4 drwxr-xr-x 3 root root 4096 Mär 6 08:34 log
4 drwxrwxr-x 2 systemd-resolve systemd-timesync 4096 Mär 6 08:34 postgres_run
# ls -lsa /var/discourse/shared/standalone/postgres_run/
insgesamt 8
4 drwxrwxr-x 2 systemd-resolve systemd-timesync 4096 Mär 6 08:34 .
4 drwxr-xr-x 4 root root 4096 Mär 6 08:34 ..

```

Is this what you would expect? df shows ample space, so it’s not a full disk issue.

…

```plaintext
# ./discourse-doctor
DISCOURSE DOCTOR Mo 6. Mär 18:54:01 CET 2023
OS: Linux dracula 5.4.0-139-generic #156-Ubuntu SMP Fri Jan 20 17:27:18 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Found containers/app.yml

==================== YML SETTINGS ====================
[deleted for privacy reasons]

==================== DOCKER INFO ====================
DOCKER VERSION: Docker version 20.10.12, build 20.10.12-0ubuntu2~20.04.1

DOCKER PROCESSES (docker ps -a)

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f6d3f502384f cthulhoo/ttrss-fpm-pgsql-static:latest "/opt/tt-rss/updater…" 4 days ago Up 9 hours 9000/tcp ttrss-docker_updater_1
fb0c774b31cb cthulhoo/ttrss-web-nginx:latest "/docker-entrypoint.…" 4 days ago Up 9 hours (healthy) 127.0.0.1:8280->80/tcp ttrss-docker_web-nginx_1
83a32795b305 cthulhoo/ttrss-fpm-pgsql-static:latest "/opt/tt-rss/dcron.s…" 4 days ago Up 9 hours 9000/tcp ttrss-docker_backups_1
c211bc93f368 cthulhoo/ttrss-fpm-pgsql-static:latest "/bin/sh -c ${SCRIPT…" 4 days ago Up 9 hours 9000/tcp ttrss-docker_app_1
4ecb89c6bb9f postgres:12-alpine "docker-entrypoint.s…" 4 days ago Up 9 hours 5432/tcp ttrss-docker_db_1
c668703d805d traefik:latest "/entrypoint.sh trae…" 4 days ago Up 9 hours 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp traefik
f67a63243f13 ghcr.io/paperless-ngx/paperless-ngx:latest "/sbin/docker-entryp…" 4 days ago Up 9 hours (healthy) 0.0.0.0:8000->8000/tcp, :::8000->8000/tcp paperless-web
d2fbf8682efb postgres:13 "docker-entrypoint.s…" 4 days ago Up 9 hours 5432/tcp paperless-db
8284f03fdcd0 redis:6.0 "docker-entrypoint.s…" 4 days ago Up 9 hours 6379/tcp paperless-redis
ab29487743b0 tootsuite/mastodon "/usr/bin/tini -- no…" 4 days ago Up 9 hours (healthy) 3000/tcp, 4000/tcp mastodon_streaming_1
a117f5e785f8 tootsuite/mastodon "/usr/bin/tini -- bu…" 4 days ago Up 9 hours (healthy) 3000/tcp, 4000/tcp mastodon_sidekiq_1
5a4a7e99230c tootsuite/mastodon "/usr/bin/tini -- ba…" 4 days ago Up 9 hours (healthy) 3000/tcp, 4000/tcp mastodon_web_1
5484d4dd39b6 postgres:14-alpine "docker-entrypoint.s…" 4 days ago Up 9 hours (healthy) 5432/tcp mastodon_db_1
ecb2e7cbdc0b redis:7-alpine "docker-entrypoint.s…" 4 days ago Up 9 hours (healthy) 6379/tcp mastodon_redis_1

c211bc93f368 cthulhoo/ttrss-fpm-pgsql-static:latest "/bin/sh -c ${SCRIPT…" 4 days ago Up 9 hours 9000/tcp ttrss-docker_app_1

Discourse container app is running

==================== PLUGINS ====================
          - git clone https://github.com/discourse/docker_manager.git

No non-official plugins detected.

See https://github.com/discourse/discourse/blob/main/lib/plugin/metadata.rb for the official list.

========================================
Discourse version at talk.spielleiten.de: NOT FOUND
Discourse version at localhost: NOT FOUND

==================== MEMORY INFORMATION ====================
RAM (MB):

              gesamt belegt frei gemeinsam Zwischen verfügbar
Speicher: 7870 2292 141 4207 5436 1101
Auslager: 2047 580 1467

==================== DISK SPACE CHECK ====================
---------- OS Disk Space ----------
Dateisystem Größe Benutzt Verf. Verw% Eingehängt auf
/dev/sda2 109G 68G 36G 66% /
/dev/md0 3,7T 3,1T 581G 85% /mnt/raid

==================== DISK INFORMATION ====================
Festplatte /dev/sda: 111,81 GiB, 120034123776 Bytes, 234441648 Sektoren
Festplattenmodell: Samsung SSD 840
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 512 Bytes
E/A-Größe (minimal/optimal): 512 Bytes / 512 Bytes
Festplattenbezeichnungstyp: gpt
Festplattenbezeichner: F889FA6C-2FB7-44B6-8CDF-1E6A05B9E33D

Gerät Anfang Ende Sektoren Größe Typ
/dev/sda1 2048 1050623 1048576 512M EFI-System
/dev/sda2 1050624 234440703 233390080 111,3G Linux-Dateisystem

Festplatte /dev/sdb: 186,32 GiB, 200049647616 Bytes, 390721968 Sektoren
Festplattenmodell: SAMSUNG HD200HJ
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 512 Bytes
E/A-Größe (minimal/optimal): 512 Bytes / 512 Bytes
Festplattenbezeichnungstyp: dos
Festplattenbezeichner: 0x13e913e8

Gerät Boot Anfang Ende Sektoren Größe Kn Typ
/dev/sdb1 2048 390721967 390719920 186,3G 83 Linux

Festplatte /dev/sdc: 1,84 TiB, 2000398934016 Bytes, 3907029168 Sektoren
Festplattenmodell: SAMSUNG HD203WI
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 512 Bytes
E/A-Größe (minimal/optimal): 512 Bytes / 512 Bytes
Festplattenbezeichnungstyp: dos
Festplattenbezeichner: 0x00000000

Gerät Boot Anfang Ende Sektoren Größe Kn Typ
/dev/sdc1 63 3907024064 3907024002 1,8T fd Linux RAID-Autoerkennung

Festplatte /dev/sde: 1,84 TiB, 2000398934016 Bytes, 3907029168 Sektoren
Festplattenmodell: SAMSUNG HD203WI
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 512 Bytes
E/A-Größe (minimal/optimal): 512 Bytes / 512 Bytes
Festplattenbezeichnungstyp: dos
Festplattenbezeichner: 0x54cd8732

Gerät Boot Anfang Ende Sektoren Größe Kn Typ
/dev/sde1 63 3907024064 3907024002 1,8T fd Linux RAID-Autoerkennung

Festplatte /dev/sdd: 1,84 TiB, 2000398934016 Bytes, 3907029168 Sektoren
Festplattenmodell: SAMSUNG HD203WI
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 512 Bytes
E/A-Größe (minimal/optimal): 512 Bytes / 512 Bytes
Festplattenbezeichnungstyp: dos
Festplattenbezeichner: 0xd4a5e07f

Gerät Boot Anfang Ende Sektoren Größe Kn Typ
/dev/sdd1 63 3907024064 3907024002 1,8T fd Linux RAID-Autoerkennung

Festplatte /dev/md0: 3,65 TiB, 4000792182784 Bytes, 7814047232 Sektoren
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 512 Bytes
E/A-Größe (minimal/optimal): 65536 Bytes / 131072 Bytes

==================== END DISK INFORMATION ====================

==================== DONE! ====================

```

---

_[View the full topic](https://meta.discourse.org/t/rm-cannot-remove-var-run-postgresql-directory-not-empty/257046)._
