Running out of disk space

In the event your storage space is depleting rapidly, there may be a need to clear disk space. The steps to do this are described below.

  1. Run the following command
df -h

This command displays disk space usage for all mounted file systems in a human-readable format (e.g., sizes in GB and MB).

  1. Run
docker system df -v

This command provides a detailed view of Docker disk usage, including the amount of disk space used by images, containers, and volumes, presented in a verbose format.

  1. Then, run the following command.
docker system prune

This command removes unused Docker objects (such as containers, networks, images, and optionally, volumes) to free up space.

  1. Run
cd /var/log/journal/

This command changes the current directory to /var/log/journal/, which is the location where system logs managed by systemd-journald are stored.

  1. Finally, run
sudo journalctl --vacuum-size=100M

This command reduces the space used by persistent system logs in the journal to 100MB by removing older entries.

Now your disk space is cleared.