JP Vossen on 15 Oct 2018 11:26:47 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Disk is Full. How to Move /var?


On 10/14/2018 06:31 PM, Rachel plays Linux wrote:
Doh, yes I meant du -sh rather than ls -sh

+a bunch for this. Find the root of the problem first, they worry about it. It may just be some log rotate failed (as mentioned elsewhere).

----
### Here are the top 5 biggest dirs in var:
$ sudo du -sc /var/* | sort -rn | head -n5
15201296	total
8479696	/var/lib
6066288	/var/cache
603984	/var/log
37424	/var/www
----

Adjust -n5 as needed.

But `du` has to scan the file system every run, so for exploring install and use `ncdu` which is (from the .deb):
"Description-en: ncurses disk usage viewer
"Ncdu is a ncurses-based du viewer. It provides a fast and easy-to-use interface through famous du utility. It allows one to browse through the directories and show percentages of disk usage with ncurses library."

That scans once then gives us an ncurses (console GUI) for exploring (and deleting):
----
$ sudo ncdu /var
ncdu 1.12 ~ Use the arrow keys to navigate, press ? for help --- /var ------------------------------------------------------------------------------------------- 8.1 GiB [##########] /lib
    5.8 GiB [#######   ] /cache
  589.8 MiB [          ] /log
   36.5 MiB [          ] /www
   11.3 MiB [          ] /backups
...
----

Later,
JP
--  -------------------------------------------------------------------
JP Vossen, CISSP | http://www.jpsdomain.org/ | http://bashcookbook.com/
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug