I had a problem with a lack and decrease of disk space in my root partition. I ran sudo du -a / --exclude=/media --exclude=/proc --exclude=/home | sort -n -r | head -n 100 to get a list of large directories/files. Some of those are in /var/lib/docker/.

However I don't have docker installed anymore.

  • Why does that directory still exist, especially if it's so large? Shouldn't it be removed when uninstalling or the user get a prompt asking about it?
  • Why are some files in that directory still being accessed recently?
  • How to find these things out and is it safe to delete that whole directory (only accessible with root/CLI)?

sudo lsof | grep /docker only returns lsof: WARNING: can't stat() fuse file system /run/user/1000/doc Output information may be incomplete.

sudo stat /var/lib/docker/volumes/long-id/_data/journal displays that the file was last accessed today (WiredTiger logs).

I'm using Debian10/KDE.

Edit: as of right now I moved the whole directory to another location. It's multiple GB in size. Maybe that was the cause of the problem of continuously decreasing root partition disk space down to 0B. But finding out whether or not it was would be a separate question.

  • I don’t have an answer for the other questions, but regarding your first question, uninstalling packages doesn’t remove user data, and /var/lib/docker is considered as user data (same as e.g. databases in /var/lib/postgresql etc.). – Stephen Kitt Dec 18 '20 at 16:15
  • I moved it to another partition. I think uninstalling should prompt / inform the user about remaining user-data and/or there should be a simple way (i.e. a GUI) to find and manage/clear user-data of uninstalled packages, if that's not being done I guess that would be an (separate) issue. I didn't find the large directory earlier because the Graphical Disk Map GUI only displayed files on the root-partition that are accessible without root access (and also didn't prompt/inform/provide an option for this). – mYnDstrEAm Dec 18 '20 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.