0

I have installed ubuntu 16.04 two days ago and the root partition space was 25 GB. while i was searching for solutions in one blog I found somebody telling me to check the log folder and delete it. I checked my log and it was almost 17 GB! then I deleted it.Then I run df -h and it showed root partition was 69% used. I run the same command after 2sec and it showed 71%. I ran it at least 15 times in 1 minute and eventually it got 100% full. Root partiton showing full in less than a minute. However I checked the log space after that and it showed empty...

Does this normally happens? If not than what is the solution? I am comparatively new to ubuntu and don't actually know what to do!

output of ls -lah /var/log/

Log description

3

It is definitely not normal for your root volume to fill up so quickly. It's almost certainly either a problematic process which is most likely caught in some sort of infinite loop (writing errors to a log somewhere in /var/log/*) Or maybe a task you kicked off is using far more disk space that you expected (often in /tmp) so you need to narrow down what/where is using up the space.

Most likely it's a single file so try running:

find / -size +5G -print

as root which will give you a list of the full paths and filenames of anything over 5 gigabytes. If anything is listed in /tmp or /var (especially /var/log), it's a good bet you've found the problem file. If no files are listed, try running

du -s --one-file-system /*

as root to see how much the top-level directories are using. You can then recursively run this command on the largest result so if /tmp appears to be the problem, next try running:

du -s --one-file-system /tmp/*

and so on until you find the problem directory.

For future reference, a utility I find handy to keep installed is gdmap (http://gdmap.sourceforge.net/ - it's available in the package repos) which will let you quickly visually get a feel of disk usage both by directory and file in a directory tree. Unfortunately, with your root volume filling up as it is, it might not be possible for you to install additional packages right now.

  • Sidenote: when deleting logfiles it may happen that they are not visible any longer via ls -l but still exist (and claim space) because the writing process hasn't closed them yet. The command lsof -nP +L1 may be used to find such deleted-but-still-in-use files. It lists files with less than one link to them together with the owning process. – PerlDuck Oct 2 '18 at 19:08
  • First of all thank you. I probably found it. I think The kern.log file in /var/log location is problematic. It's size showed 18.5 GB. Obviously i couldn't open it in a text editor. So I had to save the tail of the file here paste.ubuntu.com/p/GbQfBgKzJk can you please have a look? – Jack Frost Oct 3 '18 at 6:28
  • Yep, and it looks like an easy one: you've got a PCIe card in your computer that is causing all your trouble. Assuming you're on a desktop, (temporarily) take out any optional cards you can and re-seat whatever you can to see if the errors stop. If they do and you have one or more cards removed, add them back one at a time. If you only have a video card and re-seating it doesn't work, try moving it to a different slot. (you're trying to narrow down if it's a card, a slot, or the motherboard) – blihp Oct 3 '18 at 6:44
  • That could be a good solution, although I found one here askubuntu.com/questions/863150/… just added the parameter {pcie_aspm=off} to the grub file, updated the grub and rebooted. So far It's working well! – Jack Frost Oct 3 '18 at 18:46

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.