- Linux clean disk space how to#
- Linux clean disk space install#
- Linux clean disk space driver#
- Linux clean disk space software#
- Linux clean disk space free#
If you want to set an upper limit on your journal logs so they never grow too large, you can do so by editing /etc/systemd/nf in your favorite editor: Permanently limiting the size of your Journal (Systemd) logs These files will automatically be removed over time, but they are safe to delete if you need some disk space right away. This command removes any old, gzipped, files in your log directory which logrotate hasn't deleted on its own yet. This command essentially cleans out your journal logs and reduces them down to 1 Megabyte.
There are a few commands you can run to clean out extraneous log files: As far as we are aware, there is currently no way to mitigate this additional bloat at this time. This is apparently expected behavior and is due to docker keeping a lot of duplicate data around. In some cases you will see the docker image directory - /var/lib/docker/vfs - bloat up on VFS backed servers. If you are running Docker on your server, it may be helpful to clear the Docker Build and Image Caches:
Linux clean disk space how to#
Click here to read our guide on how to change to fuse-overlayfs on existing Docker installations.
Linux clean disk space driver#
You can save a lot of disk space and deploy your Docker images faster on Webdock if you change to the fuse-overlayfs storage driver instead of the vfs default.
Linux clean disk space free#
But regardless of what is using up your disk space, here are some commands you can safely run in order to free up disk space on any Webdock webserver. Once you've discovered what the cause is of your disk space consumption you can much more easily figure out what to do about it. Useful commands for freeing up disk space There are a few ways to clean up logs which we will go into in the next section.
Linux clean disk space software#
If your /var/log directory is consuming lots of space, you should also inspect the contents of that directory and try to pin down which software is eating up lots of log space. Maybe you are being subjected to brute force or DOS attackes which generates a lot of activity in your logs. If your access log is very big, but your website is a low traffic website - you may want to inspect the log to see what is happening. The directories you need to pay attention to here are your /var/log and /var/This would indicate that either your access log is very big as you get a lot of traffic (congratulations!) or your error log is very big, which might indicate a problem with your application.įor example if your website is throwing lots of PHP warnings, you may want to fix those issues.
# sudo du -h -max-depth=1 /var 2>/dev/null
Linux clean disk space install#
Tip: Instead of using the "du" you can also "apt install ncdu" and then run it with "ncdu" which is a graphical equivalent to du, enabling you to browse your filesystem in a, possibly easier, interface than running du commands over and over as shown here below. This is normal for an Ubuntu webserver, as in /var you have all your data typically (website/application and database data) and under /usr you have all your installed applications.īut what specifically in /var is using up space? Here you just modify the path you pass to the du command to see which directories under /var are using the most disk space: This command may take a while to run as it is iterating throughout your entire filesystem - all files and folders - and tallying up disk utilization.Īs you can see from the highlighted entries /var and /usr is using up the most disk space. Usually the partition you are interested in, is the one mounted on / this is the root of your system and which (usually) holds all your data and applications.īut where is all that space being used? Here we use the du, or disk utilization, command. Here you can see our server is consuming 2.6 Gigabyte of a total of 94 Gigabyte available.
instead of bytes which can be hard to read. The -h argument we pass to df just means "human readable" so you get the disk space utilization in Megabytes, Gigabytes etc. Lxd/containers/maintenance 94G 2.6G 91G 3% / On a typical Webdock VPS this will look like:įilesystem Size Used Avail Use% Mounted on You can start with checking out the overall disk space consumption for your system. In addition, you should have shell (SSH) access to your VPS. Most of the commands listed here will work with other Linux distributions as well. This guide assumes you are on Ubuntu 16.04 Xenial or 18.04 Bionic or later.