Gyrth
Posts: 1
Joined: Thu Mar 14, 2013 10:11 am

kern.log and syslog are too big

Thu Mar 14, 2013 10:18 am

I think I found a bug. I was trying to make my pi to make a timelapse with an usb webcam. With a cronjob it would start my timelapse.sh and write the images to a usb device. Now I was editing my timelapse.sh file and wanted to save. But it said I didn't have enough space left. I tried using rasp-config a few times to expand the root-fs but that didn't work. So I plugged the sd-card into my pc and began to check what was so big on the filesystem. It turns out kern.log and syslog are 3.6 gigs together. I think this is a bug of some sort. I deleted the files and plugged it back into the Raspberry Pi. Now it workes great again.

elatllat
Posts: 1337
Joined: Sat Dec 17, 2011 5:05 pm

Re: kern.log and syslog are too big

Mon Mar 18, 2013 4:55 am

your cron job (or something) is probably producing way more output than it should.
"tail /var/log/kern.log" to find out what the spam is and what is making it.
silence whatever it is with ">/dev/null 2>&1"
or adjust logrotate to clean up faster.
make sure no other logs are big "du -sch /var/log/*"
SBC with 32GB RAM: https://hardkernel.com

FAQ : https://raspberrypi.stackexchange.com

Unanswered: https://www.raspberrypi.org/forums/search.php?search_id=unanswered

SDsolar
Posts: 4
Joined: Wed Mar 01, 2017 1:21 am

Re: kern.log and syslog are too big

Mon Aug 14, 2017 12:12 am

It is very easy to delete these multi-GB files.

sudo rm /var/log/kern*

sudo rm /var/log/messages*

This will speed up rsync backups and help with disk space.

User avatar
rpdom
Posts: 17172
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: kern.log and syslog are too big

Mon Aug 14, 2017 5:29 am

SDsolar wrote:
Mon Aug 14, 2017 12:12 am
Welcome to the forums.

Congratulations. You just replied (somewhat incorrectly) to a four year old post.

You can "rm" a file that is currently in use by another process, but the space used by that file won't be freed up until that process is finished with it.

Don't let that put you off though, learning stuff is just part of being here. Even as a long time Unix/Linux user I've learnt a lot since I got my first Pi and started reading this forum :-)

barsznica
Posts: 20
Joined: Thu Apr 14, 2016 12:38 pm

Re: kern.log and syslog are too big

Wed Jan 02, 2019 5:22 pm

This is how I solved my issue.

Please use that newer thread to avoid duplicates!

Return to “Raspberry Pi OS”