I got the warning that I only have 38 MB of disk space left. The reason for this seem to be two huge log files: syslog.1 and kern.log.1 with 388 GB each.
I installed Linux Pop!OS only recently so my system is quite fresh. Before the problem happened I did two things which might have caused this problem:
- I updated the system.
- I tried to install a game (Alpha Protocol) using a DVD and Lutris. The installation seemed to freeze on the first DVD. After a while, the game asked for the second DVD. After entering the second DVD the installation seemed to freeze again. After several hours still nothing happened except the warning about the low disk space. I could not stop the installation so I restarted the computer.
I would like to know the following things:
- What can I do to find out what the problem was?
- How can I shrink these files?
- Is there a possibility to stop this from happening again? I Want to try installing the game again but I do not want to risk destroying my system due problems caused by running out of disk space.
I was a Microsoft Windows user my whole life and have therefore no clue about Linux. An answer would therefore need to be given in a way that even a lay person could understand it.
There are several other questions on this site concerning this problem. However, they are not helpful for me due to various reasons. For example
Very large log files, what should I do?
- The accepted answer has a comment which makes me unsure whether it is wise to use this answer while being someone who does not really know what he is doing: "This answer does not adequately describe what you are supposed to do with lastlog, wtmp, dpkg.log, kern.log and syslog."
- I do not think the accepted answer prevents the problem from happening again or lets me find the reason for this behavior.
- The command from an other answer
tail -n 100 /var/log/syslogdoes not produce an output which helps me find out what the problem is. There is also a longer command
for log in /var/log/{dmesg,syslog,kern.log}; do
echo "${log} :"
sed -e 's/\[[^]]\+\]//' -e 's/.*[0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}//' ${log} \
| sort | uniq -c | sort -hr | head -10
done
which I do not understand what it is doing. Also I do not know whether it will for example produce a copy of the file or something which would be a problem on my already nearly full hard drive.
https://stackoverflow.com/questions/35638219/ubuntu-large-syslog-and-kern-log-files
- The highest voted answer seems to criticize the accepted answer. One of the criticize points is the fact that the log files get deleted. However, I am not sure whether this is not also the case for the highest voted answer.